Class JNDIConverter
- java.lang.Object
-
- com.unboundid.ldap.sdk.migrate.jndi.JNDIConverter
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JNDIConverter extends java.lang.Object implements java.io.Serializable
This utility class provides a set of methods that may be used to convert between data structures in the Java Naming and Directory Interface (JNDI) and the corresponding data structures in the UnboundID LDAP SDK for Java.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.naming.directory.AttributeconvertAttribute(Attribute a)Converts the provided LDAP SDK attribute to a JNDI attribute.static AttributeconvertAttribute(javax.naming.directory.Attribute a)Converts the provided JNDI attribute to an LDAP SDK attribute.static javax.naming.directory.AttributesconvertAttributes(Attribute... a)Converts the provided array of LDAP SDK attributes to a set of JNDI attributes.static javax.naming.directory.AttributesconvertAttributes(java.util.Collection<Attribute> a)Converts the provided collection of LDAP SDK attributes to a set of JNDI attributes.static Attribute[]convertAttributes(javax.naming.directory.Attributes a)Converts the provided JNDI attributes to an array of LDAP SDK attributes.static javax.naming.ldap.ControlconvertControl(Control c)Converts the provided LDAP SDK control to a JNDI control.static ControlconvertControl(javax.naming.ldap.Control c)Converts the provided JNDI control to an LDAP SDK control.static javax.naming.ldap.Control[]convertControls(Control... c)Converts the provided array of LDAP SDK controls to an array of JNDI controls.static Control[]convertControls(javax.naming.ldap.Control... c)Converts the provided array of JNDI controls to an array of LDAP SDK controls.static javax.naming.ldap.ExtendedRequestconvertExtendedRequest(ExtendedRequest r)Converts the provided LDAP SDK extended request to a JNDI extended request.static ExtendedRequestconvertExtendedRequest(javax.naming.ldap.ExtendedRequest r)Converts the provided JNDI extended request to an LDAP SDK extended request.static ExtendedResultconvertExtendedResponse(javax.naming.ldap.ExtendedResponse r)Converts the provided JNDI extended response to an LDAP SDK extended result.static javax.naming.ldap.ExtendedResponseconvertExtendedResult(ExtendedResult r)Converts the provided LDAP SDK extended result to a JNDI extended response.static javax.naming.directory.ModificationItemconvertModification(Modification m)Converts the provided LDAP SDK modification to a JNDI modification item.static ModificationconvertModification(javax.naming.directory.ModificationItem m)Converts the provided JNDI modification item to an LDAP SDK modification.static javax.naming.directory.ModificationItem[]convertModifications(Modification... m)Converts the provided array of LDAP SDK modifications to an array of JNDI modification items.static Modification[]convertModifications(javax.naming.directory.ModificationItem... m)Converts the provided array of JNDI modification items to an array of LDAP SDK modifications.static javax.naming.directory.SearchResultconvertSearchEntry(Entry e)Converts the provided LDAP SDK entry to a JNDI search result.static javax.naming.directory.SearchResultconvertSearchEntry(Entry e, java.lang.String contextBaseDN)Converts the provided LDAP SDK entry to a JNDI search result.static EntryconvertSearchEntry(javax.naming.directory.SearchResult r)Converts the provided JNDI search result object to an LDAP SDK entry.static EntryconvertSearchEntry(javax.naming.directory.SearchResult r, java.lang.String contextBaseDN)Converts the provided JNDI search result object to an LDAP SDK entry.
-
-
-
Method Detail
-
convertAttribute
@Nullable public static Attribute convertAttribute(@Nullable javax.naming.directory.Attribute a) throws javax.naming.NamingException
Converts the provided JNDI attribute to an LDAP SDK attribute.- Parameters:
a- The attribute to be converted.- Returns:
- The LDAP SDK attribute that corresponds to the provided JNDI attribute.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertAttribute
@Nullable public static javax.naming.directory.Attribute convertAttribute(@Nullable Attribute a)
Converts the provided LDAP SDK attribute to a JNDI attribute.- Parameters:
a- The attribute to be converted.- Returns:
- The JNDI attribute that corresponds to the provided LDAP SDK attribute.
-
convertAttributes
@NotNull public static Attribute[] convertAttributes(@Nullable javax.naming.directory.Attributes a) throws javax.naming.NamingException
Converts the provided JNDI attributes to an array of LDAP SDK attributes.- Parameters:
a- The attributes to be converted.- Returns:
- The array of LDAP SDK attributes that corresponds to the provided JNDI attributes.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertAttributes
@NotNull public static javax.naming.directory.Attributes convertAttributes(@Nullable Attribute... a)
Converts the provided array of LDAP SDK attributes to a set of JNDI attributes.- Parameters:
a- The array of attributes to be converted.- Returns:
- The JNDI attributes that corresponds to the provided LDAP SDK attributes.
-
convertAttributes
@NotNull public static javax.naming.directory.Attributes convertAttributes(@Nullable java.util.Collection<Attribute> a)
Converts the provided collection of LDAP SDK attributes to a set of JNDI attributes.- Parameters:
a- The collection of attributes to be converted.- Returns:
- The JNDI attributes that corresponds to the provided LDAP SDK attributes.
-
convertControl
@Nullable public static Control convertControl(@Nullable javax.naming.ldap.Control c) throws javax.naming.NamingException
Converts the provided JNDI control to an LDAP SDK control.- Parameters:
c- The control to be converted.- Returns:
- The LDAP SDK control that corresponds to the provided JNDI control.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertControl
@Nullable public static javax.naming.ldap.Control convertControl(@Nullable Control c)
Converts the provided LDAP SDK control to a JNDI control.- Parameters:
c- The control to be converted.- Returns:
- The JNDI control that corresponds to the provided LDAP SDK control.
-
convertControls
@NotNull public static Control[] convertControls(@Nullable javax.naming.ldap.Control... c) throws javax.naming.NamingException
Converts the provided array of JNDI controls to an array of LDAP SDK controls.- Parameters:
c- The array of JNDI controls to be converted.- Returns:
- The array of LDAP SDK controls that corresponds to the provided array of JNDI controls.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertControls
@NotNull public static javax.naming.ldap.Control[] convertControls(@Nullable Control... c)
Converts the provided array of LDAP SDK controls to an array of JNDI controls.- Parameters:
c- The array of LDAP SDK controls to be converted.- Returns:
- The array of JNDI controls that corresponds to the provided array of LDAP SDK controls.
-
convertExtendedRequest
@Nullable public static ExtendedRequest convertExtendedRequest(@Nullable javax.naming.ldap.ExtendedRequest r) throws javax.naming.NamingException
Converts the provided JNDI extended request to an LDAP SDK extended request.- Parameters:
r- The request to be converted.- Returns:
- The LDAP SDK extended request that corresponds to the provided JNDI extended request.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertExtendedRequest
@Nullable public static javax.naming.ldap.ExtendedRequest convertExtendedRequest(@Nullable ExtendedRequest r)
Converts the provided LDAP SDK extended request to a JNDI extended request.- Parameters:
r- The request to be converted.- Returns:
- The JNDI extended request that corresponds to the provided LDAP SDK extended request.
-
convertExtendedResponse
@Nullable public static ExtendedResult convertExtendedResponse(@Nullable javax.naming.ldap.ExtendedResponse r) throws javax.naming.NamingException
Converts the provided JNDI extended response to an LDAP SDK extended result.- Parameters:
r- The response to be converted.- Returns:
- The LDAP SDK extended result that corresponds to the provided JNDI extended response.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertExtendedResult
@Nullable public static javax.naming.ldap.ExtendedResponse convertExtendedResult(@Nullable ExtendedResult r)
Converts the provided LDAP SDK extended result to a JNDI extended response.- Parameters:
r- The result to be converted.- Returns:
- The JNDI extended response that corresponds to the provided LDAP SDK extended result.
-
convertModification
@Nullable public static Modification convertModification(@Nullable javax.naming.directory.ModificationItem m) throws javax.naming.NamingException
Converts the provided JNDI modification item to an LDAP SDK modification.- Parameters:
m- The JNDI modification item to be converted.- Returns:
- The LDAP SDK modification that corresponds to the provided JNDI modification item.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertModification
@Nullable public static javax.naming.directory.ModificationItem convertModification(@Nullable Modification m) throws javax.naming.NamingException
Converts the provided LDAP SDK modification to a JNDI modification item.- Parameters:
m- The LDAP SDK modification to be converted.- Returns:
- The JNDI modification item that corresponds to the provided LDAP SDK modification.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertModifications
@NotNull public static Modification[] convertModifications(@Nullable javax.naming.directory.ModificationItem... m) throws javax.naming.NamingException
Converts the provided array of JNDI modification items to an array of LDAP SDK modifications.- Parameters:
m- The array of JNDI modification items to be converted.- Returns:
- The array of LDAP SDK modifications that corresponds to the provided array of JNDI modification items.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertModifications
@NotNull public static javax.naming.directory.ModificationItem[] convertModifications(@Nullable Modification... m) throws javax.naming.NamingException
Converts the provided array of LDAP SDK modifications to an array of JNDI modification items.- Parameters:
m- The array of LDAP SDK modifications to be converted.- Returns:
- The array of JNDI modification items that corresponds to the provided array of LDAP SDK modifications.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertSearchEntry
@Nullable public static Entry convertSearchEntry(@Nullable javax.naming.directory.SearchResult r) throws javax.naming.NamingException
Converts the provided JNDI search result object to an LDAP SDK entry.- Parameters:
r- The JNDI search result object to be converted.- Returns:
- The LDAP SDK entry that corresponds to the provided JNDI search result.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertSearchEntry
@Nullable public static Entry convertSearchEntry(@Nullable javax.naming.directory.SearchResult r, @Nullable java.lang.String contextBaseDN) throws javax.naming.NamingException
Converts the provided JNDI search result object to an LDAP SDK entry.- Parameters:
r- The JNDI search result object to be converted.contextBaseDN- The base DN for the JNDI context over which the search result was retrieved. If it is non-nulland non-empty, then it will be appended to the result of thegetNamemethod to obtain the entry's full DN.- Returns:
- The LDAP SDK entry that corresponds to the provided JNDI search result.
- Throws:
javax.naming.NamingException- If a problem is encountered during the conversion process.
-
convertSearchEntry
@Nullable public static javax.naming.directory.SearchResult convertSearchEntry(@Nullable Entry e)
Converts the provided LDAP SDK entry to a JNDI search result.- Parameters:
e- The entry to be converted to a JNDI search result.- Returns:
- The JNDI search result that corresponds to the provided LDAP SDK entry.
-
convertSearchEntry
@Nullable public static javax.naming.directory.SearchResult convertSearchEntry(@Nullable Entry e, @Nullable java.lang.String contextBaseDN)
Converts the provided LDAP SDK entry to a JNDI search result.- Parameters:
e- The entry to be converted to a JNDI search result.contextBaseDN- The base DN for the JNDI context over which the search result was retrieved. If it is non-nulland non-empty, then it will be removed from the end of the entry's DN in order to obtain the name for theSearchResultthat is returned.- Returns:
- The JNDI search result that corresponds to the provided LDAP SDK entry.
-
-