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.
-
Field Summary
Fields inherited from class org.forgerock.services.context.AbstractContext
data
-
Method Summary
Modifier and TypeMethodDescriptionReturns 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.getUri()
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.Methods inherited from class org.forgerock.services.context.AbstractContext
as, asContext, containsContext, containsContext, get, getContext, getContextName, getId, getParent, getRootId, isRootContext, toJsonValue, toString
-
Method Details
-
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
Description copied from interface:HTTPRequestInfo
Returns the username that was used to authenticate.- Specified by:
getAuthUser
in interfaceHTTPRequestInfo
- Returns:
- the authUser
-
setAuthUser
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
Description copied from interface:HTTPRequestInfo
Returns the server's host.- Specified by:
getServerAddress
in interfaceHTTPRequestInfo
- Returns:
- the serverAddress
-
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
Description copied from interface:HTTPRequestInfo
Returns the client's address.- Specified by:
getClientAddress
in interfaceHTTPRequestInfo
- Returns:
- the clientAddress
-
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
Description copied from interface:HTTPRequestInfo
Returns the protocol used for this request.- Specified by:
getProtocol
in interfaceHTTPRequestInfo
- Returns:
- the protocol
-
getMethod
Description copied from interface:HTTPRequestInfo
Returns the HTTP method/verb used for this request.- Specified by:
getMethod
in interfaceHTTPRequestInfo
- Returns:
- the method
-
getUri
Description copied from interface:HTTPRequestInfo
Returns the URI issued by the client.- Specified by:
getUri
in interfaceHTTPRequestInfo
- Returns:
- the URI
-
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
Description copied from interface:HTTPRequestInfo
Returns the transactionId for this request.- Specified by:
getTransactionId
in interfaceHTTPRequestInfo
- Returns:
- the transactionId
-