public abstract class BaseActionImpl extends OpenKitComposite implements CancelableOpenKitObject, Action
Action interface.| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the
OpenKitObject. |
Action |
cancelAction()
Cancels this
Action. |
void |
close() |
int |
getActionID()
Get the action id of this composite or
0 if the composite is not an action. |
long |
getDurationInMilliseconds()
Get the
action's duration in milliseconds. |
int |
getEndSequenceNo() |
long |
getEndTime() |
int |
getID() |
java.lang.String |
getName() |
protected abstract Action |
getParentAction()
Get the parent Action, which might be
null in case the parent does not implement Action. |
int |
getParentID() |
int |
getStartSequenceNo() |
long |
getStartTime() |
Action |
leaveAction()
Leaves this
Action. |
Action |
reportError(java.lang.String errorName,
int errorCode)
Reports an error with a specified name and error code.
|
Action |
reportError(java.lang.String errorName,
int errorCode,
java.lang.String reason)
Deprecated.
|
Action |
reportError(java.lang.String errorName,
java.lang.String causeName,
java.lang.String causeDescription,
java.lang.String causeStackTrace)
Reports an error with a specified name and fields describing the cause of this error.
|
Action |
reportError(java.lang.String errorName,
java.lang.Throwable throwable)
Reports an error with a specified name and a
Throwable. |
Action |
reportEvent(java.lang.String eventName)
Reports an event with a specified name (but without any value).
|
Action |
reportValue(java.lang.String valueName,
double value)
Reports a
double value with a specified name. |
Action |
reportValue(java.lang.String valueName,
int value)
Reports an
int value with a specified name. |
Action |
reportValue(java.lang.String valueName,
long value)
Reports a
long value with a specified name. |
Action |
reportValue(java.lang.String valueName,
java.lang.String value)
Reports a
String value with a specified name. |
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 cancel()
CancelableOpenKitObjectOpenKitObject.
Canceling is similar to closing, except that data that is not reported yet, will not be reported at all.
cancel in interface CancelableOpenKitObjectpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic Action reportEvent(java.lang.String eventName)
Action
If given eventName is null or an empty String then no event is reported to the system.
reportEvent in interface ActioneventName - name of the eventpublic Action reportValue(java.lang.String valueName, int value)
Actionint value with a specified name.
If given valueName is null or an empty String then no event is reported to the system.
reportValue in interface ActionvalueName - name of this valuevalue - value itselfpublic Action reportValue(java.lang.String valueName, long value)
Actionlong value with a specified name.
If given valueName is null or an empty String then no event is reported to the system.
reportValue in interface ActionvalueName - name of this valuevalue - value itselfpublic Action reportValue(java.lang.String valueName, double value)
Actiondouble value with a specified name.
If given valueName is null or an empty String then no event is reported to the system.
reportValue in interface ActionvalueName - name of this valuevalue - value itselfpublic Action reportValue(java.lang.String valueName, java.lang.String value)
ActionString value with a specified name.
If given valueName is null or an empty String then no event is reported to the system.
reportValue in interface ActionvalueName - name of this valuevalue - value itself
The value can be null or an empty String.@Deprecated public Action reportError(java.lang.String errorName, int errorCode, java.lang.String reason)
Action
If given errorName is null or an empty String then no event is reported to the system.
reportError in interface ActionerrorName - name of this errorerrorCode - numeric error code of this errorreason - reason for this errorpublic Action reportError(java.lang.String errorName, int errorCode)
Action
If given errorName is null or an empty String then no event is reported to the system.
reportError in interface ActionerrorName - name of this errorerrorCode - numeric error code of this errorpublic Action reportError(java.lang.String errorName, java.lang.String causeName, java.lang.String causeDescription, java.lang.String causeStackTrace)
Action
If given errorName is null or an empty string then no event is reported to the system.
reportError in interface ActionerrorName - name of this errorcauseName - name describing the cause of the error.
E.g. the class name of a caught exception.causeDescription - description what caused the error
E.g. Throwable.getMessage() of a caught exception.causeStackTrace - stack trace of the error
E.g. the Throwable stack tracepublic Action reportError(java.lang.String errorName, java.lang.Throwable throwable)
ActionThrowable.
If given errorName is null or an empty string then no event is reported to the system.
reportError in interface ActionerrorName - name of this errorthrowable - Throwable causing this errorpublic WebRequestTracer traceWebRequest(java.net.URLConnection connection)
Action
If given connection is null then no event is reported to the system.
traceWebRequest in interface Actionconnection - the URLConnection of the HTTP request to be tagged and timedpublic WebRequestTracer traceWebRequest(java.lang.String url)
ActionOpenKitConstants.WEBREQUEST_TAG_HEADER) has to be set manually to the
tag value of this WebRequestTracer.
If given url is null or an empty string then no event is reported to the system.
traceWebRequest in interface Actionurl - the URL of the web request to be tagged and timedpublic Action leaveAction()
ActionAction.leaveAction in interface Actionnull if there is no parent Actionpublic Action cancelAction()
ActionAction.
Canceling an action is similar to leaving an action, except that
the data and all unfinished child objects are discarded instead of being sent.
cancelAction in interface Actionnull if there is no parent Actionpublic long getDurationInMilliseconds()
Actionaction's duration in milliseconds.
The duration of an Action is equal to the current timestamp - start timestamp, if the
action is still open, or end timestamp - start timestamp if Action.leaveAction() or
Action.cancelAction() was already called.
getDurationInMilliseconds in interface ActionAction.protected abstract Action getParentAction()
null in case the parent does not implement Action.null if parent does not implement Action.public int getActionID()
OpenKitComposite0 if the composite is not an action.
The default return value of 0 is implemented here.
Action related composites need to override this method and return the appropriate value.
getActionID in class OpenKitCompositepublic int getID()
public java.lang.String getName()
public int getParentID()
public long getStartTime()
public long getEndTime()
public int getStartSequenceNo()
public int getEndSequenceNo()