public final class ReactiveHandlersUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
LDAP_PROTOCOL_VERSION_3
Version 3 of the LDAP protocol.
|
static String |
NO_BACKEND
Backend id value to use for an operation when there is no backend selected.
|
static String |
REACTIVE_OUT
Label for reactive out operation attachment.
|
static String |
REQUEST
Label for the request operation attachment.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAttachmentsToOperation(Operation op,
Request request,
FlowableEmitter<Response> out)
Add to operation the attachments needed for correct behavior of the reactive handlers.
|
static void |
emitResult(Result result,
FlowableEmitter<Response> out)
Emits a result to the provided reactive emitter, to signal completion of a request.
|
static FlowableEmitter<Response> |
getFlowableEmitter(Operation operation)
Returns the reactive emitter attached to the provided operation.
|
static InternalModificationsRequestControl |
getInternalModificationControl(Request request)
Returns the internal modification control from the provided request.
|
static ReplicatedRequestControl |
getReplicatedRequestControl(Request request)
Returns the replicated request control from the provided request.
|
static Result |
operationToResult(Operation operation,
int ldapVersion,
long connectionId,
SslOptions sslOptions)
Generates a result from the provided operation.
|
static Operation |
requestToOperation(org.forgerock.services.context.Context context,
Request request)
Returns an operation from the provided request.
|
static void |
setResultDetails(Result result,
Operation operation,
LdapException e,
int ldapVersion)
Set details on the provided result with data from an operation.
|
static byte |
toLdapResponseType(Request request,
Response response)
Returns the LDAP response type to use for the provided request and response.
|
public static final String REACTIVE_OUT
public static final String REQUEST
public static final String NO_BACKEND
public static final int LDAP_PROTOCOL_VERSION_3
public static FlowableEmitter<Response> getFlowableEmitter(Operation operation)
operation
- The operation.public static Result operationToResult(Operation operation, int ldapVersion, long connectionId, SslOptions sslOptions)
operation
- The operation to use to generate the response.ldapVersion
- The LDAP protocol version.connectionId
- The connection id to be used for loggingsslOptions
- Contains options to apply when a Start-TLS operation succeed.null
if LDAP v2 is used or if the operation has no response.public static Operation requestToOperation(org.forgerock.services.context.Context context, Request request)
request
- The request.context
- The request context to use.public static void setResultDetails(Result result, Operation operation, LdapException e, int ldapVersion)
result
- The result to update.operation
- The source operation.e
- The ldap exception that was thrown.ldapVersion
- The version of LDAP protocol.public static byte toLdapResponseType(Request request, Response response)
request
- The requestresponse
- The response received for the request.public static void addAttachmentsToOperation(Operation op, Request request, FlowableEmitter<Response> out)
op
- The operation to execute.request
- The request to perform.out
- The flowable emitter to use when response(s) are available.public static ReplicatedRequestControl getReplicatedRequestControl(Request request)
request
- The requestnull
if there is nonepublic static InternalModificationsRequestControl getInternalModificationControl(Request request)
request
- The requestnull
if there is nonepublic static void emitResult(Result result, FlowableEmitter<Response> out)
result
- The result to emit, which may be null
.out
- The reactive emitter.Copyright 2010-2022 ForgeRock AS.