Package com.netscape.cmscore.ldap
Class PublisherProcessor
- java.lang.Object
-
- com.netscape.cmscore.ldap.PublisherProcessor
-
- All Implemented Interfaces:
IPublisherProcessor
,IXcertPublisherProcessor
public class PublisherProcessor extends java.lang.Object implements IPublisherProcessor, IXcertPublisherProcessor
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
logger
protected ICertAuthority
mAuthority
protected LdapConnModule
mLdapConnModule
protected PublishRuleSet mRuleSet = null;protected LdapRequestListener
mLdapRequestListener
java.util.Hashtable<java.lang.String,MapperProxy>
mMapperInsts
java.util.Hashtable<java.lang.String,MapperPlugin>
mMapperPlugins
java.util.Hashtable<java.lang.String,PublisherProxy>
mPublisherInsts
java.util.Hashtable<java.lang.String,PublisherPlugin>
mPublisherPlugins
java.util.Hashtable<java.lang.String,ILdapRule>
mRuleInsts
java.util.Hashtable<java.lang.String,RulePlugin>
mRulePlugins
-
Fields inherited from interface com.netscape.certsrv.publish.IPublisherProcessor
PROP_CERT_ENABLE, PROP_CERTS, PROP_CLASS, PROP_CRL_ENABLE, PROP_ENABLE, PROP_IMPL, PROP_INSTANCE, PROP_LDAP, PROP_LDAP_PUBLISH_SUBSTORE, PROP_LOCAL_CA, PROP_LOCAL_CRL, PROP_MAPPER, PROP_PLUGIN, PROP_PREDICATE, PROP_PUBLISH_SUBSTORE, PROP_PUBLISHER, PROP_QUEUE_PUBLISH_SUBSTORE, PROP_TYPE, PROP_XCERT
-
-
Constructor Summary
Constructors Constructor Description PublisherProcessor(java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ILdapMapper
getActiveMapperInstance(java.lang.String insName)
Returns ILdapMapper instance that is currently active.ILdapPublisher
getActivePublisherInstance(java.lang.String insName)
Returns ILdapPublisher instance that is currently active.ISubsystem
getAuthority()
Return Authority for which this Processor operates.IConfigStore
getConfigStore()
java.lang.String
getId()
ILdapConnModule
getLdapConnModule()
Retrieves LDAP connection module.java.util.Vector<java.lang.String>
getMapperDefaultParams(java.lang.String implName)
public PublishRuleSet getPublishRuleSet() { return mRuleSet; }ILdapMapper
getMapperInstance(java.lang.String insName)
Returns ILdapMapper instance based on name of MapperProxy.java.util.Vector<java.lang.String>
getMapperInstanceParams(java.lang.String insName)
Returns mapper current instance parameters.java.util.Hashtable<java.lang.String,MapperProxy>
getMapperInsts()
Returns Hashtable of rule mapper instances.java.util.Hashtable<java.lang.String,MapperPlugin>
getMapperPlugins()
Returns Hashtable of mapper plugins.java.util.Vector<java.lang.String>
getPublisherDefaultParams(java.lang.String implName)
Returns publisher initial default parameters.ILdapPublisher
getPublisherInstance(java.lang.String insName)
Returns ILdapPublisher instance.java.util.Vector<java.lang.String>
getPublisherInstanceParams(java.lang.String insName)
Returns Vector of PublisherIntance's current instance parameters.java.util.Hashtable<java.lang.String,PublisherProxy>
getPublisherInsts()
Returns Hashtable of rule publisher instances.java.util.Hashtable<java.lang.String,PublisherPlugin>
getPublisherPlugins()
Returns Hashtable of publisher plugins.java.util.Vector<java.lang.String>
getRuleDefaultParams(java.lang.String implName)
Returns Vector of RulePlugin's initial default parameters.java.util.Vector<java.lang.String>
getRuleInstanceParams(java.lang.String implName)
Returns Vector of RulePlugin's current instance parameters.java.util.Hashtable<java.lang.String,ILdapRule>
getRuleInsts()
Returns Hashtable of rule instances.java.util.Hashtable<java.lang.String,RulePlugin>
getRulePlugins()
Returns Hashtable of rule plugins.java.util.Enumeration<ILdapRule>
getRules(java.lang.String publishingType)
Returns list of rules based on publishing type.java.util.Enumeration<ILdapRule>
getRules(java.lang.String publishingType, IRequest req)
Returns list of rules based on publishing type and publishing request.void
init(ISubsystem authority, IConfigStore config)
boolean
isCertPublishingEnabled()
Return true if Certificate Publishing is enabled.boolean
isClone()
boolean
isCRLPublishingEnabled()
Return true if CRL publishing is enabled,boolean
isMapperInstanceEnable(java.lang.String insName)
Returns true if MapperInstance is enabled.boolean
isPublisherInstanceEnable(java.lang.String insName)
Returns true publisher instance is currently enabled.boolean
ldapEnabled()
Return true if Ldap is enabled.void
publishCACert(java.security.cert.X509Certificate cert)
Publish ca cert, UpdateDir.java, jobs, request listenersvoid
publishCert(java.security.cert.X509Certificate cert, IRequest req)
Publishs regular user certificate based on the criteria set in the request.void
publishCRL(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
publishCRL(org.mozilla.jss.netscape.security.x509.X509CRLImpl crl, java.lang.String crlIssuingPointId)
publishes a crl by mapping the issuer name in the crl to an entry and publishing it there.void
publishXCertPair(byte[] pair)
Publish crossCertificatePairvoid
setId(java.lang.String id)
void
setLdapConnModule(ILdapConnModule m)
Sets the LdapConnModule belonging to this Processor.void
setPublishedFlag(java.math.BigInteger serialNo, boolean published)
set published flag - true when published, false when unpublished.void
shutdown()
void
startup()
void
unpublishCACert(java.security.cert.X509Certificate cert)
This function is never called.void
unpublishCert(java.security.cert.X509Certificate cert, IRequest req)
Unpublish user certificate.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
mPublisherPlugins
public java.util.Hashtable<java.lang.String,PublisherPlugin> mPublisherPlugins
-
mPublisherInsts
public java.util.Hashtable<java.lang.String,PublisherProxy> mPublisherInsts
-
mMapperPlugins
public java.util.Hashtable<java.lang.String,MapperPlugin> mMapperPlugins
-
mMapperInsts
public java.util.Hashtable<java.lang.String,MapperProxy> mMapperInsts
-
mRulePlugins
public java.util.Hashtable<java.lang.String,RulePlugin> mRulePlugins
-
mRuleInsts
public java.util.Hashtable<java.lang.String,ILdapRule> mRuleInsts
-
mLdapConnModule
protected LdapConnModule mLdapConnModule
protected PublishRuleSet mRuleSet = null;
-
mAuthority
protected ICertAuthority mAuthority
-
mLdapRequestListener
protected LdapRequestListener mLdapRequestListener
-
-
Method Detail
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getConfigStore
public IConfigStore getConfigStore()
-
init
public void init(ISubsystem authority, IConfigStore config) throws EBaseException
- Throws:
EBaseException
-
getLdapConnModule
public ILdapConnModule getLdapConnModule()
Retrieves LDAP connection module.- Specified by:
getLdapConnModule
in interfaceIPublisherProcessor
- Returns:
- LDAP connection instance
-
setLdapConnModule
public void setLdapConnModule(ILdapConnModule m)
Description copied from interface:IPublisherProcessor
Sets the LdapConnModule belonging to this Processor.- Specified by:
setLdapConnModule
in interfaceIPublisherProcessor
- Parameters:
m
- ILdapConnModule.
-
startup
public void startup() throws EBaseException
- Throws:
EBaseException
-
shutdown
public void shutdown()
-
getRulePlugins
public java.util.Hashtable<java.lang.String,RulePlugin> getRulePlugins()
Description copied from interface:IPublisherProcessor
Returns Hashtable of rule plugins.- Specified by:
getRulePlugins
in interfaceIPublisherProcessor
-
getRuleInsts
public java.util.Hashtable<java.lang.String,ILdapRule> getRuleInsts()
Description copied from interface:IPublisherProcessor
Returns Hashtable of rule instances.- Specified by:
getRuleInsts
in interfaceIPublisherProcessor
-
getMapperPlugins
public java.util.Hashtable<java.lang.String,MapperPlugin> getMapperPlugins()
Description copied from interface:IPublisherProcessor
Returns Hashtable of mapper plugins.- Specified by:
getMapperPlugins
in interfaceIPublisherProcessor
-
getPublisherPlugins
public java.util.Hashtable<java.lang.String,PublisherPlugin> getPublisherPlugins()
Description copied from interface:IPublisherProcessor
Returns Hashtable of publisher plugins.- Specified by:
getPublisherPlugins
in interfaceIPublisherProcessor
-
getMapperInsts
public java.util.Hashtable<java.lang.String,MapperProxy> getMapperInsts()
Description copied from interface:IPublisherProcessor
Returns Hashtable of rule mapper instances.- Specified by:
getMapperInsts
in interfaceIPublisherProcessor
-
getPublisherInsts
public java.util.Hashtable<java.lang.String,PublisherProxy> getPublisherInsts()
Description copied from interface:IPublisherProcessor
Returns Hashtable of rule publisher instances.- Specified by:
getPublisherInsts
in interfaceIPublisherProcessor
-
getRules
public java.util.Enumeration<ILdapRule> getRules(java.lang.String publishingType)
Description copied from interface:IPublisherProcessor
Returns list of rules based on publishing type.- Specified by:
getRules
in interfaceIPublisherProcessor
- Parameters:
publishingType
- Type for which to retrieve rule list.
-
getRules
public java.util.Enumeration<ILdapRule> getRules(java.lang.String publishingType, IRequest req)
Description copied from interface:IPublisherProcessor
Returns list of rules based on publishing type and publishing request.- Specified by:
getRules
in interfaceIPublisherProcessor
- Parameters:
publishingType
- Type for which to retrieve rule list.req
- Corresponding publish request.
-
getMapperDefaultParams
public java.util.Vector<java.lang.String> getMapperDefaultParams(java.lang.String implName) throws ELdapException
public PublishRuleSet getPublishRuleSet() { return mRuleSet; }- Specified by:
getMapperDefaultParams
in interfaceIPublisherProcessor
- Parameters:
implName
- name of MapperPlugin.- Throws:
ELdapException
-
getMapperInstanceParams
public java.util.Vector<java.lang.String> getMapperInstanceParams(java.lang.String insName) throws ELdapException
Description copied from interface:IPublisherProcessor
Returns mapper current instance parameters.- Specified by:
getMapperInstanceParams
in interfaceIPublisherProcessor
- Parameters:
insName
- name of MapperProxy.- Throws:
ELdapException
- failed due to Ldap error.
-
getPublisherDefaultParams
public java.util.Vector<java.lang.String> getPublisherDefaultParams(java.lang.String implName) throws ELdapException
Description copied from interface:IPublisherProcessor
Returns publisher initial default parameters.- Specified by:
getPublisherDefaultParams
in interfaceIPublisherProcessor
- Parameters:
implName
- name of PublisherPlugin.- Throws:
ELdapException
- failed due to Ldap error.
-
isMapperInstanceEnable
public boolean isMapperInstanceEnable(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns true if MapperInstance is enabled.- Specified by:
isMapperInstanceEnable
in interfaceIPublisherProcessor
- Parameters:
insName
- name of MapperProxy.- Returns:
- true if enabled. false if disabled.
-
getActiveMapperInstance
public ILdapMapper getActiveMapperInstance(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns ILdapMapper instance that is currently active.- Specified by:
getActiveMapperInstance
in interfaceIPublisherProcessor
- Parameters:
insName
- name of MapperProxy.- Returns:
- instance of ILdapMapper.
-
getMapperInstance
public ILdapMapper getMapperInstance(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns ILdapMapper instance based on name of MapperProxy.- Specified by:
getMapperInstance
in interfaceIPublisherProcessor
- Parameters:
insName
- name of MapperProxy.- Returns:
- instance of ILdapMapper.
-
isPublisherInstanceEnable
public boolean isPublisherInstanceEnable(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns true publisher instance is currently enabled.- Specified by:
isPublisherInstanceEnable
in interfaceIPublisherProcessor
- Parameters:
insName
- name of PublisherProxy.- Returns:
- true if enabled.
-
getActivePublisherInstance
public ILdapPublisher getActivePublisherInstance(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns ILdapPublisher instance that is currently active.- Specified by:
getActivePublisherInstance
in interfaceIPublisherProcessor
- Parameters:
insName
- name of PublisherProxy.- Returns:
- instance of ILdapPublisher.
-
getPublisherInstance
public ILdapPublisher getPublisherInstance(java.lang.String insName)
Description copied from interface:IPublisherProcessor
Returns ILdapPublisher instance.- Specified by:
getPublisherInstance
in interfaceIPublisherProcessor
- Parameters:
insName
- name of PublisherProxy.- Returns:
- instance of ILdapPublisher.
-
getPublisherInstanceParams
public java.util.Vector<java.lang.String> getPublisherInstanceParams(java.lang.String insName) throws ELdapException
Description copied from interface:IPublisherProcessor
Returns Vector of PublisherIntance's current instance parameters.- Specified by:
getPublisherInstanceParams
in interfaceIPublisherProcessor
- Parameters:
insName
- name of PublisherProxy.- Returns:
- Vector of current instance parameters.
- Throws:
ELdapException
-
getRuleDefaultParams
public java.util.Vector<java.lang.String> getRuleDefaultParams(java.lang.String implName) throws ELdapException
Description copied from interface:IPublisherProcessor
Returns Vector of RulePlugin's initial default parameters.- Specified by:
getRuleDefaultParams
in interfaceIPublisherProcessor
- Parameters:
implName
- name of RulePlugin.- Returns:
- Vector of initial default parameters.
- Throws:
ELdapException
- failed due to Ldap error.
-
getRuleInstanceParams
public java.util.Vector<java.lang.String> getRuleInstanceParams(java.lang.String implName) throws ELdapException
Description copied from interface:IPublisherProcessor
Returns Vector of RulePlugin's current instance parameters.- Specified by:
getRuleInstanceParams
in interfaceIPublisherProcessor
- Parameters:
implName
- name of RulePlugin.- Returns:
- Vector of current instance parameters.
- Throws:
ELdapException
- failed due to Ldap error.
-
setPublishedFlag
public void setPublishedFlag(java.math.BigInteger serialNo, boolean published)
set published flag - true when published, false when unpublished. not exist means not published.- Specified by:
setPublishedFlag
in interfaceIPublisherProcessor
- Parameters:
serialNo
- serial number of publishable object.published
- true for published, false for not.
-
publishCACert
public void publishCACert(java.security.cert.X509Certificate cert) throws ELdapException
Publish ca cert, UpdateDir.java, jobs, request listeners- Specified by:
publishCACert
in interfaceIPublisherProcessor
- Parameters:
cert
- X509 certificate to be published.- Throws:
ELdapException
- publish failed due to Ldap error.
-
unpublishCACert
public void unpublishCACert(java.security.cert.X509Certificate cert) throws ELdapException
This function is never called. CMS does not unpublish CA certificate.- Specified by:
unpublishCACert
in interfaceIPublisherProcessor
- Throws:
ELdapException
-
publishXCertPair
public void publishXCertPair(byte[] pair) throws ELdapException
Publish crossCertificatePair- Specified by:
publishXCertPair
in interfaceIXcertPublisherProcessor
- Parameters:
pair
- Byte array representing cert pair.- Throws:
ELdapException
-
publishCert
public void publishCert(java.security.cert.X509Certificate cert, IRequest req) throws ELdapException
Publishs regular user certificate based on the criteria set in the request.- Specified by:
publishCert
in interfaceIPublisherProcessor
- Parameters:
cert
- X509 certificate to be published.req
- request which provides the criteria- Throws:
ELdapException
- publish failed due to Ldap error.
-
unpublishCert
public void unpublishCert(java.security.cert.X509Certificate cert, IRequest req) throws ELdapException
Unpublish user certificate. This is used by UnpublishExpiredJob.- Specified by:
unpublishCert
in interfaceIPublisherProcessor
- Parameters:
cert
- X509 certificate to be unpublished.req
- request which provides the criteria- Throws:
ELdapException
- unpublish failed due to Ldap error.
-
publishCRL
public void publishCRL(org.mozilla.jss.netscape.security.x509.X509CRLImpl crl, java.lang.String crlIssuingPointId) 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. Note that this is used by cmsgateway/cert/UpdateDir.java- Specified by:
publishCRL
in interfaceIPublisherProcessor
- Parameters:
crl
- Certificate Revocation ListcrlIssuingPointId
- name of the issuing point.- Throws:
ELdapException
-
publishCRL
public void publishCRL(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.- Specified by:
publishCRL
in interfaceIPublisherProcessor
- Parameters:
dn
- Distinguished name to publish.crl
- Certificate Revocation List- Throws:
ELdapException
- publish failed due to Ldap error.
-
ldapEnabled
public boolean ldapEnabled()
Description copied from interface:IPublisherProcessor
Return true if Ldap is enabled.- Specified by:
ldapEnabled
in interfaceIPublisherProcessor
- Returns:
- true if Ldap is enabled,otherwise false.
-
isCertPublishingEnabled
public boolean isCertPublishingEnabled()
Description copied from interface:IPublisherProcessor
Return true if Certificate Publishing is enabled.- Specified by:
isCertPublishingEnabled
in interfaceIPublisherProcessor
- Returns:
- true if enabled, false otherwise
-
isCRLPublishingEnabled
public boolean isCRLPublishingEnabled()
Description copied from interface:IPublisherProcessor
Return true if CRL publishing is enabled,- Specified by:
isCRLPublishingEnabled
in interfaceIPublisherProcessor
- Returns:
- true if enabled, false otherwise.
-
getAuthority
public ISubsystem getAuthority()
Description copied from interface:IPublisherProcessor
Return Authority for which this Processor operates.- Specified by:
getAuthority
in interfaceIPublisherProcessor
- Returns:
- Authority.
-
isClone
public boolean isClone()
-
-