Class NoOpTransaction

  • All Implemented Interfaces:
    Transaction, com.newrelic.api.agent.Transaction

    public class NoOpTransaction
    extends java.lang.Object
    implements Transaction
    • Field Detail

      • AGENT_ATTRIBUTES

        public static final com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,​java.lang.Object> AGENT_ATTRIBUTES
      • USER_ATTRIBUTES

        public static final com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,​java.lang.Object> USER_ATTRIBUTES
    • Constructor Detail

      • NoOpTransaction

        public NoOpTransaction()
    • Method Detail

      • addOutboundResponseHeaders

        public void addOutboundResponseHeaders()
        Specified by:
        addOutboundResponseHeaders in interface Transaction
        Specified by:
        addOutboundResponseHeaders in interface com.newrelic.api.agent.Transaction
      • setTransactionName

        public boolean setTransactionName​(com.newrelic.api.agent.TransactionNamePriority namePriority,
                                          boolean override,
                                          java.lang.String category,
                                          java.lang.String... parts)
        Specified by:
        setTransactionName in interface com.newrelic.api.agent.Transaction
      • setTransactionName

        public boolean setTransactionName​(TransactionNamePriority namePriority,
                                          boolean override,
                                          java.lang.String category,
                                          java.lang.String... parts)
        Description copied from interface: Transaction
        Sets the current transaction's name.
        Specified by:
        setTransactionName in interface Transaction
        override - Overrides the current transaction name if it has the same priority level (or lower).
      • isTransactionNameSet

        public boolean isTransactionNameSet()
        Specified by:
        isTransactionNameSet in interface com.newrelic.api.agent.Transaction
      • getLastTracer

        public TracedMethod getLastTracer()
        Specified by:
        getLastTracer in interface com.newrelic.api.agent.Transaction
      • getTracedMethod

        public TracedMethod getTracedMethod()
        Specified by:
        getTracedMethod in interface com.newrelic.api.agent.Transaction
      • setWebRequest

        public void setWebRequest​(com.newrelic.api.agent.Request request)
        Specified by:
        setWebRequest in interface Transaction
        Parameters:
        request - The current transaction's request.
      • setWebResponse

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

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

        public boolean isWebTransaction()
        Specified by:
        isWebTransaction in interface Transaction
        Specified by:
        isWebTransaction in interface com.newrelic.api.agent.Transaction
      • requestInitialized

        public void requestInitialized​(com.newrelic.api.agent.Request request,
                                       com.newrelic.api.agent.Response response)
        Description copied from interface: Transaction
        Called from servlet containers when a request is initiated. This starts a transaction which will be completed when Transaction.requestDestroyed() is invoked.
        Specified by:
        requestInitialized in interface Transaction
      • requestDestroyed

        public void requestDestroyed()
        Description copied from interface: Transaction
        Called from servlet containers when a request is destroyed to finish the current web transaction.
        Specified by:
        requestDestroyed in interface Transaction
      • ignore

        public void ignore()
        Specified by:
        ignore in interface com.newrelic.api.agent.Transaction
      • ignoreApdex

        public void ignoreApdex()
        Specified by:
        ignoreApdex in interface com.newrelic.api.agent.Transaction
      • ignoreErrors

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

        public void saveMessageParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Specified by:
        saveMessageParameters in interface Transaction
      • finishFlyweightTracer

        public 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)
        Specified by:
        finishFlyweightTracer in interface Transaction
      • getAgentAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAgentAttributes()
        Specified by:
        getAgentAttributes in interface Transaction
      • getUserAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes()
        Specified by:
        getUserAttributes in interface Transaction
      • registerAsyncActivity

        public boolean registerAsyncActivity​(java.lang.Object activityContext)
        Specified by:
        registerAsyncActivity in interface Transaction
        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
      • provideHeaders

        public void provideHeaders​(com.newrelic.api.agent.InboundHeaders headers)
        Description copied from interface: Transaction
        Provide a headers collection to be processed for NewRelic-defined synthetics, CAT, or beacon (RUM) header keys
        Specified by:
        provideHeaders in interface Transaction
        Parameters:
        headers - a headers collection
      • getRequestMetadata

        public java.lang.String getRequestMetadata()
        Specified by:
        getRequestMetadata in interface com.newrelic.api.agent.Transaction
      • processRequestMetadata

        public void processRequestMetadata​(java.lang.String metadata)
        Specified by:
        processRequestMetadata in interface com.newrelic.api.agent.Transaction
      • getResponseMetadata

        public java.lang.String getResponseMetadata()
        Specified by:
        getResponseMetadata in interface com.newrelic.api.agent.Transaction
      • processResponseMetadata

        public void processResponseMetadata​(java.lang.String metadata)
        Specified by:
        processResponseMetadata in interface com.newrelic.api.agent.Transaction
      • processResponseMetadata

        public void processResponseMetadata​(java.lang.String responseMetadata,
                                            java.net.URI uri)
        Specified by:
        processResponseMetadata in interface com.newrelic.api.agent.Transaction
      • setWebRequest

        public void setWebRequest​(com.newrelic.api.agent.ExtendedRequest request)
        Specified by:
        setWebRequest in interface com.newrelic.api.agent.Transaction
      • markFirstByteOfResponse

        public boolean markFirstByteOfResponse()
        Description copied from interface: Transaction
        Does not affect APM UI. See Transaction.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.
        Specified by:
        markFirstByteOfResponse in interface Transaction
        Returns:
        True if the time to first byte was successfully set.
      • markLastByteOfResponse

        public boolean markLastByteOfResponse()
        Description copied from interface: Transaction
        Does not affect APM UI. See Transaction.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.
        Specified by:
        markLastByteOfResponse in interface Transaction
        Returns:
        True if the last byte time has not already been set.
      • markResponseSent

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

        public TracedActivity createAndStartTracedActivity()
        Specified by:
        createAndStartTracedActivity in interface Transaction
        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.
      • getToken

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

        public com.newrelic.api.agent.Segment startSegment​(java.lang.String segmentName)
        Specified by:
        startSegment in interface com.newrelic.api.agent.Transaction
      • startSegment

        public com.newrelic.api.agent.Segment startSegment​(java.lang.String category,
                                                           java.lang.String segmentName)
        Specified by:
        startSegment in interface com.newrelic.api.agent.Transaction
      • expireAllTokens

        public void expireAllTokens()
        Description copied from interface: Transaction
        Expires all tokens associated with the current transaction. The transaction will then end when all currently running work then finishes.
        Specified by:
        expireAllTokens in interface Transaction
      • createDistributedTracePayload

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

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

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

        public void insertDistributedTraceHeaders​(com.newrelic.api.agent.Headers headers)
        Specified by:
        insertDistributedTraceHeaders in interface com.newrelic.api.agent.Transaction
      • acceptDistributedTraceHeaders

        public void acceptDistributedTraceHeaders​(com.newrelic.api.agent.TransportType transportType,
                                                  com.newrelic.api.agent.Headers headers)
        Specified by:
        acceptDistributedTraceHeaders in interface com.newrelic.api.agent.Transaction
      • getSecurityMetaData

        public java.lang.Object getSecurityMetaData()
        Specified by:
        getSecurityMetaData in interface com.newrelic.api.agent.Transaction
      • setTransportType

        public void setTransportType​(com.newrelic.api.agent.TransportType transportType)
        Specified by:
        setTransportType in interface Transaction