public class SessionProxyImpl extends OpenKitComposite implements Session, ServerConfigurationUpdateCallback
Session to perform session splitting after:
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
end()
Ends this Session and marks it as ready for immediate sending.
|
RootAction |
enterAction(java.lang.String actionName)
Enters an Action with a specified name in this Session.
|
void |
identifyUser(java.lang.String userTag)
Tags a session with the provided
userTag. |
boolean |
isFinished()
Indicates whether this session proxy was finished or is still open.
|
void |
onServerConfigurationUpdate(ServerConfiguration serverConfig)
Called when a server configuration is updated.
|
void |
reportCrash(java.lang.String errorName,
java.lang.String reason,
java.lang.String stacktrace)
Reports a crash with a specified error name, crash reason and a stacktrace.
|
long |
splitSessionByTime()
Will end the current active session and start a new one but only if the following conditions are met:
this session proxy is not
finished.
session splitting by idle timeout is enabled and the current session was idle for longer than the
configured timeout. |
java.lang.String |
toString() |
WebRequestTracer |
traceWebRequest(java.lang.String url)
Allows tracing and timing of a web request handled by any 3rd party HTTP Client (e.g.
|
WebRequestTracer |
traceWebRequest(java.net.URLConnection connection)
Traces a web request - which is provided as a URLConnection - and allows adding timing information to this request.
|
getActionIDpublic RootAction enterAction(java.lang.String actionName)
Session
If the given actionName is null or an empty string,
no reporting will happen on that RootAction.
enterAction in interface SessionactionName - name of the Actionpublic void identifyUser(java.lang.String userTag)
SessionuserTag.
If the given userTag is null or an empty string,
this is equivalent to logging off the user.
The last non-empty userTag is re-applied to split sessions.
Details are described in
https://github.com/Dynatrace/openkit-java/blob/main/docs/internals.md#identify-users-on-split-sessions.
identifyUser in interface SessionuserTag - id of the user or null/"" to simulate a log off.public void reportCrash(java.lang.String errorName,
java.lang.String reason,
java.lang.String stacktrace)
Session
If the given errorName is null or an empty string,
no crash report will be sent to the server.
reportCrash in interface SessionerrorName - name of the error leading to the crash (e.g. Exception class)reason - reason or description of that errorstacktrace - stacktrace leading to that crashpublic WebRequestTracer traceWebRequest(java.net.URLConnection connection)
SessiontraceWebRequest in interface Sessionconnection - the URLConnection of the HTTP request to be tagged and timedpublic WebRequestTracer traceWebRequest(java.lang.String url)
SessionOpenKitConstants.WEBREQUEST_TAG_HEADER) has to be set manually to the
tag value of this WebRequestTracer. traceWebRequest in interface Sessionurl - the URL of the web request to be tagged and timedpublic void end()
Sessionpublic boolean isFinished()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic long splitSessionByTime()
finished.-1
is returned.public void onServerConfigurationUpdate(ServerConfiguration serverConfig)
ServerConfigurationUpdateCallbackonServerConfigurationUpdate in interface ServerConfigurationUpdateCallbackserverConfig - the updated server configuration.public java.lang.String toString()
toString in class java.lang.Object