public class CustomEndpointMonitorImpl extends java.lang.Object implements CustomEndpointMonitor
| Modifier and Type | Field and Description |
|---|---|
protected static long |
CUSTOM_ENDPOINT_INFO_EXPIRATION_NANO |
protected HostSpec |
customEndpointHostSpec |
protected static CacheMap<java.lang.String,CustomEndpointInfo> |
customEndpointInfoCache |
protected java.lang.String |
endpointIdentifier |
protected java.util.concurrent.ExecutorService |
monitorExecutor |
protected PluginService |
pluginService |
protected software.amazon.awssdk.services.rds.RdsClient |
rdsClient |
protected long |
refreshRateNano |
protected software.amazon.awssdk.regions.Region |
region |
protected java.util.concurrent.atomic.AtomicBoolean |
stop |
| Constructor and Description |
|---|
CustomEndpointMonitorImpl(PluginService pluginService,
HostSpec customEndpointHostSpec,
java.lang.String endpointIdentifier,
software.amazon.awssdk.regions.Region region,
long refreshRateNano,
java.util.function.BiFunction<HostSpec,software.amazon.awssdk.regions.Region,software.amazon.awssdk.services.rds.RdsClient> rdsClientFunc)
Constructs a CustomEndpointMonitorImpl instance for the host specified by
customEndpointHostSpec. |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache()
Clears the shared custom endpoint information cache.
|
void |
close()
Stops the custom endpoint monitor.
|
boolean |
hasCustomEndpointInfo()
Indicates whether the monitor has info about the custom endpoint or not.
|
void |
run()
Analyzes a given custom endpoint for changes to custom endpoint information.
|
boolean |
shouldDispose()
Evaluates whether the monitor should be disposed.
|
protected static final CacheMap<java.lang.String,CustomEndpointInfo> customEndpointInfoCache
protected static final long CUSTOM_ENDPOINT_INFO_EXPIRATION_NANO
protected final java.util.concurrent.atomic.AtomicBoolean stop
protected final software.amazon.awssdk.services.rds.RdsClient rdsClient
protected final HostSpec customEndpointHostSpec
protected final java.lang.String endpointIdentifier
protected final software.amazon.awssdk.regions.Region region
protected final long refreshRateNano
protected final PluginService pluginService
protected final java.util.concurrent.ExecutorService monitorExecutor
public CustomEndpointMonitorImpl(PluginService pluginService, HostSpec customEndpointHostSpec, java.lang.String endpointIdentifier, software.amazon.awssdk.regions.Region region, long refreshRateNano, java.util.function.BiFunction<HostSpec,software.amazon.awssdk.regions.Region,software.amazon.awssdk.services.rds.RdsClient> rdsClientFunc)
customEndpointHostSpec.pluginService - The plugin service to use to update the set of allowed/blocked hosts according to
the custom endpoint info.customEndpointHostSpec - The host information for the custom endpoint to be monitored.region - The region of the custom endpoint to be monitored.refreshRateNano - Controls how often the custom endpoint information should be fetched and analyzed for
changes. The value specified should be in nanoseconds.rdsClientFunc - The function to call to create the RDS client that will fetch custom endpoint
information.public void run()
run in interface java.lang.Runnablepublic boolean hasCustomEndpointInfo()
CustomEndpointMonitorhasCustomEndpointInfo in interface CustomEndpointMonitorpublic boolean shouldDispose()
CustomEndpointMonitorshouldDispose in interface CustomEndpointMonitorpublic void close()
close in interface java.lang.AutoCloseablepublic static void clearCache()