Class DaemonConfiguration

java.lang.Object
com.amazonaws.xray.config.DaemonConfiguration

public class DaemonConfiguration
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.net.InetSocketAddress address
    Deprecated.
    static java.lang.String DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY
    Environment variable key used to override the address to which UDP packets will be emitted.
    static java.lang.String DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY
    System property key used to override the address to which UDP packets will be emitted.
  • Constructor Summary

    Constructors 
    Constructor Description
    DaemonConfiguration()  
  • Method Summary

    Modifier and Type Method Description
    java.net.InetSocketAddress getAddressForEmitter()  
    java.lang.String getEndpointForTCPConnection()  
    java.lang.String getTCPAddress()  
    java.lang.String getUDPAddress()  
    void setDaemonAddress​(java.lang.String socketAddress)
    Sets the daemon address.
    void setTCPAddress​(java.lang.String addr)  
    void setUDPAddress​(java.lang.String addr)  
    boolean setUDPAndTCPAddress​(@Nullable java.lang.String addr)
    Force set daemon address regardless of environment variable or system property.

    Methods inherited from class java.lang.Object

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

    • DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY

      public static final java.lang.String DAEMON_ADDRESS_ENVIRONMENT_VARIABLE_KEY
      Environment variable key used to override the address to which UDP packets will be emitted. Valid values are of the form `ip_address:port`. Takes precedence over any system property, constructor value, or setter value used.
      See Also:
      Constant Field Values
    • DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY

      public static final java.lang.String DAEMON_ADDRESS_SYSTEM_PROPERTY_KEY
      System property key used to override the address to which UDP packets will be emitted. Valid values are of the form `ip_address:port`. Takes precedence over any constructor or setter value used.
      See Also:
      Constant Field Values
    • address

      @Deprecated public java.net.InetSocketAddress address
      Deprecated.
  • Constructor Details

  • Method Details

    • setDaemonAddress

      public void setDaemonAddress​(java.lang.String socketAddress)
      Sets the daemon address. If either the AWS_XRAY_DAEMON_ADDRESS environment variable or com.amazonaws.xray.emitters.daemonAddress system property are set to a non-empty value, calling this method does nothing.
      Parameters:
      socketAddress - A notation of '127.0.0.1:2000' or 'tcp:127.0.0.1:2000 udp:127.0.0.2:2001' are both acceptable. The former one means UDP and TCP are running at the same address.
      Throws:
      java.lang.IllegalArgumentException - if socketAddress does not match the specified format.
    • setUDPAndTCPAddress

      public boolean setUDPAndTCPAddress​(@Nullable java.lang.String addr)
      Force set daemon address regardless of environment variable or system property. It falls back to the default values if the input is invalid.
      Parameters:
      addr - A notation of '127.0.0.1:2000' or 'tcp:127.0.0.1:2000 udp:127.0.0.2:2001' are both acceptable. The former one means UDP and TCP are running at the same address.
    • setTCPAddress

      public void setTCPAddress​(java.lang.String addr)
    • getTCPAddress

      public java.lang.String getTCPAddress()
    • setUDPAddress

      public void setUDPAddress​(java.lang.String addr)
    • getUDPAddress

      public java.lang.String getUDPAddress()
    • getAddressForEmitter

      public java.net.InetSocketAddress getAddressForEmitter()
    • getEndpointForTCPConnection

      public java.lang.String getEndpointForTCPConnection()