public class RequestDJContext extends AbstractDJContext
Modifier and Type | Class and Description |
---|---|
static class |
RequestDJContext.RequestFlag
Distinguishes operations from server components, not directly from LDAP clients.
|
Modifier and Type | Field and Description |
---|---|
static org.forgerock.util.time.TimeService |
NANO_TIME
A time service with nanosecond precision.
|
static String |
REQUEST_CONTEXT_NAME
The name of this context.
|
Constructor and Description |
---|
RequestDJContext(int messageId,
long operationId,
org.forgerock.services.context.Context parent)
Creates a new request context.
|
RequestDJContext(int messageId,
long operationId,
org.forgerock.services.context.Context parent,
Set<RequestDJContext.RequestFlag> requestFlags)
Creates a new request context, by also specifying additional request settings.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalItem(AdditionalLogItem item)
Adds a
AdditionalLogItem to the list for logging. |
RequestDJContext |
etimeStarted(org.forgerock.util.time.TimeService timeService)
Sets the time at which processing started for this request.
|
RequestDJContext |
etimeStopped()
Sets the time at which the processing stopped for this request.
|
List<AdditionalLogItem> |
getAdditionalLogItems()
Returns additional information to be logged, as a potentially empty
List of AdditionalLogItem . |
LocalizableMessage |
getAuthFailureReason()
Returns a human-readable message providing the reason why the authentication failed, if available.
|
String |
getBackendId()
Returns the id of the backend to use to process the request.
|
ConnectionContext |
getConnectionContext()
Returns the client context in the context chain for logging the request.
|
String |
getContextName() |
LocalizableMessageBuilder |
getMaskedErrorMessage()
Retrieves the real, masked error message for this operation.
|
org.forgerock.opendj.ldap.ResultCode |
getMaskedResultCode()
Retrieves the real, masked result code for this operation.
|
int |
getMessageId()
Returns the message id associated to the request.
|
long |
getOperationId()
Returns the operation id associated to the request.
|
long |
getProcessingTime()
Returns the processing time for the request.
|
org.forgerock.opendj.ldap.Dn |
getProxiedAuthorizationDn()
Returns the proxied authorization DN if proxy authorization has been requested.
|
int |
getSearchNumberOfEntriesReturned()
Returns the number of entries sent by the search request associated to this context.
|
boolean |
hasFlag(RequestDJContext.RequestFlag requestFlag)
Returns whether this request has the provided flag.
|
boolean |
hasPrivilege(Privilege privilege)
Returns
true if the authorized user has the specified privilege. |
void |
setAdditionalItems(List<AdditionalLogItem> items)
Sets the
AdditionalLogItem s. |
void |
setAuthFailureReason(LocalizableMessage reason)
Specifies the reason why authentication failed.
|
void |
setBackendId(String backendId)
Sets the backend id to use.
|
RequestDJContext |
setMaskedErrorMessage(LocalizableMessageBuilder maskedErrorMessage)
Specifies the real, masked error message for this operation.
|
RequestDJContext |
setMaskedResultCode(org.forgerock.opendj.ldap.ResultCode maskedResultCode)
Specifies the real, masked result code for this operation.
|
RequestDJContext |
setProxiedAuthorizationDn(org.forgerock.opendj.ldap.Dn proxiedAuthorizationDn)
Set the proxied authorization DN for this operation if any.
|
void |
setSearchNumberOfEntriesReturned(int searchNumberOfEntriesReturned)
Sets the number of entries returned by the search request associated to this context.
|
boolean |
useNanoTime()
Returns
true if processing time unit is nanoseconds. |
asContext, containsContext, containsContext, getContext, getId, getParent, isRootContext, toJsonValue, toString
public static final org.forgerock.util.time.TimeService NANO_TIME
public static final String REQUEST_CONTEXT_NAME
public RequestDJContext(int messageId, long operationId, org.forgerock.services.context.Context parent)
messageId
- The message id associated to this request.operationId
- The operation id associated to this request.parent
- The parent context.public RequestDJContext(int messageId, long operationId, org.forgerock.services.context.Context parent, Set<RequestDJContext.RequestFlag> requestFlags)
messageId
- The message id associated to this request.operationId
- The operation id associated to this request.parent
- The parent context.requestFlags
- The set of additional flags for this requestpublic String getContextName()
public boolean hasFlag(RequestDJContext.RequestFlag requestFlag)
requestFlag
- the request flag to test fortrue
if this request has the provided flagpublic String getBackendId()
public int getMessageId()
public long getOperationId()
public boolean hasPrivilege(Privilege privilege)
true
if the authorized user has the specified privilege.privilege
- The required privilege.true
if the authorized user has the specified privilege.public void setBackendId(String backendId)
backendId
- the backendId to usepublic ConnectionContext getConnectionContext()
public RequestDJContext etimeStarted(org.forgerock.util.time.TimeService timeService)
timeService
- the TimeService
for computing processing time for the requestpublic RequestDJContext etimeStopped()
public long getProcessingTime()
public org.forgerock.opendj.ldap.ResultCode getMaskedResultCode()
null
if there is no need for onepublic RequestDJContext setMaskedResultCode(org.forgerock.opendj.ldap.ResultCode maskedResultCode)
null
value will reset to not having a masked error code to log.maskedResultCode
- The real, masked result code for this operation
If null
, the masked error message will be removed.public LocalizableMessageBuilder getMaskedErrorMessage()
null
if
none has been setpublic RequestDJContext setMaskedErrorMessage(LocalizableMessageBuilder maskedErrorMessage)
maskedErrorMessage
- The real, masked error message for this operation.
If null
, the masked error code will be removed.public LocalizableMessage getAuthFailureReason()
null
if none is available.public void setAuthFailureReason(LocalizableMessage reason)
reason
- the message describing why authentication failedpublic org.forgerock.opendj.ldap.Dn getProxiedAuthorizationDn()
null
is proxy authorization has not been requestedpublic RequestDJContext setProxiedAuthorizationDn(org.forgerock.opendj.ldap.Dn proxiedAuthorizationDn)
proxiedAuthorizationDn
- The proxied authorization DN.
if null
this operation will have no proxy authorization.public int getSearchNumberOfEntriesReturned()
public void setSearchNumberOfEntriesReturned(int searchNumberOfEntriesReturned)
searchNumberOfEntriesReturned
- the number of entries sentpublic List<AdditionalLogItem> getAdditionalLogItems()
List
of AdditionalLogItem
.List
of AdditionalLogItem
public void addAdditionalItem(AdditionalLogItem item)
AdditionalLogItem
to the list for logging.
null
items will be ignored.item
- the additional log item to addpublic void setAdditionalItems(List<AdditionalLogItem> items)
AdditionalLogItem
s.
All existing elements will be deleted.items
- the new log itemspublic boolean useNanoTime()
true
if processing time unit is nanoseconds.true
if processing time unit is nanosecondsCopyright © 2010-2017 ForgeRock AS. All Rights Reserved.