public class CustomEndpointMonitorImpl extends AbstractMonitor 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 static long |
MONITOR_TERMINATION_TIMEOUT_SEC |
protected software.amazon.awssdk.services.rds.RdsClient |
rdsClient |
protected long |
refreshRateNano |
protected software.amazon.awssdk.regions.Region |
region |
protected StorageService |
storageService |
protected static long |
UNAUTHORIZED_SLEEP_SEC |
lastActivityTimestampNanos, monitorExecutor, state, stop, terminationTimeoutSec| Constructor and Description |
|---|
CustomEndpointMonitorImpl(StorageService storageService,
TelemetryFactory telemetryFactory,
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()
Closes all resources used by this monitor.
|
boolean |
hasCustomEndpointInfo()
Indicates whether the monitor has info about the custom endpoint or not.
|
void |
monitor()
Analyzes a given custom endpoint for changes to custom endpoint information.
|
canDispose, getLastActivityTimestampNanos, getState, run, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanDispose, getLastActivityTimestampNanos, getState, start, stopprotected static final CacheMap<java.lang.String,CustomEndpointInfo> customEndpointInfoCache
protected static final long CUSTOM_ENDPOINT_INFO_EXPIRATION_NANO
protected static final long UNAUTHORIZED_SLEEP_SEC
protected static final long MONITOR_TERMINATION_TIMEOUT_SEC
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 long refreshRateNano
protected final StorageService storageService
public CustomEndpointMonitorImpl(StorageService storageService, TelemetryFactory telemetryFactory, 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.storageService - The storage service used to store the set of allowed/blocked hosts according to the
custom endpoint info.telemetryFactory - The telemetry factory used to create telemetry data.customEndpointHostSpec - The host information for the custom endpoint to be monitored.endpointIdentifier - An endpoint identifier.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 monitor()
public boolean hasCustomEndpointInfo()
CustomEndpointMonitorhasCustomEndpointInfo in interface CustomEndpointMonitorpublic void close()
MonitorMonitor.stop().close in interface Monitorclose in class AbstractMonitorpublic static void clearCache()