Package org.opends.server.protocols.http
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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAuthUser()
Returns the username that was used to authenticate.String
getClientAddress()
Returns the client's address.String
getClientHost()
Returns the client's host.int
getClientPort()
Returns the client's port.long
getConnectionID()
Returns the unique identifier that has been assigned to the client connection for this HTTP request.String
getMethod()
Returns the HTTP method/verb used for this request.String
getProtocol()
Returns the protocol used for this request.String
getServerAddress()
Returns the server's host.String
getServerHost()
Returns the server's host.int
getServerPort()
Returns the server's port.int
getStatusCode()
Returns the HTTP status code returned to the client.long
getTotalProcessingTime()
Returns the total processing time for this HTTP request.String
getTransactionId()
Returns the transactionId for this request.URI
getUri()
Returns the URI issued by the client.String
getUserAgent()
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.
-
-
-
Method Detail
-
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 interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- Returns:
- the statusCode
-
getServerAddress
public String getServerAddress()
Description copied from interface:HTTPRequestInfo
Returns the server's host.- Specified by:
getServerAddress
in interfaceHTTPRequestInfo
- Returns:
- the serverAddress
-
getServerHost
public String getServerHost()
Description copied from interface:HTTPRequestInfo
Returns the server's host.- Specified by:
getServerHost
in interfaceHTTPRequestInfo
- Returns:
- the serverHost
-
getServerPort
public int getServerPort()
Description copied from interface:HTTPRequestInfo
Returns the server's port.- Specified by:
getServerPort
in interfaceHTTPRequestInfo
- Returns:
- the serverPort
-
getClientAddress
public String getClientAddress()
Description copied from interface:HTTPRequestInfo
Returns the client's address.- Specified by:
getClientAddress
in interfaceHTTPRequestInfo
- Returns:
- the clientAddress
-
getClientHost
public String getClientHost()
Description copied from interface:HTTPRequestInfo
Returns the client's host.- Specified by:
getClientHost
in interfaceHTTPRequestInfo
- Returns:
- the clientHost
-
getClientPort
public int getClientPort()
Description copied from interface:HTTPRequestInfo
Returns the client's port.- Specified by:
getClientPort
in interfaceHTTPRequestInfo
- Returns:
- the clientPort
-
getProtocol
public String getProtocol()
Description copied from interface:HTTPRequestInfo
Returns the protocol used for this request.- Specified by:
getProtocol
in interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- Returns:
- the method
-
getUri
public URI getUri()
Description copied from interface:HTTPRequestInfo
Returns the URI issued by the client.- Specified by:
getUri
in interfaceHTTPRequestInfo
- Returns:
- the URI
-
getUserAgent
public String getUserAgent()
Description copied from interface:HTTPRequestInfo
Returns the user agent used by the client.- Specified by:
getUserAgent
in interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- 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 interfaceHTTPRequestInfo
- Returns:
- the transactionId
-
-