public class HeartBeatProvider extends java.lang.Object implements HeartBeatProviderInterface, Stoppable
Concrete implementation of Heartbeat functionality. This class implements
HeartBeatProviderInterface and
Stoppable
DEFAULT_HEARTBEAT_INTERVAL, MINIMUM_HEARTBEAT_INTERVAL| Constructor and Description |
|---|
HeartBeatProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addHeartBeatProperty(java.lang.String propertyName,
java.lang.String propertyValue,
boolean isHealthy)
Adds the heartbeat property to the heartbeat payload.
|
boolean |
containsHeartBeatProperty(java.lang.String key)
Returns true if the HeartBeat provider has the given HeartBeat Property
|
java.util.List<java.lang.String> |
getExcludedHeartBeatProperties()
Returns the list of excluded heartbeat properties.
|
java.util.List<java.lang.String> |
getExcludedHeartBeatPropertyProviders()
This returns the list of Excluded Heart Beat Providers
|
long |
getHeartBeatInterval()
Gets the currently set heartbeat interval.
|
java.lang.String |
getInstrumentationKey()
Gets the instrumentation key used by telemetry client sending heartbeat.
|
void |
initialize(TelemetryConfiguration configuration)
This method initializes the concrete module.
|
boolean |
isHeartBeatEnabled()
Returns if heartbeat is enabled or not.
|
void |
setExcludedHeartBeatProperties(java.util.List<java.lang.String> excludedHeartBeatProperties)
Sets the list of properties to be excluded from heartbeat payload.
|
void |
setExcludedHeartBeatPropertyProviders(java.util.List<java.lang.String> excludedHeartBeatPropertyProviders)
Sets the list of excluded heartbeat providers.
|
void |
setHeartBeatEnabled(boolean isEnabled)
Enables or disables heartbeat module.
|
void |
setHeartBeatInterval(long timeUnit)
Sets the time interval of heartbeat in seconds.
|
boolean |
setHeartBeatProperty(java.lang.String propertyName,
java.lang.String propertyValue,
boolean isHealthy)
Sets the value of already existing heartbeat property in the payload.
|
void |
setInstrumentationKey(java.lang.String key)
Sets the instrumentation key
|
void |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit) |
public java.lang.String getInstrumentationKey()
HeartBeatProviderInterfacegetInstrumentationKey in interface HeartBeatProviderInterfacepublic void setInstrumentationKey(java.lang.String key)
HeartBeatProviderInterfacesetInstrumentationKey in interface HeartBeatProviderInterfacekey - Key to be setpublic void initialize(TelemetryConfiguration configuration)
HeartBeatProviderInterfaceinitialize in interface HeartBeatProviderInterfaceconfiguration - TelemetryConfigurationpublic boolean addHeartBeatProperty(java.lang.String propertyName,
java.lang.String propertyValue,
boolean isHealthy)
HeartBeatProviderInterfaceaddHeartBeatProperty in interface HeartBeatProviderInterfacepropertyName - Name of the property to be added in Heartbeat payloadpropertyValue - Value of the property to be added in Heartbeat payloadisHealthy - indicates if heartbeat is healthypublic boolean setHeartBeatProperty(java.lang.String propertyName,
java.lang.String propertyValue,
boolean isHealthy)
HeartBeatProviderInterfacesetHeartBeatProperty in interface HeartBeatProviderInterfacepropertyName - Name of the property to be added in Heartbeat payloadpropertyValue - Value of the property to be added in Heartbeat payloadisHealthy - indicates if heartbeat is healthypublic boolean isHeartBeatEnabled()
HeartBeatProviderInterfaceisHeartBeatEnabled in interface HeartBeatProviderInterfacepublic void setHeartBeatEnabled(boolean isEnabled)
HeartBeatProviderInterfacesetHeartBeatEnabled in interface HeartBeatProviderInterfaceisEnabled - state of the heartbeat (enabled/disabled)public java.util.List<java.lang.String> getExcludedHeartBeatPropertyProviders()
HeartBeatProviderInterfacegetExcludedHeartBeatPropertyProviders in interface HeartBeatProviderInterfacepublic void setExcludedHeartBeatPropertyProviders(java.util.List<java.lang.String> excludedHeartBeatPropertyProviders)
HeartBeatProviderInterfacesetExcludedHeartBeatPropertyProviders in interface HeartBeatProviderInterfaceexcludedHeartBeatPropertyProviders - List of heartbeat providers to be excludedpublic long getHeartBeatInterval()
HeartBeatProviderInterfacegetHeartBeatInterval in interface HeartBeatProviderInterfacepublic void setHeartBeatInterval(long timeUnit)
HeartBeatProviderInterfacesetHeartBeatInterval in interface HeartBeatProviderInterfacetimeUnit - Heartbeat interval in secondspublic java.util.List<java.lang.String> getExcludedHeartBeatProperties()
HeartBeatProviderInterfacegetExcludedHeartBeatProperties in interface HeartBeatProviderInterfacepublic void setExcludedHeartBeatProperties(java.util.List<java.lang.String> excludedHeartBeatProperties)
HeartBeatProviderInterfacesetExcludedHeartBeatProperties in interface HeartBeatProviderInterfaceexcludedHeartBeatProperties - List of properties to be excludedpublic boolean containsHeartBeatProperty(java.lang.String key)
HeartBeatProviderInterfacecontainsHeartBeatProperty in interface HeartBeatProviderInterface