Class OpenKitImpl
- java.lang.Object
-
- com.dynatrace.openkit.core.objects.OpenKitComposite
-
- com.dynatrace.openkit.core.objects.OpenKitImpl
-
- All Implemented Interfaces:
OpenKit,OpenKitObject,SessionCreatorInput,java.io.Closeable,java.lang.AutoCloseable
public class OpenKitImpl extends OpenKitComposite implements OpenKit, SessionCreatorInput
Actual implementation of theOpenKitinterface.
-
-
Constructor Summary
Constructors Constructor Description OpenKitImpl(OpenKitInitializer initializer)Public constructor for creating an OpenKit instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()SessioncreateSession()Creates a Session instance which can then be used to create Actions.SessioncreateSession(java.lang.String clientIPAddress)Creates a Session instance which can then be used to create Actions.BeaconCachegetBeaconCache()Returns the beacon cache in which new sessions/beacons will be stored until they are sent.intgetCurrentServerId()Returns the current server ID.LoggergetLogger()Returns the logger to report/trace messages.OpenKitConfigurationgetOpenKitConfiguration()Returns the application / device related configurationPrivacyConfigurationgetPrivacyConfiguration()Returns the privacy related configurationSessionIDProvidergetSessionIdProvider()Returns the provider to obtain the next session IDThreadIDProvidergetThreadIdProvider()Returns the provider to obtain the ID of the current thread.TimingProvidergetTimingProvider()Returns the provider to obtain the current timestamp.voidinitialize()Initialize this OpenKit instance.booleanisInitialized()Returns whether OpenKit is initialized or not.voidshutdown()Shuts down OpenKit, ending all open Sessions and waiting for them to be sent.booleanwaitForInitCompletion()Waits until OpenKit is fully initialized.booleanwaitForInitCompletion(long timeoutMillis)Waits until OpenKit is fully initialized or the given timeout expired.-
Methods inherited from class com.dynatrace.openkit.core.objects.OpenKitComposite
getActionID
-
-
-
-
Constructor Detail
-
OpenKitImpl
public OpenKitImpl(OpenKitInitializer initializer)
Public constructor for creating an OpenKit instance.- Parameters:
initializer- provider to get all OpenKit related configuration parameters.
-
-
Method Detail
-
initialize
public void initialize()
Initialize this OpenKit instance.This method starts the
BeaconSenderand is called directly after the instance has been created inDynatraceOpenKitBuilder.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
waitForInitCompletion
public boolean waitForInitCompletion()
Description copied from interface:OpenKitWaits until OpenKit is fully initialized.The calling thread is blocked until OpenKit is fully initialized or until OpenKit is shut down using the
OpenKit.shutdown()method. Be aware, ifDynatraceOpenKitBuilderis wrongly configured, for example when creating an instance with an incorrect endpoint URL, then this method might hang indefinitely, unlessOpenKit.shutdown()is called.- Specified by:
waitForInitCompletionin interfaceOpenKit- Returns:
truewhen OpenKit is fully initialized,falsewhen a shutdown request was made.
-
waitForInitCompletion
public boolean waitForInitCompletion(long timeoutMillis)
Description copied from interface:OpenKitWaits until OpenKit is fully initialized or the given timeout expired.The calling thread is blocked until OpenKit is fully initialized or until OpenKit is shut down using the
OpenKit.shutdown()method or the timeout expired..Be aware, if
DynatraceOpenKitBuilderis wrongly configured, for example when creating an instance with an incorrect endpoint URL, then this method might hang indefinitely, unlessOpenKit.shutdown()is called or timeout expires.- Specified by:
waitForInitCompletionin interfaceOpenKit- Parameters:
timeoutMillis- The maximum number of milliseconds to wait for initialization being completed.- Returns:
truewhen OpenKit is fully initialized,falsewhen a shutdown request was made ortimeoutMillisexpired.
-
isInitialized
public boolean isInitialized()
Description copied from interface:OpenKitReturns whether OpenKit is initialized or not.- Specified by:
isInitializedin interfaceOpenKit- Returns:
trueif OpenKit is fully initialized,falseif OpenKit still performs initialization.
-
createSession
public Session createSession(java.lang.String clientIPAddress)
Description copied from interface:OpenKitCreates a Session instance which can then be used to create Actions.- Specified by:
createSessionin interfaceOpenKit- Parameters:
clientIPAddress- client IP address where this Session is coming from- Returns:
- Session instance to work with
-
createSession
public Session createSession()
Description copied from interface:OpenKitCreates a Session instance which can then be used to create Actions.This is similar to the method
OpenKit.createSession(String), except that the client's IP address is determined on the server side.- Specified by:
createSessionin interfaceOpenKit- Returns:
- Session instance to work with
-
shutdown
public void shutdown()
Description copied from interface:OpenKitShuts down OpenKit, ending all open Sessions and waiting for them to be sent.
-
getLogger
public Logger getLogger()
Description copied from interface:SessionCreatorInputReturns the logger to report/trace messages.- Specified by:
getLoggerin interfaceSessionCreatorInput
-
getOpenKitConfiguration
public OpenKitConfiguration getOpenKitConfiguration()
Description copied from interface:SessionCreatorInputReturns the application / device related configuration- Specified by:
getOpenKitConfigurationin interfaceSessionCreatorInput
-
getPrivacyConfiguration
public PrivacyConfiguration getPrivacyConfiguration()
Description copied from interface:SessionCreatorInputReturns the privacy related configuration- Specified by:
getPrivacyConfigurationin interfaceSessionCreatorInput
-
getBeaconCache
public BeaconCache getBeaconCache()
Description copied from interface:SessionCreatorInputReturns the beacon cache in which new sessions/beacons will be stored until they are sent.- Specified by:
getBeaconCachein interfaceSessionCreatorInput
-
getSessionIdProvider
public SessionIDProvider getSessionIdProvider()
Description copied from interface:SessionCreatorInputReturns the provider to obtain the next session ID- Specified by:
getSessionIdProviderin interfaceSessionCreatorInput
-
getThreadIdProvider
public ThreadIDProvider getThreadIdProvider()
Description copied from interface:SessionCreatorInputReturns the provider to obtain the ID of the current thread.- Specified by:
getThreadIdProviderin interfaceSessionCreatorInput
-
getTimingProvider
public TimingProvider getTimingProvider()
Description copied from interface:SessionCreatorInputReturns the provider to obtain the current timestamp.- Specified by:
getTimingProviderin interfaceSessionCreatorInput
-
getCurrentServerId
public int getCurrentServerId()
Description copied from interface:SessionCreatorInputReturns the current server ID.- Specified by:
getCurrentServerIdin interfaceSessionCreatorInput
-
-