public interface Session
extends java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
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. |
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.
|
void |
reportCrash(java.lang.Throwable throwable)
Reports a crash with error name, crash reason and stacktrace determined from given
Throwable. |
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.
|
RootAction enterAction(java.lang.String actionName)
If the given actionName is null or an empty string,
no reporting will happen on that RootAction.
actionName - name of the Actionvoid identifyUser(java.lang.String userTag)
userTag.
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.
userTag - id of the user or null/"" to simulate a log off.void reportCrash(java.lang.String errorName,
java.lang.String reason,
java.lang.String stacktrace)
If the given errorName is null or an empty string,
no crash report will be sent to the server.
errorName - name of the error leading to the crash (e.g. Exception class)reason - reason or description of that errorstacktrace - stacktrace leading to that crashvoid reportCrash(java.lang.Throwable throwable)
Throwable.
This method is offered as convenience method for reportCrash(Throwable).
throwable - The Throwable causing the crash.WebRequestTracer traceWebRequest(java.net.URLConnection connection)
connection - the URLConnection of the HTTP request to be tagged and timedWebRequestTracer traceWebRequest(java.lang.String url)
OpenKitConstants.WEBREQUEST_TAG_HEADER) has to be set manually to the
tag value of this WebRequestTracer. url - the URL of the web request to be tagged and timedvoid end()