Class SamplingRequest

java.lang.Object
com.amazonaws.xray.strategy.sampling.SamplingRequest

public class SamplingRequest
extends java.lang.Object
Represents the input request to the sampler. Contains attributes relevant to making sampling decisions.
  • Constructor Summary

    Constructors 
    Constructor Description
    SamplingRequest​(@Nullable java.lang.String service, @Nullable java.lang.String host, @Nullable java.lang.String url, @Nullable java.lang.String method, @Nullable java.lang.String serviceType)  
    SamplingRequest​(java.lang.String roleArn, @Nullable java.lang.String resourceArn, @Nullable java.lang.String service, @Nullable java.lang.String host, @Nullable java.lang.String method, @Nullable java.lang.String url, @Nullable java.lang.String serviceType, @Nullable java.util.Map<java.lang.String,​java.lang.String> attributes)  
  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<java.lang.String> getAccountId()  
    java.util.Map<java.lang.String,​java.lang.String> getAttributes()  
    java.util.Optional<java.lang.String> getHost()  
    java.util.Optional<java.lang.String> getMethod()  
    java.util.Optional<java.lang.String> getResourceARN()  
    java.lang.String getRoleARN()  
    java.util.Optional<java.lang.String> getService()  
    java.util.Optional<java.lang.String> getServiceType()  
    java.util.Optional<java.lang.String> getUrl()  
    void setServiceType​(java.lang.String serviceType)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SamplingRequest

      public SamplingRequest​(java.lang.String roleArn, @Nullable java.lang.String resourceArn, @Nullable java.lang.String service, @Nullable java.lang.String host, @Nullable java.lang.String method, @Nullable java.lang.String url, @Nullable java.lang.String serviceType, @Nullable java.util.Map<java.lang.String,​java.lang.String> attributes)
      Parameters:
      roleArn - the role of the customer requesting a sampling decision. Must not be null.
      resourceArn - the resource for which a sampling decision is being requested. Ex. "arn:aws:execute-api:us-east-1:1234566789012:qsxrty/test/GET/foo/bar/*".
      service - the service name for which a sampling decision is being requested. Ex. "www.foo.com".
      host - the host name extracted from the incoming request Host header.
      method - the Http Method extracted from the Request-Line.
      url - the URL extracted from the Request-Line.
      serviceType - the service type.
      attributes - list of key-value pairs generated on a per-request basis.
    • SamplingRequest

      public SamplingRequest​(@Nullable java.lang.String service, @Nullable java.lang.String host, @Nullable java.lang.String url, @Nullable java.lang.String method, @Nullable java.lang.String serviceType)
  • Method Details

    • getAccountId

      public java.util.Optional<java.lang.String> getAccountId()
    • getRoleARN

      public java.lang.String getRoleARN()
    • getResourceARN

      public java.util.Optional<java.lang.String> getResourceARN()
    • getService

      public java.util.Optional<java.lang.String> getService()
    • getMethod

      public java.util.Optional<java.lang.String> getMethod()
    • getUrl

      public java.util.Optional<java.lang.String> getUrl()
    • getHost

      public java.util.Optional<java.lang.String> getHost()
    • getServiceType

      public java.util.Optional<java.lang.String> getServiceType()
    • getAttributes

      public java.util.Map<java.lang.String,​java.lang.String> getAttributes()
    • setServiceType

      public void setServiceType​(java.lang.String serviceType)