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.StringATTR_LDAPPUBLISH_STATUSinstantiate connection factory.static org.slf4j.Loggerloggerprotected ICertAuthoritymAuthorityprotected IConfigStoremConfigprotected java.util.Hashtable<java.lang.String,IRequestListener>mEventHandlershandlers for request types (events) values implement IRequestListenerprotected LdapBoundConnFactorymLdapConnFactoryprotected java.util.Hashtable<java.lang.String,com.netscape.cmscore.ldap.LdapMappers>mMappershashtable of cert types to cert mappers and publishers.protected IPublisherProcessormPubProcessorstatic java.lang.StringPROP_CLASSstatic java.lang.StringPROP_LDAPstatic java.lang.StringPROP_MAPPERstatic java.lang.StringPROP_PUBLISHERstatic java.lang.StringPROP_TYPEstatic java.lang.StringPROP_TYPE_CAstatic java.lang.StringPROP_TYPE_CLIENTstatic java.lang.StringPROP_TYPE_CRL
-
Constructor Summary
Constructors Constructor Description LdapPublishModule()LdapPublishModule(LdapBoundConnFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IRequest request)Accepts completed requests from an authority and performs ldap publishing.netscape.ldap.LDAPConnectiongetConn()ILdapConnFactorygetLdapConnFactory()Returns the internal ldap connection factory.protected com.netscape.cmscore.ldap.LdapMappersgetMappers(java.lang.String certType)Returns the connection factory to the publishing directory.voidinit(ICertAuthority authority, IConfigStore config)voidinit(ICertAuthority authority, IPublisherProcessor p, IConfigStore config)voidinit(ISubsystem sub, IConfigStore config)initialize ldap publishing module with config storeprotected voidinitHandlers()protected voidinitMappers(IConfigStore config)voidpublish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert)voidpublish(java.lang.String certType, java.security.cert.X509Certificate cert)voidpublish(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.voidpublish(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.voidreturnConn(netscape.ldap.LDAPConnection conn)voidset(java.lang.String name, java.lang.String val)Sets attribute.voidsetPublishedFlag(java.math.BigInteger serialNo, boolean published)set published flag - true when published, false when unpublished.voidunpublish(ILdapMapper mapper, ILdapPublisher publisher, java.security.cert.X509Certificate cert)voidunpublish(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:
initin interfaceIRequestListener- Parameters:
sub- subsystemconfig- configuration store- Throws:
EBaseException
-
set
public void set(java.lang.String name, java.lang.String val)Description copied from interface:IRequestListenerSets attribute.- Specified by:
setin 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:
acceptin 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 ELdapExceptionpublishes 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 ELdapExceptionpublishes 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
-
-