Interface DTXAction


public interface DTXAction
This interface provides functionality to create (child) actions, report events/values/errors and tracing web requests.
  • 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

      void reportEvent(String eventName)
      Reports an event with a specified name (but without any value).

      If given eventName is null or an empty String then no event is reported to the system.

      Parameters:
      eventName - name of the event
    • reportValue

      void reportValue(String valueName, int value)
      Reports an int value with a specified name.

      If given valueName is null or an empty String then no event is reported to the system.

      Parameters:
      valueName - name of this value
      value - value itself
    • reportValue

      void reportValue(String valueName, long value)
      Reports a long value with a specified name.

      If given valueName is null or an empty String then no event is reported to the system.

      Parameters:
      valueName - name of this value
      value - value itself
      Since:
      8.197
    • reportValue

      void reportValue(String valueName, double value)
      Reports a double value with a specified name.

      If given valueName is null or an empty String then no event is reported to the system.

      Parameters:
      valueName - name of this value
      value - value itself
    • reportValue

      void reportValue(String valueName, String value)
      Reports a String value with a specified name.

      If given valueName is null or an empty String then no event is reported to the system.

      Parameters:
      valueName - name of this value
      value - value itself The value can be null or an empty String.
    • reportError

      void reportError(String errorName, int errorCode)
      Reports an error with a specified name and error code.

      If given errorName is null or an empty String then no event is reported to the system.

      Parameters:
      errorName - name of this error
      errorCode - numeric error code of this error
    • reportError

      void reportError(String errorName, Throwable throwable)
      Reports an error with a specified name and a Throwable.

      If given errorName is null or an empty string then no event is reported to the system.

      Parameters:
      errorName - name of this error
      throwable - Throwable causing this error
    • cancel

      void cancel()
      Cancels this DTXAction.

      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 void tagRequest(HttpURLConnection conn)
      Deprecated.
      As of version 8.255, instead manually obtain the request tag and the header key and add them to the HTTP headers of HttpURLConnection.
      Places a Dynatrace request tag on a HttpURLConnection web 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: