Class ObjectStreamMapper

  • All Implemented Interfaces:
    com.netscape.certsrv.dbs.IDBAttrMapper

    public class ObjectStreamMapper
    extends java.lang.Object
    implements com.netscape.certsrv.dbs.IDBAttrMapper
    A class represents ann attribute mapper that maps a Java object into LDAP attribute, and vice versa.
    Version:
    $Revision$, $Date$
    Author:
    thomask
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectStreamMapper​(java.lang.String ldapName)
      Constructs object stream mapper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration<java.lang.String> getSupportedLDAPAttributeNames()
      Retrieves a list of supported ldap attributes.
      void mapLDAPAttributeSetToObject​(netscape.ldap.LDAPAttributeSet attrs, java.lang.String name, com.netscape.certsrv.dbs.IDBObj parent)
      Maps LDAP attributes into object, and put the object into 'parent'.
      void mapObjectToLDAPAttributeSet​(com.netscape.certsrv.dbs.IDBObj parent, java.lang.String name, java.lang.Object obj, netscape.ldap.LDAPAttributeSet attrs)
      Maps object to ldap attribute set.
      java.lang.String mapSearchFilter​(java.lang.String name, java.lang.String op, java.lang.String value)
      Maps search filters into LDAP search filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
    • Constructor Detail

      • ObjectStreamMapper

        public ObjectStreamMapper​(java.lang.String ldapName)
        Constructs object stream mapper.
    • Method Detail

      • getSupportedLDAPAttributeNames

        public java.util.Enumeration<java.lang.String> getSupportedLDAPAttributeNames()
        Retrieves a list of supported ldap attributes.
        Specified by:
        getSupportedLDAPAttributeNames in interface com.netscape.certsrv.dbs.IDBAttrMapper
        Returns:
        a list of supported attribute names
      • mapObjectToLDAPAttributeSet

        public void mapObjectToLDAPAttributeSet​(com.netscape.certsrv.dbs.IDBObj parent,
                                                java.lang.String name,
                                                java.lang.Object obj,
                                                netscape.ldap.LDAPAttributeSet attrs)
                                         throws EBaseException
        Maps object to ldap attribute set.
        Specified by:
        mapObjectToLDAPAttributeSet in interface com.netscape.certsrv.dbs.IDBAttrMapper
        Parameters:
        parent - parent object where the object comes from
        name - name of db attribute
        obj - object itself
        attrs - LDAP attribute set where the result should be stored
        Throws:
        EBaseException - failed to map object
      • mapLDAPAttributeSetToObject

        public void mapLDAPAttributeSetToObject​(netscape.ldap.LDAPAttributeSet attrs,
                                                java.lang.String name,
                                                com.netscape.certsrv.dbs.IDBObj parent)
                                         throws EBaseException
        Maps LDAP attributes into object, and put the object into 'parent'.
        Specified by:
        mapLDAPAttributeSetToObject in interface com.netscape.certsrv.dbs.IDBAttrMapper
        Parameters:
        attrs - LDAP attribute set
        name - name of db attribute to be processed
        parent - parent object where the object should be added
        Throws:
        EBaseException - failed to map object
      • mapSearchFilter

        public java.lang.String mapSearchFilter​(java.lang.String name,
                                                java.lang.String op,
                                                java.lang.String value)
                                         throws EBaseException
        Maps search filters into LDAP search filter.
        Specified by:
        mapSearchFilter in interface com.netscape.certsrv.dbs.IDBAttrMapper
        Parameters:
        name - name of db attribute
        op - filte operation (i.e. "=", ">=")
        value - attribute value
        Throws:
        EBaseException - failed to map filter