Package com.netscape.cmscore.ldap
Class LdapPublishModule
- java.lang.Object
-
- com.netscape.cmscore.ldap.LdapPublishModule
-
- All Implemented Interfaces:
IRequestListener
public class LdapPublishModule extends java.lang.Object implements IRequestListener
Handles requests to perform Ldap publishing.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_LDAPPUBLISH_STATUS
instantiate connection factory.static org.slf4j.Logger
logger
protected ICertAuthority
mAuthority
protected IConfigStore
mConfig
protected java.util.Hashtable<java.lang.String,IRequestListener>
mEventHandlers
handlers for request types (events) values implement IRequestListenerprotected LdapBoundConnFactory
mLdapConnFactory
protected java.util.Hashtable<java.lang.String,com.netscape.cmscore.ldap.LdapMappers>
mMappers
hashtable of cert types to cert mappers and publishers.protected IPublisherProcessor
mPubProcessor
static java.lang.String
PROP_CLASS
static java.lang.String
PROP_LDAP
static java.lang.String
PROP_MAPPER
static java.lang.String
PROP_PUBLISHER
static java.lang.String
PROP_TYPE
static java.lang.String
PROP_TYPE_CA
static java.lang.String
PROP_TYPE_CLIENT
static java.lang.String
PROP_TYPE_CRL
-
Constructor Summary
Constructors Constructor Description LdapPublishModule()
LdapPublishModule(LdapBoundConnFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(IRequest request)
Accepts completed requests from an authority and performs ldap publishing.netscape.ldap.LDAPConnection
getConn()
ILdapConnFactory
getLdapConnFactory()
Returns the internal ldap connection factory.protected com.netscape.cmscore.ldap.LdapMappers
getMappers(java.lang.String certType)
Returns the connection factory to the publishing directory.void
init(ICertAuthority authority, IConfigStore config)
void
init(ICertAuthority authority, IPublisherProcessor p, IConfigStore config)
void
init(ISubsystem sub, IConfigStore config)
initialize ldap publishing module with config storeprotected void
initHandlers()
protected void
initMappers(IConfigStore config)
void
publish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert)
void
publish(java.lang.String certType, java.security.cert.X509Certificate cert)
void
publish(java.lang.String dn, java.security.cert.X509CRL crl)
publishes a crl by mapping the issuer name in the crl to an entry and publishing it there.void
publish(org.mozilla.jss.netscape.security.x509.X509CRLImpl crl)
publishes a crl by mapping the issuer name in the crl to an entry and publishing it there.void
returnConn(netscape.ldap.LDAPConnection conn)
void
set(java.lang.String name, java.lang.String val)
Sets attribute.void
setPublishedFlag(java.math.BigInteger serialNo, boolean published)
set published flag - true when published, false when unpublished.void
unpublish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert)
void
unpublish(java.lang.String certType, java.security.cert.X509Certificate cert)
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
mConfig
protected IConfigStore mConfig
-
mLdapConnFactory
protected LdapBoundConnFactory mLdapConnFactory
-
mAuthority
protected ICertAuthority mAuthority
-
mMappers
protected java.util.Hashtable<java.lang.String,com.netscape.cmscore.ldap.LdapMappers> mMappers
hashtable of cert types to cert mappers and publishers. cert types are client, server, ca, subca, ra, crl, etc. XXX the cert types need to be consistently used. for each, the mapper may be null, in which case the full subject name is used to map the cert. for crl, if the mapper is null the ca mapper is used. if that is null, the full issuer name is used. XXX if we support crl issuing points the issuing point should be used to publish the crl. When publishers are null, the certs are not published.
-
mEventHandlers
protected java.util.Hashtable<java.lang.String,IRequestListener> mEventHandlers
handlers for request types (events) values implement IRequestListener
-
ATTR_LDAPPUBLISH_STATUS
public static final java.lang.String ATTR_LDAPPUBLISH_STATUS
instantiate connection factory.- See Also:
- Constant Field Values
-
PROP_LDAP
public static final java.lang.String PROP_LDAP
- See Also:
- Constant Field Values
-
PROP_MAPPER
public static final java.lang.String PROP_MAPPER
- See Also:
- Constant Field Values
-
PROP_PUBLISHER
public static final java.lang.String PROP_PUBLISHER
- See Also:
- Constant Field Values
-
PROP_CLASS
public static final java.lang.String PROP_CLASS
- See Also:
- Constant Field Values
-
PROP_TYPE
public static final java.lang.String PROP_TYPE
- See Also:
- Constant Field Values
-
PROP_TYPE_CA
public static final java.lang.String PROP_TYPE_CA
- See Also:
- Constant Field Values
-
PROP_TYPE_CLIENT
public static final java.lang.String PROP_TYPE_CLIENT
- See Also:
- Constant Field Values
-
PROP_TYPE_CRL
public static final java.lang.String PROP_TYPE_CRL
- See Also:
- Constant Field Values
-
mPubProcessor
protected IPublisherProcessor mPubProcessor
-
-
Constructor Detail
-
LdapPublishModule
public LdapPublishModule()
-
LdapPublishModule
public LdapPublishModule(LdapBoundConnFactory factory)
-
-
Method Detail
-
init
public void init(ISubsystem sub, IConfigStore config) throws EBaseException
initialize ldap publishing module with config store- Specified by:
init
in interfaceIRequestListener
- Parameters:
sub
- subsystemconfig
- configuration store- Throws:
EBaseException
-
set
public void set(java.lang.String name, java.lang.String val)
Description copied from interface:IRequestListener
Sets attribute.- Specified by:
set
in interfaceIRequestListener
- Parameters:
name
- attribute nameval
- attribute value
-
init
public void init(ICertAuthority authority, IPublisherProcessor p, IConfigStore config) throws EBaseException
- Throws:
EBaseException
-
init
public void init(ICertAuthority authority, IConfigStore config) throws EBaseException
- Throws:
EBaseException
-
getLdapConnFactory
public ILdapConnFactory getLdapConnFactory()
Returns the internal ldap connection factory. This can be useful to get a ldap connection to the ldap publishing directory without having to get it again from the config file. Note that this means sharing a ldap connection pool with the ldap publishing module so be sure to return connections to pool. Use ILdapConnFactory.getConn() to get a Ldap connection to the ldap publishing directory. Use ILdapConnFactory.returnConn() to return the connection.- See Also:
com.netscape.certsrv.ldap.LdapBoundConnFactory
,ILdapConnFactory
-
getMappers
protected com.netscape.cmscore.ldap.LdapMappers getMappers(java.lang.String certType)
Returns the connection factory to the publishing directory. Must return the connection once you return
-
initMappers
protected void initMappers(IConfigStore config) throws EBaseException
- Throws:
EBaseException
-
initHandlers
protected void initHandlers()
-
accept
public void accept(IRequest request)
Accepts completed requests from an authority and performs ldap publishing.- Specified by:
accept
in interfaceIRequestListener
- Parameters:
request
- The publishing request.
-
publish
public void publish(java.lang.String certType, java.security.cert.X509Certificate cert) throws ELdapException
- Throws:
ELdapException
-
unpublish
public void unpublish(java.lang.String certType, java.security.cert.X509Certificate cert) throws ELdapException
- Throws:
ELdapException
-
setPublishedFlag
public void setPublishedFlag(java.math.BigInteger serialNo, boolean published)
set published flag - true when published, false when unpublished. not exist means not published.
-
getConn
public netscape.ldap.LDAPConnection getConn() throws ELdapException
- Throws:
ELdapException
-
returnConn
public void returnConn(netscape.ldap.LDAPConnection conn) throws ELdapException
- Throws:
ELdapException
-
publish
public void publish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert) throws ELdapException
- Throws:
ELdapException
-
unpublish
public void unpublish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert) throws ELdapException
- Throws:
ELdapException
-
publish
public void publish(org.mozilla.jss.netscape.security.x509.X509CRLImpl crl) throws ELdapException
publishes a crl by mapping the issuer name in the crl to an entry and publishing it there. entry must be a certificate authority.- Throws:
ELdapException
-
publish
public void publish(java.lang.String dn, java.security.cert.X509CRL crl) throws ELdapException
publishes a crl by mapping the issuer name in the crl to an entry and publishing it there. entry must be a certificate authority.- Throws:
ELdapException
-
-