Class Converters
- java.lang.Object
-
- org.forgerock.opendj.adapter.server3x.Converters
-
public final class Converters extends Object
Common utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Attribute>from(Iterable<Attribute> listOfAttributes)static List<Control>from(List<Control> listOfControl)static SearchScopefrom(VirtualAttributeCfgDefn.Scope srvScope)Converts from OpenDJ serverVirtualAttributeCfgDefn.Scopeto OpenDJ LDAP SDKSearchScope.static Controlfrom(LDAPControl ldapControl)Converts from OpenDJ serverLDAPControlto OpenDJ LDAP SDKControl.static Attributefrom(Attribute attribute)static Controlfrom(Control control)static Entryfrom(Entry srvResultEntry)static SearchResultEntryfrom(SearchResultEntry srvResultEntry)Converts from OpenDJ serverSearchResultEntryto OpenDJ LDAP SDKSearchResultEntry.static SearchResultReferencefrom(SearchResultReference srvResultReference)Converts from OpenDJ serverSearchResultReferenceto OpenDJ LDAP SDKSearchResultReference.static ByteStringgetCredentials(byte[] authenticationValue)Converts frombyte[]to OpenDJ serverByteString.static ResultgetResponseResult(Operation operation)static <T extends Result>
TgetResponseResult(Operation operation, T result)Populates the result object with the operation details and return the result object if it was successful.static AttributepartiallyWrap(Attribute attribute)static SearchResultEntrypartiallyWrap(SearchResultEntry srvResultEntry, int ldapVersion)Converts from OpenDJ serverSearchResultEntryto OpenDJ LDAP SDKSearchResultEntry.static List<RawAttribute>to(Iterable<Attribute> listOfAttributes)static List<Control>to(List<Control> listOfControl)static RawAttributeto(Attribute attribute)Converts from OpenDJ LDAP SDKAttributeto OpenDJ serverRawAttribute.static LDAPControlto(Control control)Converts from OpenDJ LDAP SDKControlto OpenDJ serverLDAPControl.static Entryto(Entry sdkEntry)static RawFilterto(Filter filter)static RawModificationto(Modification modification)Converts from OpenDJ LDAP SDKModificationto OpenDJ serverRawModification.static SearchResultEntryto(SearchResultEntry value)Converts from OpenDJ LDAP SDKSearchResultEntryto OpenDJ serverSearchResultEntry.static SearchResultReferenceto(SearchResultReference searchResultReference)Converts from OpenDJ LDAP SDKSearchResultReferenceto OpenDJ serverSearchResultReference.static AttributetoAttribute(Attribute attribute)static List<Attribute>toAttributes(Iterable<Attribute> listOfAttributes)static ModificationtoModification(Modification modification)Converts from OpenDJ LDAP SDKModificationto OpenDJ serverModification.static List<Modification>toModifications(List<Modification> listOfModifications)static List<RawModification>toRawModifications(List<Modification> listOfModifications)static SearchFiltertoSearchFilter(Filter filter)
-
-
-
Method Detail
-
to
public static Entry to(Entry sdkEntry)
- Parameters:
sdkEntry- SDK entry to convert- Returns:
- the converted entry
-
to
public static SearchResultEntry to(SearchResultEntry value)
Converts from OpenDJ LDAP SDKSearchResultEntryto OpenDJ serverSearchResultEntry.- Parameters:
value- value to convert- Returns:
- the converted value
-
to
public static RawFilter to(Filter filter)
- Parameters:
filter- value to convert- Returns:
- the converted value
-
toSearchFilter
public static SearchFilter toSearchFilter(Filter filter)
- Parameters:
filter- value to convert- Returns:
- the converted value
-
to
public static SearchResultReference to(SearchResultReference searchResultReference)
Converts from OpenDJ LDAP SDKSearchResultReferenceto OpenDJ serverSearchResultReference.- Parameters:
searchResultReference- value to convert- Returns:
- the converted value
-
to
public static LDAPControl to(Control control)
Converts from OpenDJ LDAP SDKControlto OpenDJ serverLDAPControl.- Parameters:
control- value to convert- Returns:
- the converted value
-
to
public static List<Control> to(List<Control> listOfControl)
- Parameters:
listOfControl- value to convert- Returns:
- the converted value
-
to
public static RawAttribute to(Attribute attribute)
Converts from OpenDJ LDAP SDKAttributeto OpenDJ serverRawAttribute.- Parameters:
attribute- value to convert- Returns:
- the converted value
-
to
public static List<RawAttribute> to(Iterable<Attribute> listOfAttributes)
- Parameters:
listOfAttributes- value to convert- Returns:
- the converted value
-
to
public static RawModification to(Modification modification)
Converts from OpenDJ LDAP SDKModificationto OpenDJ serverRawModification.- Parameters:
modification- value to convert- Returns:
- the converted value
-
toRawModifications
public static List<RawModification> toRawModifications(List<Modification> listOfModifications)
- Parameters:
listOfModifications- value to convert- Returns:
- the converted value
-
toAttribute
public static Attribute toAttribute(Attribute attribute)
- Parameters:
attribute- value to convert- Returns:
- the converted value
-
toAttributes
public static List<Attribute> toAttributes(Iterable<Attribute> listOfAttributes)
- Parameters:
listOfAttributes- value to convert- Returns:
- the converted value
-
toModification
public static Modification toModification(Modification modification)
Converts from OpenDJ LDAP SDKModificationto OpenDJ serverModification.- Parameters:
modification- value to convert- Returns:
- the converted value
-
toModifications
public static List<Modification> toModifications(List<Modification> listOfModifications)
- Parameters:
listOfModifications- value to convert- Returns:
- the converted value
-
from
public static Control from(LDAPControl ldapControl)
Converts from OpenDJ serverLDAPControlto OpenDJ LDAP SDKControl.- Parameters:
ldapControl- value to convert- Returns:
- the converted value
-
from
public static Control from(Control control)
- Parameters:
control- value to convert- Returns:
- the converted value
-
from
public static List<Control> from(List<Control> listOfControl)
- Parameters:
listOfControl- value to convert- Returns:
- the converted value
-
from
public static SearchResultReference from(SearchResultReference srvResultReference)
Converts from OpenDJ serverSearchResultReferenceto OpenDJ LDAP SDKSearchResultReference.- Parameters:
srvResultReference- value to convert- Returns:
- the converted value
-
from
public static Attribute from(Attribute attribute)
- Parameters:
attribute- value to convert- Returns:
- the converted value
-
partiallyWrap
public static Attribute partiallyWrap(Attribute attribute)
Converts from OpenDJ serverAttributeto OpenDJ LDAP SDKAttribute. This method is an optimization of the equivalent from() method. It's only used in encoding/decoding and as such only wrap the required methods: the returned object partially wrap the incoming one.- Parameters:
attribute- value to convert- Returns:
- the converted value
-
from
public static List<Attribute> from(Iterable<Attribute> listOfAttributes)
- Parameters:
listOfAttributes- value to convert- Returns:
- the converted value
-
from
public static SearchResultEntry from(SearchResultEntry srvResultEntry)
Converts from OpenDJ serverSearchResultEntryto OpenDJ LDAP SDKSearchResultEntry.- Parameters:
srvResultEntry- value to convert- Returns:
- the converted value
-
partiallyWrap
public static SearchResultEntry partiallyWrap(SearchResultEntry srvResultEntry, int ldapVersion)
Converts from OpenDJ serverSearchResultEntryto OpenDJ LDAP SDKSearchResultEntry. This method is an optimization of the equivalent from() method. It's only used in encoding/decoding and as such only wrap the required methods: the returned object partially wrap the incoming one.- Parameters:
srvResultEntry- value to convertldapVersion- Version of the ldap protocol- Returns:
- the converted value
-
from
public static Entry from(Entry srvResultEntry)
- Parameters:
srvResultEntry- value to convert- Returns:
- the converted value
-
from
public static SearchScope from(VirtualAttributeCfgDefn.Scope srvScope)
Converts from OpenDJ serverVirtualAttributeCfgDefn.Scopeto OpenDJ LDAP SDKSearchScope.- Parameters:
srvScope- The server scope value.- Returns:
- The SDK scope value.
-
getResponseResult
public static <T extends Result> T getResponseResult(Operation operation, T result) throws LdapException
Populates the result object with the operation details and return the result object if it was successful. Otherwise, it throws anLdapException.- Type Parameters:
T- the type of the result object- Parameters:
operation- used to populate the resultresult- the result object to populate from the Operation- Returns:
- the result if successful, an
LdapExceptionis thrown otherwise - Throws:
LdapException- when an error occurs
-
getResponseResult
public static Result getResponseResult(Operation operation) throws LdapException
- Parameters:
operation- value to convert- Returns:
- the converted value
- Throws:
LdapException- when an error occurs
-
getCredentials
public static ByteString getCredentials(byte[] authenticationValue)
Converts frombyte[]to OpenDJ serverByteString.- Parameters:
authenticationValue- value to convert- Returns:
- the converted value
-
-