Interface DTXAction
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels thisDTXAction.Returns the Dynatrace request tag which has to be set manually as HTTP header.Returns the Dynatrace request tag header name.booleanReturns true if this action is completed.voidCompletes this action and prepares the data for the next sending interval.voidreportError(String errorName, int errorCode) Reports an error with a specified name and error code.voidreportError(String errorName, Throwable throwable) Reports an error with a specified name and aThrowable.voidreportEvent(String eventName) Reports an event with a specified name (but without any value).voidreportValue(String valueName, double value) Reports adoublevalue with a specified name.voidreportValue(String valueName, int value) Reports anintvalue with a specified name.voidreportValue(String valueName, long value) Reports alongvalue with a specified name.voidreportValue(String valueName, String value) Reports aStringvalue with a specified name.voidtagRequest(HttpURLConnection conn) Deprecated.
-
Method Details
-
leaveAction
void leaveAction()Completes this action and prepares the data for the next sending interval.When an outer/parent action is exited, all nested/child actions are automatically closed.
-
reportEvent
Reports an event with a specified name (but without any value).If given
eventNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
eventName- name of the event
-
reportValue
Reports anintvalue with a specified name.If given
valueNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
valueName- name of this valuevalue- value itself
-
reportValue
Reports alongvalue with a specified name.If given
valueNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
valueName- name of this valuevalue- value itself- Since:
- 8.197
-
reportValue
Reports adoublevalue with a specified name.If given
valueNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
valueName- name of this valuevalue- value itself
-
reportValue
Reports aStringvalue with a specified name.If given
valueNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
valueName- name of this valuevalue- value itself Thevaluecan benullor an emptyString.
-
reportError
Reports an error with a specified name and error code.If given
errorNameisnullor an emptyStringthen no event is reported to the system.- Parameters:
errorName- name of this errorerrorCode- numeric error code of this error
-
reportError
Reports an error with a specified name and aThrowable.If given
errorNameisnullor an empty string then no event is reported to the system.- Parameters:
errorName- name of this errorthrowable-Throwablecausing this error
-
cancel
void cancel()Cancels thisDTXAction.Canceling an action is similar to
leaving an action, except that the data and all unfinished child objects are discarded instead of being sent.- Since:
- 8.231
-
tagRequest
Deprecated.As of version 8.255, insteadmanually obtain the request tagand theheader keyand add them to the HTTP headers ofHttpURLConnection.Places a Dynatrace request tag on aHttpURLConnectionweb request.This tag is evaluated by the corresponding web server agent. The Dynatrace server will link the server-side PurePath data with this mobile user action.
- Parameters:
conn- the request tag will be added as header to this connection- See Also:
-
isFinished
boolean isFinished()Returns true if this action is completed.Completion may be due to normal finalization, extraordinary termination (like agent shutdown) or cancellation. In all of these cases, this method will return true. Further interactions on finished actions are not allowed and should be avoided.
- Returns:
- true, if action is finished
- Since:
- 8.231
-
getRequestTagHeader
String getRequestTagHeader()Returns the Dynatrace request tag header name.This header is used together with the tag generated by
Dynatrace.getRequestTag()and placed as HTTP header onto a web request.- Returns:
- the request tag header name
- See Also:
-
getRequestTag
String getRequestTag()Returns the Dynatrace request tag which has to be set manually as HTTP header.The header key can be obtained with the method
getRequestTagHeader(). If there is an open action in the current thread at the time the request is tagged, the web request is assigned (by the mobile agent) to the open action.- Returns:
- the request tag value or an empty string, if the mobile agent is not active
- See Also:
-
manually obtain the request tagand theheader keyand add them to the HTTP headers ofHttpURLConnection.