Interface Transaction

  • All Superinterfaces:
    com.newrelic.api.agent.Transaction
    All Known Implementing Classes:
    NoOpTransaction

    public interface Transaction
    extends com.newrelic.api.agent.Transaction
    The internal bridge version of Transaction.
    • Method Detail

      • getAgentAttributes

        java.util.Map<java.lang.String,​java.lang.Object> getAgentAttributes()
      • getUserAttributes

        java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes()
      • setTransactionName

        boolean setTransactionName​(TransactionNamePriority namePriority,
                                   boolean override,
                                   java.lang.String category,
                                   java.lang.String... parts)
        Sets the current transaction's name.
        Parameters:
        namePriority -
        override - Overrides the current transaction name if it has the same priority level (or lower).
        category -
        parts -
      • beforeSendResponseHeaders

        @Deprecated
        void beforeSendResponseHeaders()
        Deprecated.
      • addOutboundResponseHeaders

        @Deprecated
        void addOutboundResponseHeaders()
        Deprecated.
        Specified by:
        addOutboundResponseHeaders in interface com.newrelic.api.agent.Transaction
      • isStarted

        boolean isStarted()
      • setApplicationName

        void setApplicationName​(ApplicationNamePriority priority,
                                java.lang.String appName)
        Sets the name of the application as reported in the New Relic UI.
        Parameters:
        priority -
        appName -
      • isAutoAppNamingEnabled

        boolean isAutoAppNamingEnabled()
      • isWebRequestSet

        @Deprecated
        boolean isWebRequestSet()
        Deprecated.
        Returns:
      • isWebResponseSet

        @Deprecated
        boolean isWebResponseSet()
        Deprecated.
        Returns:
      • setWebRequest

        @Deprecated
        void setWebRequest​(com.newrelic.api.agent.Request request)
        Deprecated.
        Parameters:
        request - The current transaction's request.
      • setWebResponse

        @Deprecated
        void setWebResponse​(com.newrelic.api.agent.Response response)
        Deprecated.
        Specified by:
        setWebResponse in interface com.newrelic.api.agent.Transaction
        Parameters:
        response - The current transaction's response.
      • provideHeaders

        void provideHeaders​(com.newrelic.api.agent.InboundHeaders headers)
        Provide a headers collection to be processed for NewRelic-defined synthetics, CAT, or beacon (RUM) header keys
        Parameters:
        headers - a headers collection
      • getWebResponse

        @Deprecated
        WebResponse getWebResponse()
        Deprecated.
        Returns:
      • convertToWebTransaction

        @Deprecated
        void convertToWebTransaction()
        Deprecated.
        Specified by:
        convertToWebTransaction in interface com.newrelic.api.agent.Transaction
      • isWebTransaction

        @Deprecated
        boolean isWebTransaction()
        Deprecated.
        Specified by:
        isWebTransaction in interface com.newrelic.api.agent.Transaction
        Returns:
      • ignoreErrors

        void ignoreErrors()
        Ignore throwable and http status code errors resulting from this transaction.
        Specified by:
        ignoreErrors in interface com.newrelic.api.agent.Transaction
      • requestInitialized

        void requestInitialized​(com.newrelic.api.agent.Request request,
                                com.newrelic.api.agent.Response response)
        Called from servlet containers when a request is initiated. This starts a transaction which will be completed when requestDestroyed() is invoked.
        Parameters:
        request -
        response -
      • requestDestroyed

        void requestDestroyed()
        Called from servlet containers when a request is destroyed to finish the current web transaction.
      • saveMessageParameters

        void saveMessageParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Parameters:
        parameters -
      • startFlyweightTracer

        TracedMethod startFlyweightTracer()
        Starts a flyweight tracer and returns the parent tracer.
        Returns:
      • finishFlyweightTracer

        void finishFlyweightTracer​(TracedMethod parent,
                                   long startInNanos,
                                   long finishInNanos,
                                   java.lang.String className,
                                   java.lang.String methodName,
                                   java.lang.String methodDesc,
                                   java.lang.String metricName,
                                   java.lang.String[] rollupMetricNames)
        Parameters:
        parent -
        startInNanos -
        finishInNanos -
        className -
        methodName -
        methodDesc -
        metricName -
        rollupMetricNames -
      • registerAsyncActivity

        @Deprecated
        boolean registerAsyncActivity​(java.lang.Object activityContext)
        Deprecated.
        Parameters:
        activityContext - the key used by instrumentation to identify this asynchronous activity. The value must be unique across all asynchronous activities tracked during the life of the current Agent instance.
        Returns:
        true if the registration succeeded else false
      • markFirstByteOfResponse

        boolean markFirstByteOfResponse()
        Does not affect APM UI. See markResponseSent() to set the response time. Marks the time when the first byte of the response left the server. This time can only be set once. After the first setting, all other attempts to set the time will fail and return false.
        Returns:
        True if the time to first byte was successfully set.
      • markLastByteOfResponse

        boolean markLastByteOfResponse()
        Does not affect APM UI. See markResponseSent() to set the response time. Marks the time to last byte as right now (as this method is called). This time can only be set once. After the first setting, all other attempts to set the time will fail and return false.
        Returns:
        True if the last byte time has not already been set.
      • markResponseAtTxaEnd

        @Deprecated
        void markResponseAtTxaEnd()
        Deprecated.
      • markResponseSent

        @Deprecated
        boolean markResponseSent()
        Deprecated.
        Specified by:
        markResponseSent in interface com.newrelic.api.agent.Transaction
        Returns:
        True if the call to set the response time was successful
      • getToken

        @Deprecated
        Token getToken()
        Deprecated.
        Specified by:
        getToken in interface com.newrelic.api.agent.Transaction
        Returns:
        A token to pass to another thread with work for the current transaction.
      • expireAllTokens

        void expireAllTokens()
        Expires all tokens associated with the current transaction. The transaction will then end when all currently running work then finishes.
      • clearTransaction

        boolean clearTransaction()
      • createAndStartTracedActivity

        @Deprecated
        TracedActivity createAndStartTracedActivity()
        Deprecated.
        Returns:
        a new traced activity, if successful. Will return null if the circuit breaker is tripped, if the transaction has not started, or if the transaction is ignored.
      • createDistributedTracePayload

        com.newrelic.api.agent.DistributedTracePayload createDistributedTracePayload()
        Create a distributed trace payload.
        Specified by:
        createDistributedTracePayload in interface com.newrelic.api.agent.Transaction
        Returns:
        a DistributedTracePayload
      • acceptDistributedTracePayload

        void acceptDistributedTracePayload​(java.lang.String payload)
        Accept a distributed trace payload.
        Specified by:
        acceptDistributedTracePayload in interface com.newrelic.api.agent.Transaction
        Parameters:
        payload - DistributedTracePayload to accept
      • acceptDistributedTracePayload

        void acceptDistributedTracePayload​(com.newrelic.api.agent.DistributedTracePayload payload)
        Accept a distributed trace payload.
        Specified by:
        acceptDistributedTracePayload in interface com.newrelic.api.agent.Transaction
        Parameters:
        payload - DistributedTracePayload to accept
      • setTransportType

        void setTransportType​(com.newrelic.api.agent.TransportType transportType)