Class LDAPRegistry
java.lang.Object
com.netscape.cmscore.dbs.DBRegistry
com.netscape.cmscore.dbs.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.
- Version:
- $Revision$, $Date$
- Author:
- thomask
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnetscape.ldap.LDAPAttributeSetCreates attribute set from object.createObject(netscape.ldap.LDAPAttributeSet attrs) Creates object from attribute set.Retrieves configuration store.Creates LDAP-based search filters with help of registered mappers.getFilter(String filter, IFilterConverter c) Creates LDAP-based search filters with help of registered mappers.getId()Retrieves subsystem identifier.String[]getLDAPAttributes(String[] attrs) Retrieves a list of LDAP attributes that are associated with the given attributes.voidinit(IConfigStore config) Initializes the internal registery.booleanisAttributeRegistered(String ufName) See if an attribute is registered.booleanisObjectClassRegistered(String className) See if an object class is registered.voidMaps object into LDAP attribute set.voidregisterAttribute(String ufName, DBAttrMapper mapper) Registers attribute mapper.voidregisterDynamicMapper(DBDynAttrMapper mapper) Registers a dynamic attribute mapper.voidregisterObjectClass(String className, String[] ldapNames) Registers object class.voidSets subsystem identifier.voidshutdown()Shutdowns this subsystem gracefully.voidstartup()Starts up this subsystem.
-
Field Details
-
logger
public static final org.slf4j.Logger logger
-
-
Constructor Details
-
LDAPRegistry
public LDAPRegistry()Constructs registry.
-
-
Method Details
-
getId
-
setId
Sets subsystem identifier. This is an internal subsystem, and is not loadable.- Overrides:
setIdin classDBRegistry- Throws:
EBaseException
-
init
Initializes the internal registery. Connects to the data source, and create a pool of connection of which applications can use. Optionally, check the integrity of the database.- Overrides:
initin classDBRegistry- Throws:
EBaseException
-
getConfigStore
Retrieves configuration store.- Overrides:
getConfigStorein classDBRegistry
-
startup
Starts up this subsystem.- Overrides:
startupin classDBRegistry- Throws:
EBaseException
-
shutdown
-
registerObjectClass
Registers object class.- Overrides:
registerObjectClassin classDBRegistry- 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.- Overrides:
isObjectClassRegisteredin classDBRegistry- Parameters:
className- java class to create- Returns:
- true if object class is registered already
-
registerAttribute
Registers attribute mapper.- Overrides:
registerAttributein classDBRegistry- Parameters:
ufName- LDAP attribute namemapper- mapper to invoke for the attribute- Throws:
EDBException- failed to register
-
isAttributeRegistered
See if an attribute is registered.- Overrides:
isAttributeRegisteredin classDBRegistry- Parameters:
ufName- attribute name- Returns:
- true if attribute is registered already
-
registerDynamicMapper
Description copied from class:DBRegistryRegisters a dynamic attribute mapper.- Overrides:
registerDynamicMapperin classDBRegistry- 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.- Overrides:
getFilterin classDBRegistry- Parameters:
filter- CMS-based filter- Returns:
- LDAP-based filter string
- Throws:
EBaseException- failed to convert filter
-
getFilter
Description copied from class:DBRegistryCreates LDAP-based search filters with help of registered mappers.- Overrides:
getFilterin classDBRegistry- 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.- Overrides:
mapObjectin classDBRegistry- 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. This method is used for searches, to map the database attributes to LDAP attributes.- Overrides:
getLDAPAttributesin classDBRegistry- Parameters:
attrs- attributes- Returns:
- LDAP-based attributes
- Throws:
EBaseException- failed to map attributes
-
createLDAPAttributeSet
Creates attribute set from object.- Overrides:
createLDAPAttributeSetin classDBRegistry- Parameters:
obj- database object- Returns:
- LDAP attribute set
- Throws:
EBaseException- failed to create set
-
createObject
Creates object from attribute set.- Overrides:
createObjectin classDBRegistry- Parameters:
attrs- LDAP attribute set- Returns:
- database object
- Throws:
EDBException
-