| Modifier and Type | Method and Description |
|---|---|
void |
clearCapturedData()
Clears data that has been captured so far.
|
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.
|
BeaconConfiguration |
getBeaconConfiguration()
Get the
BeaconConfiguration |
long |
getEndTime() |
void |
identifyUser(java.lang.String userTag)
Tags a session with the provided
userTag. |
boolean |
isEmpty()
Test if this Session is empty or not.
|
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.
|
StatusResponse |
sendBeacon(HTTPClientProvider clientProvider) |
void |
setBeaconConfiguration(BeaconConfiguration beaconConfiguration)
Set the
BeaconConfiguration |
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.
|
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic 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,
no user identification will be reported to the server.
identifyUser in interface SessionuserTag - id of the userpublic 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 StatusResponse sendBeacon(HTTPClientProvider clientProvider)
public long getEndTime()
public void clearCapturedData()
This is called, when capturing is turned off to avoid having too much data.
public boolean isEmpty()
A session is considered to be empty, if it does not contain any action or event data.
true if the session is empty, false otherwise.public void setBeaconConfiguration(BeaconConfiguration beaconConfiguration)
BeaconConfigurationpublic BeaconConfiguration getBeaconConfiguration()
BeaconConfigurationpublic java.lang.String toString()
toString in class java.lang.Object