Class Controls
java.lang.Object
org.forgerock.opendj.ldap.controls.Controls
Utility class to resolve controls OID from aliases.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the control friendly name alias associated with the provided control OID or OID if no alias has been found.static String
Returns the control OID associated with the provided control "friendly name" alias ornull
if no OID has been found.static <C extends Control>
ControlDecoder<C>newRequestControlDecoderWithoutValue
(Class<C> controlClass, String oid, String alias, Function<Control, C> decoder) Creates a new control decoder for request controls which does not expect to find a value for the decoded control.static <C extends Control>
ControlDecoder<C>newRequestControlDecoderWithValue
(Class<C> controlClass, String oid, String alias, BiFunction<Control, DecodeOptions, C, IOException> decoder) Creates a new control decoder for request controls which expects to find a value for the decoded control.static <C extends Control>
ControlDecoder<C>newResponseControlDecoderWithValue
(Class<C> controlClass, String oid, String alias, BiFunction<Control, DecodeOptions, C, IOException> decoder) Creates a new control decoder for response controls which expects to find a value for the decoded control.
-
Method Details
-
getRequestControlOidForAliasOrNull
Returns the control OID associated with the provided control "friendly name" alias ornull
if no OID has been found.- Parameters:
alias
- Friendly name alias to resolve- Returns:
- The control OID associated with the provided control "friendly name" alias or
null
if no OID has been found.
-
getRequestControlAliasForOid
Returns the control friendly name alias associated with the provided control OID or OID if no alias has been found.- Parameters:
oid
- The control OID to resolve- Returns:
- The control friendly name alias associated with the provided control OID or OID if no alias has been found.
-
newRequestControlDecoderWithoutValue
public static <C extends Control> ControlDecoder<C> newRequestControlDecoderWithoutValue(Class<C> controlClass, String oid, String alias, Function<Control, C> decoder) Creates a new control decoder for request controls which does not expect to find a value for the decoded control.- Type Parameters:
C
- the type of the decoded control- Parameters:
controlClass
- the returned control classoid
- the decoded control OIDalias
- the decoded control aliasdecoder
- a function that can decode the control into the appropriate type- Returns:
- the decoded control having the specified type
-
newRequestControlDecoderWithValue
public static <C extends Control> ControlDecoder<C> newRequestControlDecoderWithValue(Class<C> controlClass, String oid, String alias, BiFunction<Control, DecodeOptions, C, IOException> decoder) Creates a new control decoder for request controls which expects to find a value for the decoded control.- Type Parameters:
C
- the type of the decoded control- Parameters:
controlClass
- the returned control classoid
- the decoded control OIDalias
- the decoded control aliasdecoder
- a function that can decode the control into the appropriate type- Returns:
- the decoded control having the specified type
-
newResponseControlDecoderWithValue
public static <C extends Control> ControlDecoder<C> newResponseControlDecoderWithValue(Class<C> controlClass, String oid, String alias, BiFunction<Control, DecodeOptions, C, IOException> decoder) Creates a new control decoder for response controls which expects to find a value for the decoded control.- Type Parameters:
C
- the type of the decoded control- Parameters:
controlClass
- the returned control classoid
- the decoded control OIDalias
- the decoded control aliasdecoder
- a function that can decode the control into the appropriate type- Returns:
- the decoded control having the specified type
-