Class HttpLogContext

java.lang.Object
org.forgerock.services.context.AbstractContext
org.opends.server.protocols.http.HttpLogContext
All Implemented Interfaces:
org.forgerock.services.context.Context, HTTPRequestInfo

public final class HttpLogContext extends org.forgerock.services.context.AbstractContext implements HTTPRequestInfo
This context contains the logging informations related to the request processing.
  • Field Summary

    Fields inherited from class org.forgerock.services.context.AbstractContext

    data
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpLogContext(org.forgerock.services.context.Context parent, org.forgerock.http.protocol.Request request)
    Creates a new HTTP logging context.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the username that was used to authenticate.
    Returns the client's address.
    Returns the client's host.
    int
    Returns the client's port.
    long
    Returns the unique identifier that has been assigned to the client connection for this HTTP request.
    Returns the HTTP method/verb used for this request.
    Returns the protocol used for this request.
    Returns the server's host.
    Returns the server's host.
    int
    Returns the server's port.
    int
    Returns the HTTP status code returned to the client.
    long
    Returns the total processing time for this HTTP request.
    Returns the transactionId for this request.
    Returns the URI issued by the client.
    Returns the user agent used by the client.
    void
    log(int statusCode)
    Logs the current request info in the HTTP access log.
    void
    setAuthUser(String authUser)
    Sets the username that was used to authenticate.
    void
    setConnectionID(long connectionID)
    Sets the connection ID.

    Methods inherited from class org.forgerock.services.context.AbstractContext

    as, asContext, containsContext, containsContext, get, getContext, getContextName, getId, getParent, getRootId, isRootContext, toJsonValue, toString

    Methods inherited from class java.lang.Object

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

    • HttpLogContext

      public HttpLogContext(org.forgerock.services.context.Context parent, org.forgerock.http.protocol.Request request)
      Creates a new HTTP logging context.
      Parameters:
      parent - The parent context.
      request - The HTTP request.
  • Method Details

    • setConnectionID

      public void setConnectionID(long connectionID)
      Sets the connection ID.
      Parameters:
      connectionID - The connection ID.
    • log

      public void log(int statusCode)
      Description copied from interface: HTTPRequestInfo
      Logs the current request info in the HTTP access log.
      Specified by:
      log in interface HTTPRequestInfo
      Parameters:
      statusCode - the HTTP status code that was returned to the client.
    • getAuthUser

      public String getAuthUser()
      Description copied from interface: HTTPRequestInfo
      Returns the username that was used to authenticate.
      Specified by:
      getAuthUser in interface HTTPRequestInfo
      Returns:
      the authUser
    • setAuthUser

      public void setAuthUser(String authUser)
      Description copied from interface: HTTPRequestInfo
      Sets the username that was used to authenticate.
      Specified by:
      setAuthUser in interface HTTPRequestInfo
      Parameters:
      authUser - the authUser to set
    • getStatusCode

      public int getStatusCode()
      Description copied from interface: HTTPRequestInfo
      Returns the HTTP status code returned to the client.
      Specified by:
      getStatusCode in interface HTTPRequestInfo
      Returns:
      the statusCode
    • getServerAddress

      public String getServerAddress()
      Description copied from interface: HTTPRequestInfo
      Returns the server's host.
      Specified by:
      getServerAddress in interface HTTPRequestInfo
      Returns:
      the serverAddress
    • getServerHost

      public String getServerHost()
      Description copied from interface: HTTPRequestInfo
      Returns the server's host.
      Specified by:
      getServerHost in interface HTTPRequestInfo
      Returns:
      the serverHost
    • getServerPort

      public int getServerPort()
      Description copied from interface: HTTPRequestInfo
      Returns the server's port.
      Specified by:
      getServerPort in interface HTTPRequestInfo
      Returns:
      the serverPort
    • getClientAddress

      public String getClientAddress()
      Description copied from interface: HTTPRequestInfo
      Returns the client's address.
      Specified by:
      getClientAddress in interface HTTPRequestInfo
      Returns:
      the clientAddress
    • getClientHost

      public String getClientHost()
      Description copied from interface: HTTPRequestInfo
      Returns the client's host.
      Specified by:
      getClientHost in interface HTTPRequestInfo
      Returns:
      the clientHost
    • getClientPort

      public int getClientPort()
      Description copied from interface: HTTPRequestInfo
      Returns the client's port.
      Specified by:
      getClientPort in interface HTTPRequestInfo
      Returns:
      the clientPort
    • getProtocol

      public String getProtocol()
      Description copied from interface: HTTPRequestInfo
      Returns the protocol used for this request.
      Specified by:
      getProtocol in interface HTTPRequestInfo
      Returns:
      the protocol
    • getMethod

      public String getMethod()
      Description copied from interface: HTTPRequestInfo
      Returns the HTTP method/verb used for this request.
      Specified by:
      getMethod in interface HTTPRequestInfo
      Returns:
      the method
    • getUri

      public URI getUri()
      Description copied from interface: HTTPRequestInfo
      Returns the URI issued by the client.
      Specified by:
      getUri in interface HTTPRequestInfo
      Returns:
      the URI
    • getUserAgent

      public String getUserAgent()
      Description copied from interface: HTTPRequestInfo
      Returns the user agent used by the client.
      Specified by:
      getUserAgent in interface HTTPRequestInfo
      Returns:
      the userAgent
    • getConnectionID

      public long getConnectionID()
      Description copied from interface: HTTPRequestInfo
      Returns the unique identifier that has been assigned to the client connection for this HTTP request.
      Specified by:
      getConnectionID in interface HTTPRequestInfo
      Returns:
      the unique identifier that has been assigned to the client connection for this HTTP request
    • getTotalProcessingTime

      public long getTotalProcessingTime()
      Description copied from interface: HTTPRequestInfo
      Returns the total processing time for this HTTP request.
      Specified by:
      getTotalProcessingTime in interface HTTPRequestInfo
      Returns:
      the total processing time for this HTTP request
    • getTransactionId

      public String getTransactionId()
      Description copied from interface: HTTPRequestInfo
      Returns the transactionId for this request.
      Specified by:
      getTransactionId in interface HTTPRequestInfo
      Returns:
      the transactionId