Package com.netscape.cmscore.dbs
Class DBRegistry
java.lang.Object
com.netscape.cmscore.dbs.DBRegistry
- Direct Known Subclasses:
LDAPRegistry
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnetscape.ldap.LDAPAttributeSet
Creates attribute set from object.createObject
(netscape.ldap.LDAPAttributeSet attrs) Creates object from attribute set.Creates LDAP-based search filters with help of registered mappers.getFilter
(String filter, FilterConverter c) Creates LDAP-based search filters with help of registered mappers.getId()
String[]
getLDAPAttributes
(String[] attrs) Retrieves a list of LDAP attributes that are associated with the given attributes.void
init
(ConfigStore config) boolean
isAttributeRegistered
(String ufName) See if an attribute is registered.boolean
isObjectClassRegistered
(String className) See if an object class is registered.void
Maps object into LDAP attribute set.void
registerAttribute
(String ufName, DBAttrMapper mapper) Registers attribute mapper.void
registerDynamicMapper
(DBDynAttrMapper mapper) Registers a dynamic attribute mapper.void
registerObjectClass
(String className, String[] ldapNames) Registers object class.void
void
shutdown()
void
startup()
-
Constructor Details
-
DBRegistry
public DBRegistry()
-
-
Method Details
-
registerObjectClass
Registers object class.- Parameters:
className
- java class to create for the object classesldapNames
- a list of LDAP object classes- Throws:
EDBException
- failed to register
-
isObjectClassRegistered
See if an object class is registered.- Parameters:
className
- java class to create- Returns:
- true if object class is registered already
-
registerAttribute
Registers attribute mapper.- Parameters:
ufName
- LDAP attribute namemapper
- mapper to invoke for the attribute- Throws:
EDBException
- failed to register
-
isAttributeRegistered
See if an attribute is registered.- Parameters:
ufName
- attribute name- Returns:
- true if attribute is registered already
-
registerDynamicMapper
Registers a dynamic attribute mapper.- Parameters:
mapper
- The dynamic mapper to register
-
getFilter
Creates LDAP-based search filters with help of registered mappers. Parses filter from filter string specified in RFC1558.- Parameters:
filter
- CMS-based filter- Returns:
- LDAP-based filter string
- Throws:
EBaseException
- failed to convert filter
-
getFilter
Creates LDAP-based search filters with help of registered mappers.- Parameters:
filter
- CMS-based filterc
- filter converter- Returns:
- LDAP-based filter string
- Throws:
EBaseException
- failed to convert filter
-
mapObject
public void mapObject(IDBObj parent, String name, Object obj, netscape.ldap.LDAPAttributeSet attrs) throws EBaseException Maps object into LDAP attribute set.- Parameters:
parent
- object's parentname
- name of the objectobj
- object to be mappedattrs
- LDAP attribute set- Throws:
EBaseException
- failed to map object
-
getLDAPAttributes
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
Creates attribute set from object.- Parameters:
obj
- database object- Returns:
- LDAP attribute set
- Throws:
EBaseException
- failed to create set
-
createObject
Creates object from attribute set.- Parameters:
attrs
- LDAP attribute set- Returns:
- database object
- Throws:
EBaseException
- failed to create object
-
getId
-
setId
- Throws:
EBaseException
-
init
- Throws:
EBaseException
-
startup
- Throws:
EBaseException
-
shutdown
public void shutdown() -
getConfigStore
-