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.intReturns the client's port.longReturns 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.intReturns the server's port.intReturns the HTTP status code returned to the client.longReturns 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.voidlog(int statusCode) Logs the current request info in the HTTP access log.voidsetAuthUser(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:HTTPRequestInfoLogs the current request info in the HTTP access log.- Specified by:
login interfaceHTTPRequestInfo- Parameters:
statusCode- the HTTP status code that was returned to the client.
-
getAuthUser
Description copied from interface:HTTPRequestInfoReturns the username that was used to authenticate.- Specified by:
getAuthUserin interfaceHTTPRequestInfo- Returns:
- the authUser
-
setAuthUser
Description copied from interface:HTTPRequestInfoSets the username that was used to authenticate.- Specified by:
setAuthUserin interfaceHTTPRequestInfo- Parameters:
authUser- the authUser to set
-
getStatusCode
public int getStatusCode()Description copied from interface:HTTPRequestInfoReturns the HTTP status code returned to the client.- Specified by:
getStatusCodein interfaceHTTPRequestInfo- Returns:
- the statusCode
-
getServerAddress
Description copied from interface:HTTPRequestInfoReturns the server's host.- Specified by:
getServerAddressin interfaceHTTPRequestInfo- Returns:
- the serverAddress
-
getServerHost
Description copied from interface:HTTPRequestInfoReturns the server's host.- Specified by:
getServerHostin interfaceHTTPRequestInfo- Returns:
- the serverHost
-
getServerPort
public int getServerPort()Description copied from interface:HTTPRequestInfoReturns the server's port.- Specified by:
getServerPortin interfaceHTTPRequestInfo- Returns:
- the serverPort
-
getClientAddress
Description copied from interface:HTTPRequestInfoReturns the client's address.- Specified by:
getClientAddressin interfaceHTTPRequestInfo- Returns:
- the clientAddress
-
getClientHost
Description copied from interface:HTTPRequestInfoReturns the client's host.- Specified by:
getClientHostin interfaceHTTPRequestInfo- Returns:
- the clientHost
-
getClientPort
public int getClientPort()Description copied from interface:HTTPRequestInfoReturns the client's port.- Specified by:
getClientPortin interfaceHTTPRequestInfo- Returns:
- the clientPort
-
getProtocol
Description copied from interface:HTTPRequestInfoReturns the protocol used for this request.- Specified by:
getProtocolin interfaceHTTPRequestInfo- Returns:
- the protocol
-
getMethod
Description copied from interface:HTTPRequestInfoReturns the HTTP method/verb used for this request.- Specified by:
getMethodin interfaceHTTPRequestInfo- Returns:
- the method
-
getUri
Description copied from interface:HTTPRequestInfoReturns the URI issued by the client.- Specified by:
getUriin interfaceHTTPRequestInfo- Returns:
- the URI
-
getUserAgent
Description copied from interface:HTTPRequestInfoReturns the user agent used by the client.- Specified by:
getUserAgentin interfaceHTTPRequestInfo- Returns:
- the userAgent
-
getConnectionID
public long getConnectionID()Description copied from interface:HTTPRequestInfoReturns the unique identifier that has been assigned to the client connection for this HTTP request.- Specified by:
getConnectionIDin 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:HTTPRequestInfoReturns the total processing time for this HTTP request.- Specified by:
getTotalProcessingTimein interfaceHTTPRequestInfo- Returns:
- the total processing time for this HTTP request
-
getTransactionId
Description copied from interface:HTTPRequestInfoReturns the transactionId for this request.- Specified by:
getTransactionIdin interfaceHTTPRequestInfo- Returns:
- the transactionId
-