public enum NullSession extends java.lang.Enum<NullSession> implements Session
Session implementation is returned by OpenKit.createSession(String) when the OpenKit.shutdown()
has been called before.| Enum Constant and Description |
|---|
INSTANCE
The sole
NullSession instance |
| 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. |
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.
|
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.
|
static NullSession |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static NullSession[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NullSession INSTANCE
NullSession instancepublic static NullSession[] values()
for (NullSession c : NullSession.values()) System.out.println(c);
public static NullSession valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic 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 void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseable