public class InboundHeaderState
extends java.lang.Object
| Constructor and Description |
|---|
InboundHeaderState(Transaction tx,
com.newrelic.api.agent.InboundHeaders inboundHeaders)
Create this inbound header state object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
forceTrace() |
java.lang.String |
getClientCrossProcessId() |
java.lang.String |
getInboundTripId() |
java.lang.String |
getReferrerGuid() |
java.lang.Integer |
getReferringPathHash() |
long |
getRequestContentLength()
It's not always possible for clients to determine the number of bytes sent, so reply with the number of bytes
received.
|
java.util.Map<java.lang.String,java.lang.String> |
getSyntheticsAttrs() |
java.lang.String |
getSyntheticsInitiator() |
java.lang.String |
getSyntheticsJobId() |
java.lang.String |
getSyntheticsMonitorId() |
java.lang.String |
getSyntheticsResourceId() |
java.lang.String |
getSyntheticsType() |
int |
getSyntheticsVersion()
Get the version.
|
java.lang.String |
getUnparsedSyntheticsHeader()
Get the encoded, unparsed synthetics header from the inbound request.
|
java.lang.String |
getUnparsedSyntheticsInfoHeader() |
boolean |
isTrustedCatRequest()
Return true if this is a trusted cross-process request.
|
boolean |
isTrustedSyntheticsRequest()
Return true if this is a trusted request from New Relic Synthetics.
|
public InboundHeaderState(Transaction tx, com.newrelic.api.agent.InboundHeaders inboundHeaders)
Implementation note: the interface Request extends InboundHeaders. If the calling class has a
Request object, the Request should be passed directly; code in this class may test the type of the inboundHeaders
argument and provide more sophisticated processing if the InboundHeaders are in fact a Request.
We go to extra pain to code this in a way that allows all the state in this class to be final.
tx - our owning Transaction. May not be null.inboundHeaders - the deobfuscated inbound headers. This value may be null.public java.lang.String getUnparsedSyntheticsHeader()
This method is public because the inbound synthetic header is copied directly to outbound CAT requests. There's no need to parse and regenerate the header in these cases.
public java.lang.String getUnparsedSyntheticsInfoHeader()
public int getSyntheticsVersion()
isSupportedSyntheticsVersion() rather than calling here and
then performing their own checks on supported versions. External caller must check validity of the version
or customer privacy may be compromised. Currently, the only callers outside this class are non-shipping tests.HeadersUtil.SYNTHETICS_VERSION_NONE.public boolean isTrustedSyntheticsRequest()
Implementation note: None of the callers ever care what the actual value of the Synthetics account ID is, and hence this boolean accessor instead of a standard getter. The same underlying "trust logic" is used for both CAT and Synthetics.
public java.lang.String getSyntheticsResourceId()
public java.lang.String getSyntheticsJobId()
public java.lang.String getSyntheticsMonitorId()
public java.lang.String getSyntheticsType()
public java.lang.String getSyntheticsInitiator()
public java.util.Map<java.lang.String,java.lang.String> getSyntheticsAttrs()
public boolean isTrustedCatRequest()
Implementation note: the request is trusted if the calling ID can be decoded to a non-null value. Most callers don't care what the actual value of the ID is, and hence this boolean accessor in addition to a String getter. The same underlying "trust logic" is used for both CAT and Synthetics.
public java.lang.String getClientCrossProcessId()
public java.lang.String getReferrerGuid()
public boolean forceTrace()
public java.lang.Integer getReferringPathHash()
public java.lang.String getInboundTripId()
public long getRequestContentLength()