Package com.netscape.jndi.ldap
Class ObjectMapper
java.lang.Object
com.netscape.jndi.ldap.ObjectMapper
Class used to map Java objects to ldap entries back and forth
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
Schema attributes for mapping java objects to ldap entries(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
Schema object classes for mapping java objects to ldap entries(package private) static final String
(package private) static final String
(package private) static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
decodeRefAddr
(String enc, Reference ref) Decode RefAddr according to the invalid input: '<'draft-ryan-java-schema-01.rev.txt> StringRefAddr are encoded as #posNo#refType#refValue where posNo is the refAddr position (index) inside a rerference.private static Reference
decodeRefObj
(LDAPAttributeSet attrs) Decode Jndi Reference Objectprivate static Object
deserializeObject
(byte[] byteBuf) Deserialized object, create object from a stream of bytes(package private) static Attributes
encodeDirCtxObj
(DirContext obj, Attributes attrs) Encode DirContext object (merege attributes)private static String
encodeRefAddr
(char delimChar, int idx, RefAddr refAddr) Encode RefAddr according to the invalid input: '<'draft-ryan-java-schema-01.rev.txt> StringRefAddr are encoded as #posNo#refType#refValue where posNo is the refAddr position (index) inside a rerference.private static Attributes
encodeRefObj
(char delimChar, Reference ref, Attributes attrs) Encode Jndi Reference Object(package private) static Attributes
encodeSerialObj
(Serializable obj, Attributes attrs) Encode Serializable object(package private) static Object
entryToObject
(LDAPEntry entry) Convert a Ldap entry into a java object(package private) static Object
entryToObject
(LDAPEntry entry, LdapContextImpl ctx) (package private) static String
getClassName
(LDAPEntry entry) Get the className for NameClassPair from an entrystatic void
(package private) static LDAPAttributeSet
objectToAttrSet
(Object obj, String name, LdapContextImpl ctx, Attributes attrs) Convert a java object with an optional set of attributes into a LDAP entryprivate static byte[]
serializeObject
(Object obj) Serialize object, convert object to a stream of bytes
-
Field Details
-
OC_JAVAOBJECT
Schema object classes for mapping java objects to ldap entries- See Also:
-
OC_SERIALOBJ
- See Also:
-
OC_MARSHALOBJ
- See Also:
-
OC_REFERENCE
- See Also:
-
OC_CONTAINER
- See Also:
-
AT_CLASSNAME
Schema attributes for mapping java objects to ldap entries- See Also:
-
AT_CLASSNAMES
- See Also:
-
AT_DESCRIPTION
- See Also:
-
AT_JAVADOC
- See Also:
-
AT_CODEBASE
- See Also:
-
AT_SERIALDATA
- See Also:
-
AT_REFADDR
- See Also:
-
AT_OBJFACTORY
- See Also:
-
DEFAULT_OBJCLASS
- See Also:
-
-
Constructor Details
-
ObjectMapper
public ObjectMapper()
-
-
Method Details
-
entryToObject
- Throws:
NamingException
-
entryToObject
Convert a Ldap entry into a java object- Throws:
NamingException
-
getClassName
Get the className for NameClassPair from an entry -
objectToAttrSet
static LDAPAttributeSet objectToAttrSet(Object obj, String name, LdapContextImpl ctx, Attributes attrs) throws NamingException Convert a java object with an optional set of attributes into a LDAP entry- Throws:
NamingException
-
deserializeObject
Deserialized object, create object from a stream of bytes- Throws:
NamingException
-
serializeObject
Serialize object, convert object to a stream of bytes- Throws:
NamingException
-
decodeRefObj
Decode Jndi Reference Object- Throws:
NamingException
-
decodeRefAddr
Decode RefAddr according to the invalid input: '<'draft-ryan-java-schema-01.rev.txt> StringRefAddr are encoded as #posNo#refType#refValue where posNo is the refAddr position (index) inside a rerference. BynaryRefAddr is encoded as #posNo#refType##data where data is the base64 encoding of the serialized form of the entire BinaryRefAddr instance.- Throws:
NamingException
-
encodeRefObj
private static Attributes encodeRefObj(char delimChar, Reference ref, Attributes attrs) throws NamingException Encode Jndi Reference Object- Throws:
NamingException
-
encodeRefAddr
private static String encodeRefAddr(char delimChar, int idx, RefAddr refAddr) throws NamingException Encode RefAddr according to the invalid input: '<'draft-ryan-java-schema-01.rev.txt> StringRefAddr are encoded as #posNo#refType#refValue where posNo is the refAddr position (index) inside a rerference. BynaryRefAddr is encoded as #posNo#refType##data where data is the base64 encoding of the serialized form of the entire BinaryRefAddr instance.- Throws:
NamingException
-
encodeSerialObj
Encode Serializable object- Throws:
NamingException
-
encodeDirCtxObj
Encode DirContext object (merege attributes)- Throws:
NamingException
-
main
-