summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java79
1 files changed, 44 insertions, 35 deletions
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java
index 05d25e5ff..40283e985 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java
@@ -17,6 +17,7 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.publish.mappers;
+
import java.security.cert.CRLException;
import java.util.Vector;
@@ -31,14 +32,16 @@ import com.netscape.certsrv.logging.ILogger;
import com.netscape.certsrv.publish.ILdapMapper;
import com.netscape.certsrv.request.IRequest;
-/**
- * Default crl mapper. maps the crl to a ldap entry by using components in the
- * issuer name to find the CA's entry.
- *
+
+/**
+ * Default crl mapper.
+ * maps the crl to a ldap entry by using components in the issuer name
+ * to find the CA's entry.
+ *
* @version $Revision$, $Date$
*/
-public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
- ILdapMapper {
+public class LdapCrlIssuerCompsMap
+ extends LdapDNCompsMap implements ILdapMapper {
ILogger mLogger = CMS.getLogger();
public LdapCrlIssuerCompsMap() {
@@ -46,30 +49,31 @@ public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
// via configuration
}
- /**
+ /**
* 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.
*
- * 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.
- *
- * @param baseDN The base DN.
+ * @param baseDN The base DN.
* @param dnComps Components to form the LDAP base dn for search.
* @param filterComps Components to form the LDAP search filter.
*/
public LdapCrlIssuerCompsMap(String baseDN, ObjectIdentifier[] dnComps,
- ObjectIdentifier[] filterComps) {
+ ObjectIdentifier[] filterComps) {
init(baseDN, dnComps, filterComps);
}
/**
* constructor using non-standard certificate attribute.
*/
- public LdapCrlIssuerCompsMap(String crlAttr, String baseDN,
- ObjectIdentifier[] dnComps, ObjectIdentifier[] filterComps) {
+ public LdapCrlIssuerCompsMap(String crlAttr, String baseDN,
+ ObjectIdentifier[] dnComps,
+ ObjectIdentifier[] filterComps) {
super(crlAttr, baseDN, dnComps, filterComps);
}
@@ -84,7 +88,7 @@ public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
public Vector getDefaultParams() {
Vector v = super.getDefaultParams();
- // v.addElement("crlAttr=" + LdapCrlPublisher.LDAP_CRL_ATTR);
+ //v.addElement("crlAttr=" + LdapCrlPublisher.LDAP_CRL_ATTR);
return v;
}
@@ -95,30 +99,35 @@ public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
}
protected void init(String baseDN, ObjectIdentifier[] dnComps,
- ObjectIdentifier[] filterComps) {
- // mLdapAttr = LdapCrlPublisher.LDAP_CRL_ATTR;
+ ObjectIdentifier[] filterComps) {
+ //mLdapAttr = LdapCrlPublisher.LDAP_CRL_ATTR;
super.init(baseDN, dnComps, filterComps);
}
/**
- * Maps a crl to LDAP entry. Uses issuer 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.
+ * Maps a crl to LDAP entry.
+ * Uses issuer 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.
*
* @param conn - the LDAP connection.
* @param obj - the X509Certificate.
* @return the result. LdapCertMapResult is also used for CRL.
- */
- public String map(LDAPConnection conn, Object obj) throws ELdapException {
+ */
+ public String
+ map(LDAPConnection conn, Object obj)
+ throws ELdapException {
if (conn == null)
return null;
X509CRLImpl crl = (X509CRLImpl) obj;
try {
String result = null;
- X500Name issuerDN = (X500Name) ((X509CRLImpl) crl).getIssuerDN();
+ X500Name issuerDN =
+ (X500Name) ((X509CRLImpl) crl).getIssuerDN();
CMS.debug("LdapCrlIssuerCompsMap: " + issuerDN.toString());
@@ -127,15 +136,14 @@ public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
result = super.map(conn, issuerDN, crlbytes);
return result;
} catch (CRLException e) {
- log(ILogger.LL_FAILURE,
- CMS.getLogMessage("PUBLISH_CANT_DECODE_CRL", e.toString()));
- throw new ELdapException(CMS.getUserMessage(
- "CMS_LDAP_GET_DER_ENCODED_CRL_FAILED", e.toString()));
+ log(ILogger.LL_FAILURE,
+ CMS.getLogMessage("PUBLISH_CANT_DECODE_CRL", e.toString()));
+ throw new ELdapException(CMS.getUserMessage("CMS_LDAP_GET_DER_ENCODED_CRL_FAILED", e.toString()));
}
}
public String map(LDAPConnection conn, IRequest req, Object obj)
- throws ELdapException {
+ throws ELdapException {
return map(conn, obj);
}
@@ -144,7 +152,8 @@ public class LdapCrlIssuerCompsMap extends LdapDNCompsMap implements
*/
private void log(int level, String msg) {
mLogger.log(ILogger.EV_SYSTEM, ILogger.S_LDAP, level,
- "LdapCrlCompsMap: " + msg);
+ "LdapCrlCompsMap: " + msg);
}
}
+