Enum NullRootAction
- java.lang.Object
-
- java.lang.Enum<NullRootAction>
-
- com.dynatrace.openkit.core.objects.NullRootAction
-
- All Implemented Interfaces:
Action,RootAction,java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,java.lang.Comparable<NullRootAction>
public enum NullRootAction extends java.lang.Enum<NullRootAction> implements RootAction
This implementation ofRootActionis returned bySession.enterAction(String)when theSession.end()has been called before.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe soleNullRootActioninstance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActioncancelAction()Cancels thisAction.voidclose()ActionenterAction(java.lang.String actionName)Enters a (child) Action with a specified name on this Action.longgetDurationInMilliseconds()Get theaction'sduration in milliseconds.ActionleaveAction()Leaves thisAction.ActionreportError(java.lang.String errorName, int errorCode)Reports an error with a specified name and error code.ActionreportError(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.ActionreportError(java.lang.String errorName, java.lang.Throwable throwable)Reports an error with a specified name and aThrowable.ActionreportEvent(java.lang.String eventName)Reports an event with a specified name (but without any value).ActionreportValue(java.lang.String valueName, double value)Reports adoublevalue with a specified name.ActionreportValue(java.lang.String valueName, int value)Reports anintvalue with a specified name.ActionreportValue(java.lang.String valueName, long value)Reports alongvalue with a specified name.ActionreportValue(java.lang.String valueName, java.lang.String value)Reports aStringvalue with a specified name.WebRequestTracertraceWebRequest(java.lang.String url)Allows tracing and timing of a web request handled by any 3rd party HTTP Client (e.g.WebRequestTracertraceWebRequest(java.net.URLConnection connection)Traces a web request - which is provided as a URLConnection - and allows adding timing information to this request.static NullRootActionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static NullRootAction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NullRootAction INSTANCE
The soleNullRootActioninstance
-
-
Method Detail
-
values
public static NullRootAction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NullRootAction c : NullRootAction.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NullRootAction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
enterAction
public Action enterAction(java.lang.String actionName)
Description copied from interface:RootActionEnters a (child) Action with a specified name on this Action.If the given
actionNameisnullor an empty string, no reporting will happen on thatRootAction.- Specified by:
enterActionin interfaceRootAction- Parameters:
actionName- name of the Action- Returns:
- Action instance to work with
-
reportEvent
public Action reportEvent(java.lang.String eventName)
Description copied from interface:ActionReports an event with a specified name (but without any value).If given
eventNameisnullor an empty String then no event is reported to the system.- Specified by:
reportEventin interfaceAction- Parameters:
eventName- name of the event- Returns:
- this Action (for usage as fluent API)
-
reportValue
public Action reportValue(java.lang.String valueName, int value)
Description copied from interface:ActionReports anintvalue with a specified name.If given
valueNameisnullor an empty String then no event is reported to the system.- Specified by:
reportValuein interfaceAction- Parameters:
valueName- name of this valuevalue- value itself- Returns:
- this Action (for usage as fluent API)
-
reportValue
public Action reportValue(java.lang.String valueName, long value)
Description copied from interface:ActionReports alongvalue with a specified name.If given
valueNameisnullor an empty String then no event is reported to the system.- Specified by:
reportValuein interfaceAction- Parameters:
valueName- name of this valuevalue- value itself- Returns:
- this Action (for usage as fluent API)
-
reportValue
public Action reportValue(java.lang.String valueName, double value)
Description copied from interface:ActionReports adoublevalue with a specified name.If given
valueNameisnullor an empty String then no event is reported to the system.- Specified by:
reportValuein interfaceAction- Parameters:
valueName- name of this valuevalue- value itself- Returns:
- this Action (for usage as fluent API)
-
reportValue
public Action reportValue(java.lang.String valueName, java.lang.String value)
Description copied from interface:ActionReports aStringvalue with a specified name.If given
valueNameisnullor an empty String then no event is reported to the system.- Specified by:
reportValuein interfaceAction- Parameters:
valueName- name of this valuevalue- value itself Thevaluecan benullor an empty String.- Returns:
- this Action (for usage as fluent API)
-
reportError
public Action reportError(java.lang.String errorName, int errorCode)
Description copied from interface:ActionReports an error with a specified name and error code.If given
errorNameisnullor an empty String then no event is reported to the system.- Specified by:
reportErrorin interfaceAction- Parameters:
errorName- name of this errorerrorCode- numeric error code of this error- Returns:
- this Action (for usage as fluent API)
-
reportError
public Action reportError(java.lang.String errorName, java.lang.String causeName, java.lang.String causeDescription, java.lang.String causeStackTrace)
Description copied from interface:ActionReports an error with a specified name and fields describing the cause of this error.If given
errorNameisnullor an empty string then no event is reported to the system. If thecauseDescriptionis longer than 1000 characters, it is truncated to this value. If thecauseStackTraceis longer than 128.000 characters, it is truncated according to the last line break.- Specified by:
reportErrorin interfaceAction- Parameters:
errorName- 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. theThrowablestack trace- Returns:
- this Action (for usage as fluent API)
-
reportError
public Action reportError(java.lang.String errorName, java.lang.Throwable throwable)
Description copied from interface:ActionReports an error with a specified name and aThrowable.If given
errorNameisnullor an empty string then no event is reported to the system.- Specified by:
reportErrorin interfaceAction- Parameters:
errorName- name of this errorthrowable-Throwablecausing this error- Returns:
- this Action (for usage as fluent API)
-
traceWebRequest
public WebRequestTracer traceWebRequest(java.net.URLConnection connection)
Description copied from interface:ActionTraces a web request - which is provided as a URLConnection - and allows adding timing information to this request. If the web request is continued on a server-side Agent (e.g. Java, .NET, ...) this Session will be correlated to the resulting server-side PurePath.If given
connectionisnullthen no event is reported to the system.- Specified by:
traceWebRequestin interfaceAction- Parameters:
connection- the URLConnection of the HTTP request to be tagged and timed- Returns:
- a WebRequestTracer which allows adding timing information
-
traceWebRequest
public WebRequestTracer traceWebRequest(java.lang.String url)
Description copied from interface:ActionAllows tracing and timing of a web request handled by any 3rd party HTTP Client (e.g. Apache, Google, Jetty, ...). In this case the Dynatrace HTTP header (OpenKitConstants.WEBREQUEST_TAG_HEADER) has to be set manually to the tag value of this WebRequestTracer.
If the web request is continued on a server-side Agent (e.g. Java, .NET, ...) this Session will be correlated to the resulting server-side PurePath.If given
urlisnullor an empty string then no event is reported to the system.- Specified by:
traceWebRequestin interfaceAction- Parameters:
url- the URL of the web request to be tagged and timed- Returns:
- a WebRequestTracer which allows getting the tag value and adding timing information
-
leaveAction
public Action leaveAction()
Description copied from interface:ActionLeaves thisAction.- Specified by:
leaveActionin interfaceAction- Returns:
- the parent Action, or
nullif there is no parent Action
-
cancelAction
public Action cancelAction()
Description copied from interface:ActionCancels thisAction.Canceling an action is similar to
leaving an action, except that the data and all unfinished child objects are discarded instead of being sent.- Specified by:
cancelActionin interfaceAction- Returns:
- the parent Action, or
nullif there is no parent Action
-
getDurationInMilliseconds
public long getDurationInMilliseconds()
Description copied from interface:ActionGet theaction'sduration in milliseconds.The duration of an
Actionis equal to thecurrent timestamp - start timestamp, if the action is still open, orend timestamp - start timestampifAction.leaveAction()orAction.cancelAction()was already called.- Specified by:
getDurationInMillisecondsin interfaceAction- Returns:
- The duration of this
Action.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-