|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.persist.PersistUtils
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class PersistUtils
This class provides a set of utilities that may be used in the course of persistence processing.
Method Summary | ||
---|---|---|
static
|
getEntriesAsObjects(DN[] dns,
java.lang.Class<T> type,
LDAPInterface conn)
Retrieves and decodes the indicated entries as objects of the specified type. |
|
static
|
getEntryAsObject(DN dn,
java.lang.Class<T> type,
LDAPInterface conn)
Retrieves the entry with the specified DN and decodes it as an object of the specified type. |
|
static boolean |
isValidJavaIdentifier(java.lang.String s,
java.lang.StringBuilder r)
Indicates whether the provided string could be used as a valid Java identifier. |
|
static boolean |
isValidLDAPName(java.lang.String s,
boolean o,
java.lang.StringBuilder r)
Indicates whether the provided string could be used as a valid attribute or object class name. |
|
static boolean |
isValidLDAPName(java.lang.String s,
java.lang.StringBuilder r)
Indicates whether the provided string could be used as a valid attribute or object class name. |
|
static java.lang.String |
toJavaIdentifier(java.lang.String s)
Transforms the provided string if necessary so that it may be used as a valid Java identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isValidLDAPName(java.lang.String s, java.lang.StringBuilder r)
s
- The string for which to make the determination.r
- A buffer to which the unacceptable reason may be appended. It
must not be null
.
true
if the provided string is acceptable for use as an
LDAP attribute or object class name, or false
if not.public static boolean isValidLDAPName(java.lang.String s, boolean o, java.lang.StringBuilder r)
s
- The string for which to make the determination.o
- Indicates whether the name should be allowed to contain
attribute options (e.g., a semicolon with one or more valid
characters after it).r
- A buffer to which the unacceptable reason may be appended. It
must not be null
.
true
if the provided string is acceptable for use as an
LDAP attribute or object class name, or false
if not.public static boolean isValidJavaIdentifier(java.lang.String s, java.lang.StringBuilder r)
s
- The string for which to make the determination. It must not be
null
.r
- A buffer to which the unacceptable reason may be appended. It
must not be null
.
true
if the provided string is acceptable for use as a
Java identifier, or false
if not.public static java.lang.String toJavaIdentifier(java.lang.String s)
s
- The attribute or object class name to be converted to a Java
identifier.
public static <T> T getEntryAsObject(DN dn, java.lang.Class<T> type, LDAPInterface conn) throws LDAPException
T
- The type of object as which to decode the entry.dn
- The DN of the entry to retrieve. It must not be
null
.type
- The type of object as which the entry should be decoded. It
must not be null
, and the class must be marked with
the LDAPObject
annotation type.conn
- The connection that should be used to retrieve the entry. It
must not be null
.
null
if
the entry cannot be retrieved (e.g., because it does not exist or
is not readable by the authenticated user).
LDAPException
- If a problem occurs while trying to retrieve the
entry or decode it as the specified type of object.public static <T> PersistedObjects<T> getEntriesAsObjects(DN[] dns, java.lang.Class<T> type, LDAPInterface conn) throws LDAPPersistException
T
- The type of object as which to decode the entries.dns
- The DNs of the entries to retrieve. It must not be
null
.type
- The type of object as which the entries should be decoded.
It must not be null
, and the class must be marked
with the LDAPObject
annotation type.conn
- The connection that should be used to retrieve the entries.
It must not be null
.
PersistedObjects
result that may be used to access the
objects decoded from the provided set of DNs.
LDAPPersistException
- If the requested type cannot be used with
the LDAP SDK persistence framework.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |