com.netscape.certsrv.dbs
Interface IDBRegistry

All Superinterfaces:
ISubsystem

public interface IDBRegistry
extends ISubsystem

A class represents a registry where all the schema (object classes and attribute) information is stored. Attribute mappers can be registered with this registry. Given the schema information stored, this registry has knowledge to convert a Java object into a LDAPAttributeSet or vice versa.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Method Summary
 netscape.ldap.LDAPAttributeSet createLDAPAttributeSet(IDBObj obj)
          Creates attribute set from object.
 IDBObj createObject(netscape.ldap.LDAPAttributeSet attrs)
          Creates object from attribute set.
 java.lang.String getFilter(java.lang.String filter)
          Creates LDAP-based search filters with help of registered mappers.
 java.lang.String getFilter(java.lang.String filter, IFilterConverter c)
          Creates LDAP-based search filters with help of registered mappers.
 java.lang.String[] getLDAPAttributes(java.lang.String[] attrs)
          Retrieves a list of LDAP attributes that are associated with the given attributes.
 boolean isAttributeRegistered(java.lang.String ufName)
          See if an attribute is registered.
 boolean isObjectClassRegistered(java.lang.String className)
          See if an object class is registered.
 void mapObject(IDBObj parent, java.lang.String name, java.lang.Object obj, netscape.ldap.LDAPAttributeSet attrs)
          Maps object into LDAP attribute set.
 void registerAttribute(java.lang.String ufName, IDBAttrMapper mapper)
          Registers attribute mapper.
 void registerDynamicMapper(IDBDynAttrMapper mapper)
          Registers a dynamic attribute mapper.
 void registerObjectClass(java.lang.String className, java.lang.String[] ldapNames)
          Registers object class.
 
Methods inherited from interface com.netscape.certsrv.base.ISubsystem
getConfigStore, getId, init, setId, shutdown, startup
 

Method Detail

registerObjectClass

void registerObjectClass(java.lang.String className,
                         java.lang.String[] ldapNames)
                         throws EDBException
Registers object class.

Parameters:
className - java class to create for the object classes
ldapNames - a list of LDAP object classes
Throws:
EDBException - failed to register

isObjectClassRegistered

boolean isObjectClassRegistered(java.lang.String className)
See if an object class is registered.

Parameters:
className - java class to create
Returns:
true if object class is registered already

registerAttribute

void registerAttribute(java.lang.String ufName,
                       IDBAttrMapper mapper)
                       throws EDBException
Registers attribute mapper.

Parameters:
ufName - LDAP attribute name
mapper - mapper to invoke for the attribute
Throws:
EDBException - failed to register

isAttributeRegistered

boolean isAttributeRegistered(java.lang.String ufName)
See if an attribute is registered.

Parameters:
ufName - attribute name
Returns:
true if attribute is registered already

registerDynamicMapper

void registerDynamicMapper(IDBDynAttrMapper mapper)
Registers a dynamic attribute mapper.

Parameters:
mapper - The dynamic mapper to register

getFilter

java.lang.String getFilter(java.lang.String filter)
                           throws EBaseException
Creates LDAP-based search filters with help of registered mappers. Parses filter from filter string specified in RFC1558.
  ::= '('  ')'
  ::=  |  |  | 
  ::= '&' 
  ::= '|' 
  ::= '!' 
  ::=  |  
  ::=  |  | 
  ::=   
  ::=  |  |  | 
  ::= '='
  ::= '~='
  ::= '>='
  ::= '<='
  ::=  '=*'
  ::=  '='   
  ::= NULL | 
  ::= '*' 
  ::= NULL |  '*' 
  ::= NULL | 
 

Parameters:
filter - CMS-based filter
Returns:
LDAP-based filter string
Throws:
EBaseException - failed to convert filter

getFilter

java.lang.String getFilter(java.lang.String filter,
                           IFilterConverter c)
                           throws EBaseException
Creates LDAP-based search filters with help of registered mappers.

Parameters:
filter - CMS-based filter
c - filter converter
Returns:
LDAP-based filter string
Throws:
EBaseException - failed to convert filter

mapObject

void mapObject(IDBObj parent,
               java.lang.String name,
               java.lang.Object obj,
               netscape.ldap.LDAPAttributeSet attrs)
               throws EBaseException
Maps object into LDAP attribute set.

Parameters:
parent - object's parent
name - name of the object
obj - object to be mapped
attrs - LDAP attribute set
Throws:
EBaseException - failed to map object

getLDAPAttributes

java.lang.String[] getLDAPAttributes(java.lang.String[] attrs)
                                     throws EBaseException
Retrieves a list of LDAP attributes that are associated with the given attributes.

Parameters:
attrs - attributes
Returns:
LDAP-based attributes
Throws:
EBaseException - failed to map attributes

createLDAPAttributeSet

netscape.ldap.LDAPAttributeSet createLDAPAttributeSet(IDBObj obj)
                                                      throws EBaseException
Creates attribute set from object.

Parameters:
obj - database object
Returns:
LDAP attribute set
Throws:
EBaseException - failed to create set

createObject

IDBObj createObject(netscape.ldap.LDAPAttributeSet attrs)
                    throws EBaseException
Creates object from attribute set.

Parameters:
attrs - LDAP attribute set
Returns:
database object
Throws:
EBaseException - failed to create object