Class ThreadContextProperties

java.lang.Object
org.codice.ddf.security.util.ThreadContextProperties

public final class ThreadContextProperties extends Object
  • Field Details

  • Method Details

    • addTraceId

      public static String addTraceId()
      Adds the trace context and unique trace id to the ThreadContext.
      Returns:
      traceId in ThreadContext
    • getTraceId

      public static String getTraceId()
      Returns:
      trace-id from ThreadContext if it exists otherwise returns null
    • removeTraceId

      public static void removeTraceId()
      removes the trace context map from the ThreadContext
    • addClientInfo

      public static void addClientInfo(javax.servlet.ServletRequest request)
      Adds the client info map to ThreadContext. The Client Info can include the client's IP address, client host, client port, and the request context path.
      Parameters:
      request - the servlet request containing the client address info
    • addClientInfo

      public static void addClientInfo(String clientIP, @Nullable String clientHost, @Nullable String clientPort, @Nullable URI requestUri)
      Parameters:
      clientIP -
      clientHost -
      clientPort -
      requestUri -
    • getRemoteAddress

      public static String getRemoteAddress()
      Returns:
      the client IP address or null if not present
    • getRemotePort

      public static String getRemotePort()
      Returns:
      the client Port address or null if not present
    • getRemoteHost

      public static String getRemoteHost()
      Returns:
      the client host name or null if it not present
    • getContextPath

      public static String getContextPath()
      Returns:
      the context path of the request if available or null if not present
    • getScheme

      public static String getScheme()
      Returns:
      the scheme of the request if available or null if not present
    • removeClientInfo

      public static void removeClientInfo()
      removes the client info map from the Thread Context