Package com.netscape.cms.publish.mappers
Class LdapDNCompsMap
java.lang.Object
com.netscape.cms.publish.mappers.LdapDNCompsMap
- All Implemented Interfaces:
IExtendedPluginInfo
,ILdapPlugin
- Direct Known Subclasses:
LdapCertCompsMap
,LdapCrlIssuerCompsMap
Maps a Subject name to an entry in the LDAP server.
subject name to form the ldap search dn and filter.
Takes a optional root search dn.
The DN comps are used to form a LDAP entry to begin a subtree search.
The filter comps are used to form a search filter for the subtree.
If none of the DN comps matched, baseDN is used for the subtree.
If the baseDN is null and none of the DN comps matched, it is an error.
If none of the DN comps and filter comps matched, it is an error.
If just the filter comps is null, a base search is performed.
- Version:
- $Revision$, $Date$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
class for forming search filters for ldap searching from name=value components. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.slf4j.Logger
protected String
protected ConfigStore
protected org.mozilla.jss.netscape.security.util.ObjectIdentifier[]
protected org.mozilla.jss.netscape.security.util.ObjectIdentifier[]
Fields inherited from interface com.netscape.certsrv.base.IExtendedPluginInfo
HELP_TEXT, HELP_TOKEN
-
Constructor Summary
ConstructorsConstructorDescriptionconstructor if initializing from config store.LdapDNCompsMap
(String ldapAttr, String baseDN, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] dnComps, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] filterComps) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionString[]
formDNandFilter
(org.mozilla.jss.netscape.security.x509.X500Name subjName) form a dn and filter from component in the cert subject namestatic org.mozilla.jss.netscape.security.util.ObjectIdentifier[]
getCompsFromString
(String val) useful routine for parsing components given as string to arrays of objectidentifiers.Return config store.org.mozilla.jss.netscape.security.util.ObjectIdentifier[]
String[]
This method returns an array of strings.org.mozilla.jss.netscape.security.util.ObjectIdentifier[]
void
init
(ConfigStore config) for initializing from config store.protected void
init
(String baseDN, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] dnComps, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] filterComps) common initialization routine.map
(netscape.ldap.LDAPConnection conn, org.mozilla.jss.netscape.security.x509.X500Name x500name, byte[] obj) Maps a X500 subject name to LDAP entry.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
mBaseDN
-
mDnComps
protected org.mozilla.jss.netscape.security.util.ObjectIdentifier[] mDnComps -
mFilterComps
protected org.mozilla.jss.netscape.security.util.ObjectIdentifier[] mFilterComps -
mConfig
-
-
Constructor Details
-
LdapDNCompsMap
public LdapDNCompsMap(String ldapAttr, String baseDN, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] dnComps, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] filterComps) Constructor. The DN comps are used to form a LDAP entry to begin a subtree search. The filter comps are used to form a search filter for the subtree. If none of the DN comps matched, baseDN is used for the subtree. If the baseDN is null and none of the DN comps matched, it is an error. If none of the DN comps and filter comps matched, it is an error. If just the filter comps is null, a base search is performed.- Parameters:
baseDN
- The base DN.dnComps
- Components to form the LDAP base dn for search.filterComps
- Components to form the LDAP search filter.
-
LdapDNCompsMap
public LdapDNCompsMap()constructor if initializing from config store.
-
-
Method Details
-
getConfigStore
Description copied from interface:ILdapPlugin
Return config store.- Specified by:
getConfigStore
in interfaceILdapPlugin
-
init
for initializing from config store.- Specified by:
init
in interfaceILdapPlugin
- Parameters:
config
- the configuration store to initialize from.- Throws:
ELdapException
- initialization failed due to Ldap error.EBaseException
- initialization failed.
-
getImplName
-
getDescription
-
getExtendedPluginInfo
Description copied from interface:IExtendedPluginInfo
This method returns an array of strings. Each element of the array represents a configurable parameter, or some other meta-info (such as help-token) there is an entry indexed on that parameter name Where: type_info is either 'string', 'number', 'boolean', 'password' or 'choice(ch1,ch2,ch3,...)' If the marker 'required' is included after the type_info, the parameter will has some visually distinctive marking in the UI. 'description' is a short sentence describing the parameter 'choice' is rendered as a drop-down list. The first parameter in the list will be activated by default 'boolean' is rendered as a checkbox. The resulting parameter will be either 'true' or 'false' 'string' allows any characters 'number' allows only numbers 'password' is rendered as a password field (the characters are replaced with *'s when being types. This parameter is not passed through to the plugin. It is instead inserted directly into the password cache keyed on the instance name. The value of the parameter 'bindPWPrompt' (see example below) is set to the key. In addition to the configurable parameters, the following magic parameters may be defined: HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin HELP_TEXT;helptext - a general help string describing the plugin For example: "username;string;The username you wish to login as" "bindPWPrompt;password;Enter password to bind as above user with" "algorithm;choice(RSA,DSA);Which algorithm do you want to use" "enable;boolean;Do you want to run this plugin" "port;number;Which port number do you want to use"- Specified by:
getExtendedPluginInfo
in interfaceIExtendedPluginInfo
-
getDefaultParams
-
getInstanceParams
-
init
protected void init(String baseDN, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] dnComps, org.mozilla.jss.netscape.security.util.ObjectIdentifier[] filterComps) common initialization routine. -
map
public String map(netscape.ldap.LDAPConnection conn, org.mozilla.jss.netscape.security.x509.X500Name x500name, byte[] obj) throws ELdapException Maps a X500 subject name to LDAP entry. Uses DN components and filter components to form a DN and filter for a LDAP search. If the formed DN is null the baseDN will be used. If the formed DN is null and baseDN is null an error is thrown. If the filter is null a base search is performed. If both are null an error is thrown.- Parameters:
conn
- the LDAP connection.x500name
- the dn to map.obj
- the object- Returns:
- the DN of the entry.
- Throws:
ELdapException
- if any LDAP exceptions occured.
-
formDNandFilter
public String[] formDNandFilter(org.mozilla.jss.netscape.security.x509.X500Name subjName) throws ELdapException form a dn and filter from component in the cert subject name- Parameters:
subjName
- subject name- Throws:
ELdapException
-
getDnComps
public org.mozilla.jss.netscape.security.util.ObjectIdentifier[] getDnComps() -
getFilterComps
public org.mozilla.jss.netscape.security.util.ObjectIdentifier[] getFilterComps() -
getCompsFromString
public static org.mozilla.jss.netscape.security.util.ObjectIdentifier[] getCompsFromString(String val) throws ELdapException useful routine for parsing components given as string to arrays of objectidentifiers. The string is expected to be comma separated AVA attribute names. For example, "uid,cn,o,ou". Attribute names are case insensitive.- Parameters:
val
- the string specifying the comps- Throws:
ELdapException
- if any error occurs.
-