diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/dbs')
29 files changed, 504 insertions, 543 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/DBResources.java b/pki/base/common/src/com/netscape/certsrv/dbs/DBResources.java index 4bfb14fb..a2201b8e 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/DBResources.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/DBResources.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.util.ListResourceBundle; - /** * A class represents a resource bundle for DBS subsystem. * <P> - * + * * @version $Revision$, $Date$ */ public class DBResources extends ListResourceBundle { @@ -38,4 +36,3 @@ public class DBResources extends ListResourceBundle { static final Object[][] contents = {}; } - diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/EDBException.java b/pki/base/common/src/com/netscape/certsrv/dbs/EDBException.java index 14f653d6..77508dca 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/EDBException.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/EDBException.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import com.netscape.certsrv.base.EBaseException; - /** * A class represents a database exception. * <P> - * + * * @version $Revision$, $Date$ */ public class EDBException extends EBaseException { @@ -36,12 +34,12 @@ public class EDBException extends EBaseException { /** * Resource class name. */ - private static final String DB_RESOURCES = DBResources.class.getName(); + private static final String DB_RESOURCES = DBResources.class.getName(); /** * Constructs a database exception. * <P> - * + * * @param msgFormat message format */ public EDBException(String msgFormat) { @@ -51,7 +49,7 @@ public class EDBException extends EBaseException { /** * Constructs a database exception. * <P> - * + * * @param msgFormat message format * @param param parameter */ @@ -62,7 +60,7 @@ public class EDBException extends EBaseException { /** * Constructs a database exception. * <P> - * + * * @param msgFormat message format * @param e exception as parameter */ @@ -73,7 +71,7 @@ public class EDBException extends EBaseException { /** * Constructs a database exception. * <P> - * + * * @param msgFormat message format * @param params list of parameters */ diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/EDBNotAvailException.java b/pki/base/common/src/com/netscape/certsrv/dbs/EDBNotAvailException.java index 170a8ee8..6afb2dcc 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/EDBNotAvailException.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/EDBNotAvailException.java @@ -17,10 +17,9 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - /** * Indicates internal db is down. - * + * * @version $Revision$, $Date$ */ public class EDBNotAvailException extends EDBException { @@ -32,7 +31,7 @@ public class EDBNotAvailException extends EDBException { /** * Constructs a ldap server down exception with host & port info. - * + * * @param errorString Detailed error message. */ public EDBNotAvailException(String errorString) { diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/EDBRecordNotFoundException.java b/pki/base/common/src/com/netscape/certsrv/dbs/EDBRecordNotFoundException.java index 1640fc78..dd3880c1 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/EDBRecordNotFoundException.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/EDBRecordNotFoundException.java @@ -17,10 +17,9 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - /** * Indicates internal db is down. - * + * * @version $Revision$, $Date$ */ public class EDBRecordNotFoundException extends EDBException { @@ -32,7 +31,7 @@ public class EDBRecordNotFoundException extends EDBException { /** * Constructs a ldap server down exception with host & port info. - * + * * @param errorString Detailed error message. */ public EDBRecordNotFoundException(String errorString) { diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBAttrMapper.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBAttrMapper.java index 173537d6..27e15bd7 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBAttrMapper.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBAttrMapper.java @@ -17,21 +17,19 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.util.Enumeration; import netscape.ldap.LDAPAttributeSet; import com.netscape.certsrv.base.EBaseException; - /** * An interface represents an attribute mapper. A mapper * has knowledge on how to convert a db attribute into * zero or more LDAP attribute, and vice versa. * <P> - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBAttrMapper { @@ -39,44 +37,44 @@ public interface IDBAttrMapper { * Retrieves a list of LDAP attributes that are used * in the mapper. By having this, the framework can * provide search on selective attributes. - * + * * @return a list of supported attribute names */ public Enumeration<String> getSupportedLDAPAttributeNames(); /** * Maps object attribute into LDAP attributes. - * + * * @param parent parent object where the object comes from * @param name name of db attribute * @param obj object itself * @param attrs LDAP attribute set where the result should be stored * @exception EBaseException failed to map object */ - public void mapObjectToLDAPAttributeSet(IDBObj parent, - String name, Object obj, LDAPAttributeSet attrs) - throws EBaseException; + public void mapObjectToLDAPAttributeSet(IDBObj parent, + String name, Object obj, LDAPAttributeSet attrs) + throws EBaseException; /** - * Maps LDAP attributes into object, and puts the object + * Maps LDAP attributes into object, and puts the object * into 'parent'. - * + * * @param attrs LDAP attribute set * @param name name of db attribute to be processed * @param parent parent object where the object should be added * @exception EBaseException failed to map object */ - public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, - String name, IDBObj parent) throws EBaseException; + public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, + String name, IDBObj parent) throws EBaseException; /** * Maps search filters into LDAP search filter. - * + * * @param name name of db attribute * @param op filte operation (i.e. "=", ">=") * @param value attribute value * @exception EBaseException failed to map filter */ - public String mapSearchFilter(String name, String op, - String value) throws EBaseException; + public String mapSearchFilter(String name, String op, + String value) throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBDynAttrMapper.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBDynAttrMapper.java index c1c8c3b3..5684dd4d 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBDynAttrMapper.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBDynAttrMapper.java @@ -6,7 +6,7 @@ package com.netscape.certsrv.dbs; * assigned db attribute into zero or more dynamically assigned LDAP * attributes, and vice versa. * <P> - * + * * @version $Revision$, $Date$ */ public interface IDBDynAttrMapper extends IDBAttrMapper { @@ -14,7 +14,7 @@ public interface IDBDynAttrMapper extends IDBAttrMapper { /** * Returns true if the LDAP attribute can be mapped by this * dynamic mapper. - * + * * @param attrName LDAP attribute name to check * @return a list of supported attribute names */ diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBObj.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBObj.java index ab1ce0a4..5c634bee 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBObj.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBObj.java @@ -17,26 +17,24 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.util.Enumeration; import com.netscape.certsrv.base.IAttrSet; - /** * An interface represents a database object * that is serializable. - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBObj extends IAttrSet { /** - * Returns a list of serializable attribute + * Returns a list of serializable attribute * names. This method should return the * attribute name even if there is no attribute * value for the attribute. - * + * * @return a list of serializable attribute names */ public Enumeration<String> getSerializableAttrNames(); diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBRegistry.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBRegistry.java index 4270c9ce..241f3af9 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBRegistry.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBRegistry.java @@ -17,42 +17,40 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import netscape.ldap.LDAPAttributeSet; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.ISubsystem; - /** * A class represents a registry where all the - * schema (object classes and attribute) information + * schema (object classes and attribute) information * is stored. - * + * * Attribute mappers can be registered with this * registry. - * + * * Given the schema information stored, this registry * has knowledge to convert a Java object into a * LDAPAttributeSet or vice versa. - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBRegistry extends ISubsystem { /** * Registers object class. - * + * * @param className java class to create for the object classes * @param ldapNames a list of LDAP object classes * @exception EDBException failed to register */ public void registerObjectClass(String className, String ldapNames[]) - throws EDBException; + throws EDBException; /** * See if an object class is registered. - * + * * @param className java class to create * @return true if object class is registered already */ @@ -60,17 +58,17 @@ public interface IDBRegistry extends ISubsystem { /** * Registers attribute mapper. - * + * * @param ufName LDAP attribute name * @param mapper mapper to invoke for the attribute * @exception EDBException failed to register */ - public void registerAttribute(String ufName, IDBAttrMapper mapper) - throws EDBException; + public void registerAttribute(String ufName, IDBAttrMapper mapper) + throws EDBException; /** * See if an attribute is registered. - * + * * @param ufName attribute name * @return true if attribute is registered already */ @@ -78,6 +76,7 @@ public interface IDBRegistry extends ISubsystem { /** * Registers a dynamic attribute mapper. + * * @param mapper The dynamic mapper to register */ public void registerDynamicMapper(IDBDynAttrMapper mapper); @@ -86,6 +85,7 @@ public interface IDBRegistry extends ISubsystem { * Creates LDAP-based search filters with help of * registered mappers. * Parses filter from filter string specified in RFC1558. + * * <pre> * <filter> ::= '(' <filtercomp> ')' * <filtercomp> ::= <and> | <or> | <not> | <item> @@ -107,7 +107,7 @@ public interface IDBRegistry extends ISubsystem { * <starval> ::= NULL | <value> '*' <starval> * <final> ::= NULL | <value> * </pre> - * + * * @param filter CMS-based filter * @return LDAP-based filter string * @exception EBaseException failed to convert filter @@ -117,55 +117,55 @@ public interface IDBRegistry extends ISubsystem { /** * Creates LDAP-based search filters with help of * registered mappers. - * + * * @param filter CMS-based filter * @param c filter converter * @return LDAP-based filter string * @exception EBaseException failed to convert filter */ - public String getFilter(String filter, IFilterConverter c) - throws EBaseException; + public String getFilter(String filter, IFilterConverter c) + throws EBaseException; /** * Maps object into LDAP attribute set. - * + * * @param parent object's parent * @param name name of the object * @param obj object to be mapped * @param attrs LDAP attribute set * @exception EBaseException failed to map object */ - public void mapObject(IDBObj parent, String name, Object obj, - LDAPAttributeSet attrs) throws EBaseException; + public void mapObject(IDBObj parent, String name, Object obj, + LDAPAttributeSet attrs) throws EBaseException; /** * Retrieves a list of LDAP attributes that are associated * with the given attributes. - * + * * @param attrs attributes * @return LDAP-based attributes * @exception EBaseException failed to map attributes */ - public String[] getLDAPAttributes(String attrs[]) - throws EBaseException; + public String[] getLDAPAttributes(String attrs[]) + throws EBaseException; /** * Creates attribute set from object. - * + * * @param obj database object * @return LDAP attribute set * @exception EBaseException failed to create set */ - public LDAPAttributeSet createLDAPAttributeSet(IDBObj obj) - throws EBaseException; + public LDAPAttributeSet createLDAPAttributeSet(IDBObj obj) + throws EBaseException; /** * Creates object from attribute set. - * + * * @param attrs LDAP attribute set * @return database object * @exception EBaseException failed to create object */ public IDBObj createObject(LDAPAttributeSet attrs) - throws EBaseException; + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSSession.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSSession.java index 7f4e4f8c..ec019423 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSSession.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSSession.java @@ -17,45 +17,44 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import netscape.ldap.LDAPSearchResults; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.ISubsystem; - /** * An interface represents the database session. Operations * can be performed with a session. - * - * Transaction and Caching support can be integrated + * + * Transaction and Caching support can be integrated * into session. - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBSSession { /** * Returns database subsystem. - * + * * @return subsystem */ public ISubsystem getDBSubsystem(); /** * Closes this session. - * + * * @exception EDBException failed to close session */ public void close() throws EDBException; /** * Adds object to backend database. For example, + * * <PRE> - * session.add("cn=123459,o=certificate repository,o=airius.com", - * certRec); + * session.add("cn=123459,o=certificate repository,o=airius.com", + * certRec); * </PRE> - * + * * @param name name of the object * @param obj object to be added * @exception EDBException failed to add object @@ -64,7 +63,7 @@ public interface IDBSSession { /** * Reads an object from the database. - * + * * @param name name of the object that is to be read * @return database object * @exception EBaseException failed to read object @@ -74,18 +73,18 @@ public interface IDBSSession { /** * Reads an object from the database, and only populates * the selected attributes. - * + * * @param name name of the object that is to be read * @param attrs selected attributes * @return database object * @exception EBaseException failed to read object */ - public IDBObj read(String name, String attrs[]) - throws EBaseException; + public IDBObj read(String name, String attrs[]) + throws EBaseException; /** * Deletes object from database. - * + * * @param name name of the object that is to be deleted * @exception EBaseException failed to delete object */ @@ -93,43 +92,43 @@ public interface IDBSSession { /** * Modify an object in the database. - * + * * @param name name of the object that is to be modified * @param mods modifications * @exception EBaseException failed to modify */ - public void modify(String name, ModificationSet mods) - throws EBaseException; + public void modify(String name, ModificationSet mods) + throws EBaseException; /** - * Searchs for a list of objects that match the + * Searchs for a list of objects that match the * filter. - * + * * @param base starting point of the search * @param filter search filter * @return search results * @exception EBaseException failed to search */ - public IDBSearchResults search(String base, String filter) - throws EBaseException; + public IDBSearchResults search(String base, String filter) + throws EBaseException; /** - * Searchs for a list of objects that match the + * Searchs for a list of objects that match the * filter. - * + * * @param base starting point of the search * @param filter search filter * @param maxSize max number of entries * @return search results * @exception EBaseException failed to search */ - public IDBSearchResults search(String base, String filter, int maxSize) - throws EBaseException; + public IDBSearchResults search(String base, String filter, int maxSize) + throws EBaseException; /** - * Searchs for a list of objects that match the + * Searchs for a list of objects that match the * filter. - * + * * @param base starting point of the search * @param filter search filter * @param maxSize max number of entries @@ -137,25 +136,25 @@ public interface IDBSSession { * @return search results * @exception EBaseException failed to search */ - public IDBSearchResults search(String base, String filter, int maxSize, - int timeLimit) throws EBaseException; + public IDBSearchResults search(String base, String filter, int maxSize, + int timeLimit) throws EBaseException; /** - * Retrieves a list of object that satifies the given + * Retrieves a list of object that satifies the given * filter. - * + * * @param base starting point of the search * @param filter search filter * @param attrs selected attributes * @return search results * @exception EBaseException failed to search */ - public IDBSearchResults search(String base, String filter, - String attrs[]) throws EBaseException; + public IDBSearchResults search(String base, String filter, + String attrs[]) throws EBaseException; /** * Retrieves a list of objects. - * + * * @param base starting point of the search * @param filter search filter * @param attrs selected attributes @@ -163,12 +162,12 @@ public interface IDBSSession { * @exception EBaseException failed to search */ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, - String attrs[]) throws EBaseException; + String attrs[]) throws EBaseException; /** * Sets persistent search to retrieve modified * certificate records. - * + * * @param base starting point of the search * @param filter search filter * @param attrs selected attributes @@ -176,11 +175,11 @@ public interface IDBSSession { * @exception EBaseException failed to search */ public LDAPSearchResults persistentSearch(String base, String filter, - String attrs[]) throws EBaseException; + String attrs[]) throws EBaseException; /** * Retrieves a list of objects. - * + * * @param base starting point of the search * @param filter search filter * @param attrs selected attributes @@ -190,12 +189,12 @@ public interface IDBSSession { * @exception EBaseException failed to search */ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, - String attrs[], String sortKey, int pageSize) - throws EBaseException; + String attrs[], String sortKey, int pageSize) + throws EBaseException; /** * Retrieves a list of objects. - * + * * @param base starting point of the search * @param filter search filter * @param attrs selected attributes @@ -206,7 +205,7 @@ public interface IDBSSession { * @exception EBaseException failed to search */ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, - String attrs[], String startFrom, - String sortKey, int pageSize) - throws EBaseException; + String attrs[], String startFrom, + String sortKey, int pageSize) + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSearchResults.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSearchResults.java index 9f15b808..04736cf3 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSearchResults.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSearchResults.java @@ -17,29 +17,27 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.util.Enumeration; - /** * A class represents the search results. A search * results object contain a enumeration of * Java objects that are just read from the database. - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBSearchResults extends Enumeration<Object> { /** * Checks if any element is available. - * + * * @return true if there is more elements */ public boolean hasMoreElements(); /** * Retrieves next element. - * + * * @return next element */ public Object nextElement(); diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSubsystem.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSubsystem.java index 350a29c4..fec6e6af 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBSubsystem.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBSubsystem.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.math.BigInteger; import netscape.ldap.LDAPConnection; @@ -25,22 +24,19 @@ import netscape.ldap.LDAPConnection; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.ISubsystem; - /** * An interface represents certificate server * backend database. * <P> - * This interface separate the database subsystem - * functionalities from internal implementation. + * This interface separate the database subsystem functionalities from internal implementation. * <P> - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IDBSubsystem extends ISubsystem { public static final String SUB_ID = "dbs"; - // values for repos public static final int CERTS = 0; public static final int REQUESTS = 1; @@ -49,21 +45,21 @@ public interface IDBSubsystem extends ISubsystem { /** * Retrieves the base DN. - * + * * @return base DN of the subsystem */ public String getBaseDN(); /** * Retrieves the registry. - * + * * @return registry */ public IDBRegistry getRegistry(); /** * Creates a database session. - * + * * @return database session * @exception EDBException failed to create session */ @@ -71,145 +67,145 @@ public interface IDBSubsystem extends ISubsystem { /** * Avoids losing serial number. - * + * * @return true if serial number recovery option is enabled */ public boolean enableSerialNumberRecovery(); /** * Records next serial number in config file - * + * * @param serial next serial number - * @exception EBaseException failed to set + * @exception EBaseException failed to set */ public void setNextSerialConfig(BigInteger serial) throws EBaseException; /** * Gets the next serial number in config file - * + * * @return next serial number */ public BigInteger getNextSerialConfig(); /** * Records maximum serial number limit in config file - * + * * @param serial max serial number - * @param repo repo identifier - * @exception EBaseException failed to set + * @param repo repo identifier + * @exception EBaseException failed to set */ public void setMaxSerialConfig(int repo, String serial) throws EBaseException; /** * Records minimum serial number limit in config file - * + * * @param serial min serial number - * @param repo repo identifier - * @exception EBaseException failed to set + * @param repo repo identifier + * @exception EBaseException failed to set */ public void setMinSerialConfig(int repo, String serial) throws EBaseException; /** * Records maximum serial number limit for the next range in config file - * + * * @param serial max serial number - * @param repo repo identifier - * @exception EBaseException failed to set + * @param repo repo identifier + * @exception EBaseException failed to set */ public void setNextMaxSerialConfig(int repo, String serial) throws EBaseException; /** * Records minimum serial number limit for the next range in config file - * + * * @param serial min serial number - * @param repo repo identifier - * @exception EBaseException failed to set + * @param repo repo identifier + * @exception EBaseException failed to set */ public void setNextMinSerialConfig(int repo, String serial) throws EBaseException; /** * Gets minimum serial number limit in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return min serial number */ public String getMinSerialConfig(int repo); /** * Gets the maximum serial number limit in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return max serial number */ public String getMaxSerialConfig(int repo); /** * Gets the maximum serial number limit for next range in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return max serial number */ public String getNextMaxSerialConfig(int repo); /** * Gets minimum serial number limit for next range in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return min serial number */ public String getNextMinSerialConfig(int repo); - + /** * Gets low water mark limit in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return low water mark */ public String getLowWaterMarkConfig(int repo); - + /** * Gets range increment limit for next range in config file - * - * @param repo repo identifier + * + * @param repo repo identifier * @return range increment */ public String getIncrementConfig(int repo); - + /** * Gets number corresponding to start of next range from database - * - * @param repo repo identifier + * + * @param repo repo identifier * @return start of next range */ public String getNextRange(int repo); /** * Determines if a range conflict has been observed in database - * - * @param repo repo identifier + * + * @param repo repo identifier * @return true if range conflict, false otherwise */ public boolean hasRangeConflict(int repo); /** * Determines if serial number management has been enabled - * + * * @return true if enabled, false otherwise */ public boolean getEnableSerialMgmt(); - /** + /** * Sets whether serial number management is enabled for certs - * and requests. - * - * @param value true/false - * @exception EBaseException failed to set + * and requests. + * + * @param value true/false + * @exception EBaseException failed to set */ public void setEnableSerialMgmt(boolean value) throws EBaseException; /** * Returns LDAP connection to connection pool. - * + * * @param conn connection to be returned */ public void returnConn(LDAPConnection conn); diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IDBVirtualList.java b/pki/base/common/src/com/netscape/certsrv/dbs/IDBVirtualList.java index 7d175c45..919a82ef 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IDBVirtualList.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IDBVirtualList.java @@ -17,17 +17,15 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import com.netscape.certsrv.base.EBaseException; - /** * A interface represents a virtual list of search results. * Note that this class must be used with DS4.0. - * + * * @version $Revision$, $Date$ */ -public interface IDBVirtualList<E> { +public interface IDBVirtualList<E> { /** * Sets the paging size of this virtual list. @@ -42,7 +40,7 @@ public interface IDBVirtualList<E> { /** * Sets the sort key - * + * * @param sortKey the attribute to sort by * @exception EBaseException failed to set */ @@ -50,7 +48,7 @@ public interface IDBVirtualList<E> { /** * Sets the sort key - * + * * @param sortKeys the attributes to sort by * @exception EBaseException failed to set */ @@ -58,60 +56,61 @@ public interface IDBVirtualList<E> { /** * Retrieves the size of this virtual list. - * Recommend to call getSize() before getElementAt() or getElements() + * Recommend to call getSize() before getElementAt() or getElements() * since you'd better check if the index is out of bound first. - * + * * @return current size in list */ public int getSize(); /** * Returns current index. - * + * * @return current index */ public int getSizeBeforeJumpTo(); + public int getSizeAfterJumpTo(); public int getCurrentIndex(); - /** + /** * Get a page starting at "first" (although we may also fetch * some preceding entries) - * Recommend to call getSize() before getElementAt() or getElements() + * Recommend to call getSize() before getElementAt() or getElements() * since you'd better check if the index is out of bound first. - * + * * @param first the index of the first entry of the page you want to fetch */ public boolean getPage(int first); - /** + /** * Called by application to scroll the list with initial letters. * Consider text to be an initial substring of the attribute of the * primary sorting key(the first one specified in the sort key array) * of an entry. * If no entries match, the one just before(or after, if none before) * will be returned as mSelectedIndex - * + * * @param text the prefix of the first entry of the page you want to fetch */ public boolean getPage(String text); - /** + /** * Fetchs data of a single list item - * Recommend to call getSize() before getElementAt() or getElements() + * Recommend to call getSize() before getElementAt() or getElements() * since you'd better check if the index is out of bound first. - * If the index is out of range of the virtual list, an exception + * If the index is out of range of the virtual list, an exception * will be thrown and return null - * + * * @param index the index of the element to fetch */ public E getElementAt(int index); /** * Retrieves and jumps to element in the given position. - * + * * @param i position * @return object */ @@ -119,26 +118,26 @@ public interface IDBVirtualList<E> { /** * Processes elements as soon as it arrives. It is - * more memory-efficient. - * + * more memory-efficient. + * * @param startidx starting index * @param endidx ending index * @param ep object to call * @exception EBaseException failed to process elements */ public void processElements(int startidx, int endidx, IElementProcessor ep) - throws EBaseException; + throws EBaseException; - /** + /** * Gets the virutal selected index - * + * * @return selected index */ public int getSelectedIndex(); - /** + /** * Gets the top of the buffer - * + * * @return first index */ public int getFirstIndex(); diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IElementProcessor.java b/pki/base/common/src/com/netscape/certsrv/dbs/IElementProcessor.java index 75702199..648a13ae 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IElementProcessor.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IElementProcessor.java @@ -17,20 +17,18 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import com.netscape.certsrv.base.EBaseException; - /** * Processor handles object read from the session. - * + * * @version $Revision$, $Date$ */ public interface IElementProcessor { /** * Handles object - * + * * @param o object to be processed * @exception EBaseException failed to process object */ diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/IFilterConverter.java b/pki/base/common/src/com/netscape/certsrv/dbs/IFilterConverter.java index 1a078365..2c0ccb89 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/IFilterConverter.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/IFilterConverter.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - - - /** * An interface represents a filter converter * that understands how to convert a attribute * type from one defintion to another. - * For example, + * For example, + * * <PRE> * (1) database layer need to convert * registered attribute type to ldap attribute @@ -34,13 +32,13 @@ package com.netscape.certsrv.dbs; * attribute type. * </PRE> * - * @version $Revision$, $Date$ + * @version $Revision$, $Date$ */ public interface IFilterConverter { /** * Converts attribute into LDAP attribute. - * + * * @param attr attribute name * @param op attribute operation * @param value attribute value diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/Modification.java b/pki/base/common/src/com/netscape/certsrv/dbs/Modification.java index 9be75f0b..6c61bdb1 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/Modification.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/Modification.java @@ -17,14 +17,11 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - - - /** * A class represents a modification. This is used by the * database (dbs) framework for modification operations. * It specifices the modification type and values. - * + * * @version $Revision$, $Date$ */ public class Modification { @@ -50,7 +47,7 @@ public class Modification { /** * Constructs a role modification. - * + * * @param name attribute name * @param op attribute operation (i.e. MOD_ADD, MOD_DELETE, or MOD_REPLACE) * @param value attribute value @@ -63,7 +60,7 @@ public class Modification { /** * Retrieves attribute name. - * + * * @return attribute name */ public String getName() { @@ -72,7 +69,7 @@ public class Modification { /** * Retrieves modification operation type. - * + * * @return modification type */ public int getOp() { @@ -81,7 +78,7 @@ public class Modification { /** * Retrieves attribute value. - * + * * @return attribute value */ public Object getValue() { diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/ModificationSet.java b/pki/base/common/src/com/netscape/certsrv/dbs/ModificationSet.java index b737f861..70e9b377 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/ModificationSet.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/ModificationSet.java @@ -17,15 +17,13 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs; - import java.util.Enumeration; import java.util.Vector; - /** * A class represents a modification set. A modification * set contains zero or more modifications. - * + * * @version $Revision$, $Date$ */ public class ModificationSet { @@ -43,7 +41,7 @@ public class ModificationSet { /** * Adds modification to this set. - * + * * @param name attribute name * @param op modification operation * @param value attribute value @@ -54,7 +52,7 @@ public class ModificationSet { /** * Retrieves a list of modifications. - * + * * @return a list of Modifications */ public Enumeration<Modification> getModifications() { diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecord.java b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecord.java index 681e586b..d05c9ed5 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecord.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecord.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.certdb; - import java.math.BigInteger; import java.util.Date; @@ -26,10 +25,9 @@ import netscape.security.x509.X509CertImpl; import com.netscape.certsrv.base.MetaInfo; import com.netscape.certsrv.dbs.IDBObj; - /** * An interface contains constants for certificate record. - * + * * @version $Revision$, $Date$ */ public interface ICertRecord extends IDBObj { @@ -71,108 +69,108 @@ public interface ICertRecord extends IDBObj { public final static String X509CERT_DURATION = "duration"; public final static String X509CERT_EXTENSION = "extension"; public final static String X509CERT_SUBJECT = "subject"; - public final static String X509CERT_PUBLIC_KEY_DATA ="publicKeyData"; + public final static String X509CERT_PUBLIC_KEY_DATA = "publicKeyData"; public final static String X509CERT_VERSION = "version"; public final static String X509CERT_ALGORITHM = "algorithm"; public final static String X509CERT_SIGNING_ALGORITHM = "signingAlgorithm"; public final static String X509CERT_SERIAL_NUMBER = "serialNumber"; /* attribute type used the following with search filter */ - public final static String ATTR_X509CERT_NOT_BEFORE = - ATTR_X509CERT + "." + X509CERT_NOT_BEFORE; - public final static String ATTR_X509CERT_NOT_AFTER = - ATTR_X509CERT + "." + X509CERT_NOT_AFTER; - public final static String ATTR_X509CERT_DURATION = - ATTR_X509CERT + "." + X509CERT_DURATION; - public final static String ATTR_X509CERT_EXTENSION = - ATTR_X509CERT + "." + X509CERT_EXTENSION; - public final static String ATTR_X509CERT_SUBJECT = - ATTR_X509CERT + "." + X509CERT_SUBJECT; - public final static String ATTR_X509CERT_VERSION = - ATTR_X509CERT + "." + X509CERT_VERSION; - public final static String ATTR_X509CERT_ALGORITHM = - ATTR_X509CERT + "." + X509CERT_ALGORITHM; - public final static String ATTR_X509CERT_SIGNING_ALGORITHM = - ATTR_X509CERT + "." + X509CERT_SIGNING_ALGORITHM; - public final static String ATTR_X509CERT_SERIAL_NUMBER = - ATTR_X509CERT + "." + X509CERT_SERIAL_NUMBER; - public final static String ATTR_X509CERT_PUBLIC_KEY_DATA = - ATTR_X509CERT + "." + X509CERT_PUBLIC_KEY_DATA; + public final static String ATTR_X509CERT_NOT_BEFORE = + ATTR_X509CERT + "." + X509CERT_NOT_BEFORE; + public final static String ATTR_X509CERT_NOT_AFTER = + ATTR_X509CERT + "." + X509CERT_NOT_AFTER; + public final static String ATTR_X509CERT_DURATION = + ATTR_X509CERT + "." + X509CERT_DURATION; + public final static String ATTR_X509CERT_EXTENSION = + ATTR_X509CERT + "." + X509CERT_EXTENSION; + public final static String ATTR_X509CERT_SUBJECT = + ATTR_X509CERT + "." + X509CERT_SUBJECT; + public final static String ATTR_X509CERT_VERSION = + ATTR_X509CERT + "." + X509CERT_VERSION; + public final static String ATTR_X509CERT_ALGORITHM = + ATTR_X509CERT + "." + X509CERT_ALGORITHM; + public final static String ATTR_X509CERT_SIGNING_ALGORITHM = + ATTR_X509CERT + "." + X509CERT_SIGNING_ALGORITHM; + public final static String ATTR_X509CERT_SERIAL_NUMBER = + ATTR_X509CERT + "." + X509CERT_SERIAL_NUMBER; + public final static String ATTR_X509CERT_PUBLIC_KEY_DATA = + ATTR_X509CERT + "." + X509CERT_PUBLIC_KEY_DATA; /** * Retrieves serial number from stored certificate. - * + * * @return certificate serial number */ public BigInteger getCertificateSerialNumber(); /** * Retrieves serial number from certificate record. - * + * * @return certificate serial number */ public BigInteger getSerialNumber(); /** * Retrieves certificate from certificate record. - * + * * @return certificate */ public X509CertImpl getCertificate(); /** * Retrieves name of who issued this certificate. - * + * * @return name of who issued this certificate */ public String getIssuedBy(); /** * Retrieves name of who revoked this certificate. - * + * * @return name of who revoked this certificate */ public String getRevokedBy(); /** * Retrieves date when this certificate was revoked. - * + * * @return date when this certificate was revoked */ public Date getRevokedOn(); /** * Retrieves meta info. - * + * * @return meta info */ public MetaInfo getMetaInfo(); /** * Retrieves certificate status. - * + * * @return certificate status */ public String getStatus(); /** * Retrieves time of creation of this certificate record. - * + * * @return time of creation of this certificate record */ public Date getCreateTime(); /** * Retrieves time of modification of this certificate record. - * + * * @return time of modification of this certificate record */ public Date getModifyTime(); /** * Retrieves revocation info. - * + * * @return revocation info */ public IRevocationInfo getRevocationInfo(); -} +} diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecordList.java b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecordList.java index 616bd5db..5db7e473 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecordList.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertRecordList.java @@ -17,74 +17,72 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.certdb; - import java.util.Enumeration; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.IElementProcessor; - /** * A class represents a list of certificate records. * <P> - * + * * @version $Revision$, $Date$ */ public interface ICertRecordList { /** * Gets the current index. - * + * * @return current index */ public int getCurrentIndex(); /** * Retrieves the size of request list. - * + * * @return size */ public int getSize(); /** * Gets size before jump to index. - * + * * @return size */ public int getSizeBeforeJumpTo(); /** * Gets size after jump to index. - * + * * @return size */ public int getSizeAfterJumpTo(); /** * Process certificate record as soon as it is returned. - * + * * @param startidx starting index * @param endidx ending index * @param ep element processor * @exception EBaseException failed to process cert records */ public void processCertRecords(int startidx, int endidx, - IElementProcessor ep) throws EBaseException; + IElementProcessor ep) throws EBaseException; /** * Retrieves requests. * It's no good to call this if you didnt check * if the startidx, endidx are valid. - * + * * @param startidx starting index * @param endidx ending index * @exception EBaseException failed to retrieve */ public Enumeration getCertRecords(int startidx, int endidx) - throws EBaseException; + throws EBaseException; /** - * Gets one single record at a time similar to + * Gets one single record at a time similar to * processCertRecords but no extra class needed. * * @param index position of the record to be retrieved @@ -92,5 +90,5 @@ public interface ICertRecordList { * @exception EBaseException failed to retrieve */ public ICertRecord getCertRecord(int index) - throws EBaseException; + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertificateRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertificateRepository.java index b913a18c..e354970b 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertificateRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/ICertificateRepository.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.certdb; - import java.math.BigInteger; import java.security.cert.Certificate; import java.util.Date; @@ -32,12 +31,11 @@ import com.netscape.certsrv.base.MetaInfo; import com.netscape.certsrv.dbs.ModificationSet; import com.netscape.certsrv.dbs.repository.IRepository; - /** - * An interface represents a CMS certificate repository. + * An interface represents a CMS certificate repository. * It stores all the issued certificate. * <P> - * + * * @version $Revision$, $Date$ */ public interface ICertificateRepository extends IRepository { @@ -47,142 +45,143 @@ public interface ICertificateRepository extends IRepository { * record contains four parts: certificate, meta-attributes, * issue information and reovcation information. * <P> - * + * * @param record X.509 certificate * @exception EBaseException failed to add new certificate to - * the repository + * the repository */ public void addCertificateRecord(ICertRecord record) - throws EBaseException; + throws EBaseException; /** * Reads the certificate identified by the given serial no. - * + * * @param serialNo serial number of certificate * @return certificate * @exception EBaseException failed to retrieve certificate */ public X509CertImpl getX509Certificate(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Reads certificate from repository. - * + * * @param serialNo serial number of certificate * @return certificate record * @exception EBaseException failed to retrieve certificate */ public ICertRecord readCertificateRecord(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Sets certificate status update internal - * + * * @param requestRepo request repository * @param interval update interval * @param listenToCloneModifications enable listening to clone modifications */ - public void setCertStatusUpdateInterval(IRepository requestRepo, - int interval, - boolean listenToCloneModifications); + public void setCertStatusUpdateInterval(IRepository requestRepo, + int interval, + boolean listenToCloneModifications); /** * Updates certificate status now. This is a blocking method. - * + * * @exception EBaseException failed to update */ public void updateCertStatus() throws EBaseException; /** * Modifies certificate record. - * + * * @param serialNo serial number of record * @param mods modifications * @exception EBaseException failed to modify */ public void modifyCertificateRecord(BigInteger serialNo, - ModificationSet mods) throws EBaseException; + ModificationSet mods) throws EBaseException; /** * Checks if the certificate exists in this repository. - * + * * @param serialNo serial number of certificate * @return true if it exists * @exception EBaseException failed to check */ public boolean containsCertificate(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Deletes certificate from this repository. - * + * * @param serialNo serial number of certificate * @exception EBaseException failed to delete */ public void deleteCertificateRecord(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Marks certificate as revoked. - * + * * @param id serial number * @param info revocation information * @exception EBaseException failed to mark */ public void markAsRevoked(BigInteger id, IRevocationInfo info) - throws EBaseException; + throws EBaseException; /** * Updates certificate status. - * + * * @param id serial number * @param status certificate status * @exception EBaseException failed to update status */ public void updateStatus(BigInteger id, String status) - throws EBaseException; + throws EBaseException; /** * Marks certificate as renewable. - * + * * @param record certificate record to modify * @exception EBaseException failed to update */ public void markCertificateAsRenewable(ICertRecord record) - throws EBaseException; + throws EBaseException; /** * Marks certificate as not renewable. - * + * * @param record certificate record to modify * @exception EBaseException failed to update */ public void markCertificateAsNotRenewable(ICertRecord record) - throws EBaseException; + throws EBaseException; /** * Marks certificate as renewed. - * + * * @param serialNo certificate record to modify * @exception EBaseException failed to update */ public void markCertificateAsRenewed(String serialNo) - throws EBaseException; + throws EBaseException; /** * Marks certificate as renewed and notified. - * + * * @param serialNo certificate record to modify * @exception EBaseException failed to update */ public void markCertificateAsRenewalNotified(String serialNo) - throws EBaseException; + throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. * Here is a list of filter * attribute can be used: + * * <pre> * certRecordId * certMetaInfo @@ -193,37 +192,39 @@ public interface ICertificateRepository extends IRepository { * x509Cert.notAfter * x509Cert.subject * </pre> + * * The filter should follow RFC1558 LDAP filter syntax. * For example, + * * <pre> * (&(certRecordId=5)(x509Cert.notBefore=934398398)) * </pre> - * + * * @param filter search filter * @param maxSize max size to return * @return a list of certificates * @exception EBaseException failed to search */ public Enumeration searchCertificates(String filter, int maxSize) - throws EBaseException; + throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. - * + * * @param filter search filter * @param maxSize max size to return * @param timeLimit timeout value * @return a list of certificates * @exception EBaseException failed to search */ - public Enumeration searchCertificates(String filter, int maxSize, - int timeLimit) throws EBaseException; + public Enumeration searchCertificates(String filter, int maxSize, + int timeLimit) throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. - * + * * @param filter search filter * @param attrs selected attribute * @param pageSize page size @@ -231,12 +232,12 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to search */ public ICertRecordList findCertRecordsInList(String filter, - String attrs[], int pageSize) throws EBaseException; + String attrs[], int pageSize) throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. - * + * * @param filter search filter * @param attrs selected attribute * @param sortKey key to use for sorting the returned elements @@ -245,13 +246,13 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to search */ public ICertRecordList findCertRecordsInList(String filter, - String attrs[], String sortKey, int pageSize) - throws EBaseException; + String attrs[], String sortKey, int pageSize) + throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. - * + * * @param filter search filter * @param attrs selected attribute * @param jumpTo jump to index @@ -261,17 +262,17 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to search */ public ICertRecordList findCertRecordsInList(String filter, - String attrs[], String jumpTo, String sortKey, int pageSize) - throws EBaseException; + String attrs[], String jumpTo, String sortKey, int pageSize) + throws EBaseException; public ICertRecordList findCertRecordsInList(String filter, - String attrs[], String jumpTo, boolean hardJumpTo, String sortKey, int pageSize) - throws EBaseException; + String attrs[], String jumpTo, boolean hardJumpTo, String sortKey, int pageSize) + throws EBaseException; /** * Finds a list of certificate records that satisifies * the filter. - * + * * @param filter search filter * @param attrs selected attribute * @param jumpTo jump to index @@ -281,8 +282,8 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to search */ public ICertRecordList findCertRecordsInListRawJumpto(String filter, - String attrs[], String jumpTo, String sortKey, int pageSize) - throws EBaseException; + String attrs[], String jumpTo, String sortKey, int pageSize) + throws EBaseException; public static final int ALL_CERTS = 0; public static final int ALL_VALID_CERTS = 1; @@ -291,110 +292,110 @@ public interface ICertificateRepository extends IRepository { /** * Gets all valid and unexpired certificates pertaining * to a subject DN. - * - * @param subjectDN The distinguished name of the subject. - * @param validityType The type of certificatese to retrieve. + * + * @param subjectDN The distinguished name of the subject. + * @param validityType The type of certificatese to retrieve. * @return An array of certificates. * @throws EBaseException on error. */ public X509CertImpl[] getX509Certificates(String subjectDN, - int validityType) throws EBaseException; + int validityType) throws EBaseException; /** * Retrieves all the revoked certificates that have not expired. - * + * * @param asOfDate as of date * @return a list of revoked certificates * @exception EBaseException failed to retrieve */ public Enumeration getRevokedCertificates(Date asOfDate) - throws EBaseException; + throws EBaseException; /** * Retrieves all revoked certificates including ones that have expired * or that are not yet valid. - * + * * @return a list of revoked certificates * @exception EBaseException failed to search */ public Enumeration getAllRevokedCertificates() - throws EBaseException; + throws EBaseException; /** * Retrieves all revoked but not expired certificates. - * + * * @return a list of revoked certificates * @exception EBaseException failed to search */ public Enumeration getAllRevokedNonExpiredCertificates() - throws EBaseException; + throws EBaseException; /** - * Finds all certificates given a filter. - * + * Finds all certificates given a filter. + * * @param filter search filter * @return a list of certificates * @exception EBaseException failed to search */ public Enumeration findCertificates(String filter) - throws EBaseException; + throws EBaseException; /** * Finds all certificate records given a filter. - * + * * @param filter search filter * @return a list of certificates * @exception EBaseException failed to search */ public Enumeration findCertRecords(String filter) - throws EBaseException; + throws EBaseException; /** - * Gets Revoked certs orderes by noAfter date, jumps to records + * Gets Revoked certs orderes by noAfter date, jumps to records * where notAfter date is greater than current. - * + * * @param date reference date * @param pageSize page size * @return a list of certificate records * @exception EBaseException failed to retrieve */ - public ICertRecordList getRevokedCertsByNotAfterDate(Date date, - int pageSize) throws EBaseException; + public ICertRecordList getRevokedCertsByNotAfterDate(Date date, + int pageSize) throws EBaseException; /** - * Gets Invalid certs orderes by noAfter date, jumps to records + * Gets Invalid certs orderes by noAfter date, jumps to records * where notAfter date is greater than current. - * + * * @param date reference date * @param pageSize page size * @return a list of certificate records * @exception EBaseException failed to retrieve */ - public ICertRecordList getInvalidCertsByNotBeforeDate(Date date, - int pageSize) throws EBaseException; + public ICertRecordList getInvalidCertsByNotBeforeDate(Date date, + int pageSize) throws EBaseException; /** - * Gets valid certs orderes by noAfter date, jumps to records + * Gets valid certs orderes by noAfter date, jumps to records * where notAfter date is greater than current. - * + * * @param date reference date * @param pageSize page size * @return a list of certificate records * @exception EBaseException failed to retrieve */ - public ICertRecordList getValidCertsByNotAfterDate(Date date, - int pageSize) throws EBaseException; + public ICertRecordList getValidCertsByNotAfterDate(Date date, + int pageSize) throws EBaseException; /** * Creates certificate record. - * + * * @param id serial number * @param cert certificate * @param meta meta information * @return certificate record */ - public ICertRecord createCertRecord(BigInteger id, - Certificate cert, MetaInfo meta); + public ICertRecord createCertRecord(BigInteger id, + Certificate cert, MetaInfo meta); /** * Finds certificate records. @@ -404,21 +405,21 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to retrieve cert records */ public Enumeration findCertRecs(String filter) - throws EBaseException; + throws EBaseException; /** * Retrieves renewable certificates. - * + * * @param renewalTime renewal time * @return certificates * @exception EBaseException failed to retrieve */ public Hashtable getRenewableCertificates(String renewalTime) - throws EBaseException; + throws EBaseException; /** * Unmark a revoked certificates. - * + * * @param id serial number * @param info revocation information * @param revokedOn revocation date @@ -426,85 +427,85 @@ public interface ICertificateRepository extends IRepository { * @exception EBaseException failed to unmark */ public void unmarkRevoked(BigInteger id, IRevocationInfo info, - Date revokedOn, String revokedBy) - throws EBaseException; + Date revokedOn, String revokedBy) + throws EBaseException; /** * Retrieves valid and not published certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getValidNotPublishedCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves expired and published certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getExpiredPublishedCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves revoked and published certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getRevokedPublishedCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves valid certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getValidCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves expired certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getExpiredCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves revoked certificates. - * + * * @param from starting serial number * @param to ending serial number * @return a list of certificates * @exception EBaseException failed to retrieve */ public Enumeration getRevokedCertificates(String from, String to) - throws EBaseException; + throws EBaseException; /** * Retrieves modified certificate records. - * + * * @param entry LDAPEntry with modified data */ - public void getModifications(LDAPEntry entry); + public void getModifications(LDAPEntry entry); /** * Removes certificate records with this repository. - * + * * @param beginS BigInteger with radix 16 * @param endS BigInteger with radix 16 */ diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/IRevocationInfo.java b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/IRevocationInfo.java index 2086cacb..fb773576 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/certdb/IRevocationInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/certdb/IRevocationInfo.java @@ -17,32 +17,30 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.certdb; - import java.util.Date; import netscape.security.x509.CRLExtensions; - /** * A class represents a certificate revocation info. This - * object is written as an attribute of certificate record + * object is written as an attribute of certificate record * which essentially signifies a revocation act. * <P> - * + * * @version $Revision$, $Date$ */ public interface IRevocationInfo { /** * Retrieves revocation date. - * + * * @return revocation date */ public Date getRevocationDate(); /** * Retrieves CRL entry extensions. - * + * * @return CRL entry extensions */ public CRLExtensions getCRLEntryExtensions(); diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLIssuingPointRecord.java b/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLIssuingPointRecord.java index 78acced0..b990bbf5 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLIssuingPointRecord.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLIssuingPointRecord.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.crldb; - import java.math.BigInteger; import java.util.Date; import java.util.Hashtable; @@ -26,11 +25,10 @@ import netscape.security.x509.RevokedCertificate; import com.netscape.certsrv.dbs.IDBObj; - /** * An interface that defines abilities of * a CRL issuing point record. - * + * * @version $Revision$, $Date$ */ public interface ICRLIssuingPointRecord extends IDBObj { @@ -52,111 +50,112 @@ public interface ICRLIssuingPointRecord extends IDBObj { public static final String ATTR_DELTA_CRL = "deltaRevocationList"; public static final String CLEAN_CACHE = "-1"; - public static final String NEW_CACHE = "-2"; + public static final String NEW_CACHE = "-2"; /** * Retrieve unique CRL identifier. - * + * * @return unique CRL identifier */ public String getId(); /** * Retrieves current CRL number out of CRL issuing point record. - * + * * @return current CRL number */ public BigInteger getCRLNumber(); /** * Retrieves CRL size measured by the number of entries. - * + * * @return CRL size */ public Long getCRLSize(); /** * Retrieves this update time. - * + * * @return time of this update */ public Date getThisUpdate(); /** * Retrieves next update time. - * + * * @return time of next update */ public Date getNextUpdate(); /** * Retrieves current delta CRL number out of CRL issuing point record. - * + * * @return current delta CRL number */ public BigInteger getDeltaCRLNumber(); /** * Retrieves delta CRL size measured by the number of entries. - * + * * @return delta CRL size */ public Long getDeltaCRLSize(); /** * Retrieve Retrieve reference to the first unsaved data. - * + * * @return reference to the first unsaved data */ public String getFirstUnsaved(); /** * Retrieves encoded CRL. - * + * * @return encoded CRL */ public byte[] getCRL(); /** * Retrieves encoded delta CRL. - * + * * @return encoded delta CRL */ public byte[] getDeltaCRL(); /** * Retrieves encoded CA certificate. - * + * * @return encoded CA certificate */ public byte[] getCACert(); /** * Retrieves cache information about CRL. - * + * * @return list of recently revoked certificates */ - public Hashtable<BigInteger,RevokedCertificate> getCRLCacheNoClone(); - public Hashtable<BigInteger,RevokedCertificate> getCRLCache(); + public Hashtable<BigInteger, RevokedCertificate> getCRLCacheNoClone(); + + public Hashtable<BigInteger, RevokedCertificate> getCRLCache(); /** * Retrieves cache information about revoked certificates. - * + * * @return list of recently revoked certificates */ - public Hashtable<BigInteger,RevokedCertificate> getRevokedCerts(); + public Hashtable<BigInteger, RevokedCertificate> getRevokedCerts(); /** * Retrieves cache information about certificates released from hold. - * + * * @return list of certificates recently released from hold */ - public Hashtable<BigInteger,RevokedCertificate> getUnrevokedCerts(); + public Hashtable<BigInteger, RevokedCertificate> getUnrevokedCerts(); /** * Retrieves cache information about expired certificates. - * + * * @return list of recently expired certificates */ - public Hashtable<BigInteger,RevokedCertificate> getExpiredCerts(); + public Hashtable<BigInteger, RevokedCertificate> getExpiredCerts(); } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLRepository.java index ba245bcf..b58a6e38 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/crldb/ICRLRepository.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.crldb; - import java.math.BigInteger; import java.util.Date; import java.util.Hashtable; @@ -26,27 +25,26 @@ import java.util.Vector; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.ModificationSet; - /** - * An interface represents a CMS CRL repository. It stores + * An interface represents a CMS CRL repository. It stores * all the CRL issuing points. - * + * * @version $Revision$, $Date$ */ public interface ICRLRepository { /** * Adds CRL issuing point record. - * + * * @param rec issuing point record * @exception EBaseException failed to add new issuing point record */ public void addCRLIssuingPointRecord(ICRLIssuingPointRecord rec) - throws EBaseException; + throws EBaseException; /** * Retrieves all the issuing points' names. - * + * * @return A list of issuing points' names. * @exception EBaseException failed to retrieve all the issuing points' names. */ @@ -54,35 +52,35 @@ public interface ICRLRepository { /** * Reads issuing point record. - * + * * @return issuing point record * @exception EBaseException failed to read issuing point record */ public ICRLIssuingPointRecord readCRLIssuingPointRecord(String id) - throws EBaseException; + throws EBaseException; /** * Deletes issuing point record. - * + * * @param id issuing point record id * @exception EBaseException failed to delete issuing point record */ public void deleteCRLIssuingPointRecord(String id) - throws EBaseException; + throws EBaseException; /** * Modifies issuing point record. - * + * * @param id issuing point record id * @param mods set of modifications * @exception EBaseException failed to modify issuing point record */ public void modifyCRLIssuingPointRecord(String id, ModificationSet mods) - throws EBaseException; + throws EBaseException; /** * Updates CRL issuing point record. - * + * * @param id issuing point record id * @param newCRL encoded binary CRL * @param thisUpdate time of this update @@ -92,12 +90,12 @@ public interface ICRLRepository { * @exception EBaseException failed to update issuing point record */ public void updateCRLIssuingPointRecord(String id, byte[] newCRL, - Date thisUpdate, Date nextUpdate, BigInteger crlNumber, Long crlSize) - throws EBaseException; + Date thisUpdate, Date nextUpdate, BigInteger crlNumber, Long crlSize) + throws EBaseException; /** * Updates CRL issuing point record. - * + * * @param id issuing point record id * @param newCRL encoded binary CRL * @param thisUpdate time of this update @@ -110,34 +108,34 @@ public interface ICRLRepository { * @exception EBaseException failed to update issuing point record */ public void updateCRLIssuingPointRecord(String id, byte[] newCRL, - Date thisUpdate, Date nextUpdate, BigInteger crlNumber, Long crlSize, - Hashtable revokedCerts, Hashtable unrevokedCerts, Hashtable expiredCerts) - throws EBaseException; + Date thisUpdate, Date nextUpdate, BigInteger crlNumber, Long crlSize, + Hashtable revokedCerts, Hashtable unrevokedCerts, Hashtable expiredCerts) + throws EBaseException; /** * Updates CRL issuing point record. - * + * * @param id issuing point record id * @param revokedCerts list of revoked certificates * @param unrevokedCerts list of released from hold certificates * @exception EBaseException failed to update issuing point record */ public void updateRevokedCerts(String id, Hashtable revokedCerts, Hashtable unrevokedCerts) - throws EBaseException; + throws EBaseException; /** * Updates CRL issuing point record. - * + * * @param id issuing point record id * @param expiredCerts list of expired certificates * @exception EBaseException failed to update issuing point record */ public void updateExpiredCerts(String id, Hashtable expiredCerts) - throws EBaseException; + throws EBaseException; /** * Updates CRL issuing point record. - * + * * @param id issuing point record id * @param crlSize CRL size * @param revokedCerts list of revoked certificates @@ -146,14 +144,14 @@ public interface ICRLRepository { * @exception EBaseException failed to update issuing point record */ public void updateCRLCache(String id, Long crlSize, - Hashtable revokedCerts, - Hashtable unrevokedCerts, - Hashtable expiredCerts) - throws EBaseException; + Hashtable revokedCerts, + Hashtable unrevokedCerts, + Hashtable expiredCerts) + throws EBaseException; /** * Updates CRL issuing point record with delta-CRL. - * + * * @param id issuing point record id * @param deltaCRLNumber delta CRL number * @param deltaCRLSize delta CRL size @@ -164,16 +162,16 @@ public interface ICRLRepository { public void updateDeltaCRL(String id, BigInteger deltaCRLNumber, Long deltaCRLSize, Date nextUpdate, byte[] deltaCRL) - throws EBaseException; + throws EBaseException; /** * Updates CRL issuing point record with reference to the first * unsaved data. - * + * * @param id issuing point record id * @param firstUnsaved reference to the first unsaved data * @exception EBaseException failed to update issuing point record */ public void updateFirstUnsaved(String id, String firstUnsaved) - throws EBaseException; + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java index 0edcc187..010661d8 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java @@ -17,16 +17,14 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.math.BigInteger; import java.util.Date; import com.netscape.certsrv.base.EBaseException; - /** * An interface contains constants for key record. - * + * * @version $Revision$, $Date$ */ public interface IKeyRecord { @@ -42,15 +40,15 @@ public interface IKeyRecord { public static final String ATTR_MODIFY_TIME = "keyModifyTime"; public static final String ATTR_META_INFO = "keyMetaInfo"; public static final String ATTR_ARCHIVED_BY = "keyArchivedBy"; - + // key state public static final String STATUS_ANY = "ANY"; public static final String STATUS_VALID = "VALID"; public static final String STATUS_INVALID = "INVALID"; - + /** * Retrieves the state of the key. - * + * * @return key state * @exception EBaseException failed to retrieve state of the key */ @@ -58,15 +56,15 @@ public interface IKeyRecord { /** * Retrieves key identifier. - * + * * @return key id * @exception EBaseException failed to retrieve key id */ - public BigInteger getSerialNumber() throws EBaseException; + public BigInteger getSerialNumber() throws EBaseException; /** * Retrieves key owner name. - * + * * @return key owner name * @exception EBaseException failed to retrieve key owner name */ @@ -74,53 +72,53 @@ public interface IKeyRecord { /** * Retrieves key algorithm. - * + * * @return key algorithm */ - public String getAlgorithm(); + public String getAlgorithm(); /** * Retrieves key length. - * + * * @return key length * @exception EBaseException failed to retrieve key length */ - public Integer getKeySize() throws EBaseException; + public Integer getKeySize() throws EBaseException; /** * Retrieves archiver identifier. - * + * * @return archiver uid */ - public String getArchivedBy(); + public String getArchivedBy(); /** * Retrieves creation time. - * + * * @return creation time */ - public Date getCreateTime(); + public Date getCreateTime(); /** * Retrieves last modification time. - * + * * @return modification time */ - public Date getModifyTime(); + public Date getModifyTime(); /** * Retrieves dates of recovery. - * + * * @return recovery history * @exception EBaseException failed to retrieve recovery history */ - public Date[] getDateOfRevocation() throws EBaseException; + public Date[] getDateOfRevocation() throws EBaseException; /** * Retrieves public key data. - * + * * @return public key data * @exception EBaseException failed to retrieve public key data */ public byte[] getPublicKeyData() throws EBaseException; -} +} diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java index 5da23945..75f83389 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java @@ -17,35 +17,33 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.util.Enumeration; import com.netscape.certsrv.base.EBaseException; - /** * A class represents a list of key records. * <P> - * + * * @version $Revision$, $Date$ */ public interface IKeyRecordList { /** - * Retrieves the size of key list. - * + * Retrieves the size of key list. + * * @return size of key list */ public int getSize(); /** * Retrieves key records. - * + * * @param startidx start index * @param endidx end index * @return key records * @exception EBaseException failed to retrieve key records */ public Enumeration<IKeyRecord> getKeyRecords(int startidx, int endidx) - throws EBaseException; + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java index 093bea25..ca1e2c8a 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.math.BigInteger; import java.security.PublicKey; import java.util.Enumeration; @@ -28,12 +27,11 @@ import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.ModificationSet; import com.netscape.certsrv.dbs.repository.IRepository; - /** - * An interface represents a Key repository. This is the + * An interface represents a Key repository. This is the * container of archived keys. * <P> - * + * * @version $Revision$, $Date$ */ public interface IKeyRepository extends IRepository { @@ -41,7 +39,7 @@ public interface IKeyRepository extends IRepository { /** * Archives a key to the repository. * <P> - * + * * @param record key record * @exception EBaseException failed to archive key */ @@ -50,61 +48,61 @@ public interface IKeyRepository extends IRepository { /** * Reads an archived key by serial number. * <P> - * + * * @param serialNo serial number * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Reads an archived key by b64 encoded cert. * <P> - * + * * @param cert b64 encoded cert * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(String cert) - throws EBaseException; + throws EBaseException; /** * Reads an archived key by owner name. * <P> - * + * * @param ownerName owner name * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(X500Name ownerName) - throws EBaseException; + throws EBaseException; /** * Reads archived key using public key. - * - * @param publicKey public key that is corresponding - * to the private key + * + * @param publicKey public key that is corresponding + * to the private key * @return key record * @exception EBaseException failed to read key */ public IKeyRecord readKeyRecord(PublicKey publicKey) - throws EBaseException; + throws EBaseException; /** * Searches for private keys. - * + * * @param filter LDAP filter for the search * @param maxSize maximium number of entries to be returned * @return a list of private key records * @exception EBaseException failed to search keys */ public Enumeration searchKeys(String filter, int maxSize) - throws EBaseException; + throws EBaseException; /** * Searches for private keys. - * + * * @param filter LDAP filter for the search * @param maxSize maximium number of entries to be returned * @param timeLimt timeout value @@ -112,30 +110,31 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search keys */ public Enumeration searchKeys(String filter, int maxSize, int timeLimt) - throws EBaseException; + throws EBaseException; /** * Deletes a key record. - * + * * @param serialno key identifier * @exception EBaseException failed to delete key record */ public void deleteKeyRecord(BigInteger serialno) - throws EBaseException; + throws EBaseException; /** * Modifies key record in this repository. - * + * * @param serialNo key identifier * @param mods modification of key records * @exception EBaseException failed to modify key record */ public void modifyKeyRecord(BigInteger serialNo, - ModificationSet mods) throws EBaseException; + ModificationSet mods) throws EBaseException; /** * Searchs for a list of key records. * Here is a list of supported filter attributes: + * * <pre> * keySerialNumber * keyState @@ -149,7 +148,7 @@ public interface IKeyRepository extends IRepository { * keyModifyTime * keyMetaInfo * </pre> - * + * * @param filter search filter * @param attrs list of attributes to be returned * @param pageSize virtual list page size @@ -157,11 +156,11 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search key records */ public IKeyRecordList findKeyRecordsInList(String filter, - String attrs[], int pageSize) throws EBaseException; + String attrs[], int pageSize) throws EBaseException; /** * Searchs for a list of key records. - * + * * @param filter search filter * @param attrs list of attributes to be returned * @param sortKey name of attribute that the list should be sorted by @@ -170,6 +169,6 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search key records */ public IKeyRecordList findKeyRecordsInList(String filter, - String attrs[], String sortKey, int pageSize) - throws EBaseException; + String attrs[], String sortKey, int pageSize) + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java index e4baf91e..fa8a0d76 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java @@ -17,15 +17,13 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.io.Serializable; - /** * A class represents key state. This object is to * encapsulate the life cycle of a key. * <P> - * + * * @version $Revision$, $Date$ */ public final class KeyState implements Serializable { @@ -42,62 +40,67 @@ public final class KeyState implements Serializable { private KeyState(int code) { mStateCode = code; } - + /** * Request state. */ - public final static KeyState ANY = new KeyState(-1); + public final static KeyState ANY = new KeyState(-1); public final static KeyState VALID = new KeyState(0); public final static KeyState INVALID = new KeyState(1); - + /** * Checks if the given object equals to this object. - * + * * @param other object to be compared * @return true if both objects are the same */ public boolean equals(Object other) { - if (this == other) + if (this == other) return true; else if (other instanceof KeyState) return ((KeyState) other).mStateCode == mStateCode; - else + else return false; } /** * Returns the hash code. - * + * * @return hash code */ public int hashCode() { return mStateCode; } - + /** * Return the string-representation of this object. - * + * * @return string value */ public String toString() { - if (mStateCode == -1) return "ANY"; - if (mStateCode == 0) return "VALID"; - if (mStateCode == 1) return "INVAILD"; + if (mStateCode == -1) + return "ANY"; + if (mStateCode == 0) + return "VALID"; + if (mStateCode == 1) + return "INVAILD"; return "[UNDEFINED]"; - + } /** * Converts a string into a key state object. - * + * * @param state state in string-representation * @return key state object */ public static KeyState toKeyState(String state) { - if (state.equalsIgnoreCase("ANY")) return ANY; - if (state.equalsIgnoreCase("VALID")) return VALID; - if (state.equalsIgnoreCase("INVALID")) return INVALID; + if (state.equalsIgnoreCase("ANY")) + return ANY; + if (state.equalsIgnoreCase("VALID")) + return VALID; + if (state.equalsIgnoreCase("INVALID")) + return INVALID; return null; } } - diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/replicadb/IReplicaIDRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/replicadb/IReplicaIDRepository.java index 660b6e9e..574adfae 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/replicadb/IReplicaIDRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/replicadb/IReplicaIDRepository.java @@ -19,12 +19,11 @@ package com.netscape.certsrv.dbs.replicadb; import com.netscape.certsrv.dbs.repository.IRepository; - /** - * An interface represents a ReplicaID Repository. + * An interface represents a ReplicaID Repository. * It provides unique managed replica IDs. * <P> - * + * * @version $Revision$, $Date$ */ public interface IReplicaIDRepository extends IRepository { diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepository.java index 5ff90241..943d4a68 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepository.java @@ -22,10 +22,10 @@ import java.math.BigInteger; import com.netscape.certsrv.base.EBaseException; /** - * An interface represents a generic repository. It maintains unique + * An interface represents a generic repository. It maintains unique * serial number within repository. * <P> - * + * * @version $Revision$, $Date$ */ public interface IRepository { @@ -33,7 +33,7 @@ public interface IRepository { /** * Retrieves the next serial number, and also increase the * serial number by one. - * + * * @return serial number * @exception EBaseException failed to retrieve next serial number */ @@ -58,8 +58,8 @@ public interface IRepository { * @param serial maximum number * @exception EBaseException failed to set maximum serial number */ - public void setMaxSerial (String serial) throws EBaseException; - + public void setMaxSerial(String serial) throws EBaseException; + /** * Set the maximum serial number in next range. * @@ -69,19 +69,19 @@ public interface IRepository { public void setNextMaxSerial(String serial) throws EBaseException; /** - * Checks to see if a new range is needed, or if we have reached the end of the + * Checks to see if a new range is needed, or if we have reached the end of the * current range, or if a range conflict has occurred. * * @exception EBaseException failed to check next range for conflicts */ public void checkRanges() throws EBaseException; - /** + /** * Sets whether serial number management is enabled for certs - * and requests. - * - * @param value true/false - * @exception EBaseException failed to set + * and requests. + * + * @param value true/false + * @exception EBaseException failed to set */ public void setEnableSerialMgmt(boolean value) throws EBaseException; diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepositoryRecord.java b/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepositoryRecord.java index 326ea466..c46e8419 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepositoryRecord.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/repository/IRepositoryRecord.java @@ -22,23 +22,23 @@ import java.math.BigInteger; import com.netscape.certsrv.dbs.IDBObj; /** - * An interface represents a generic repository record. + * An interface represents a generic repository record. * It maintains unique serial number within repository. * <P> - * + * * @version $Revision$, $Date$ */ public interface IRepositoryRecord extends IDBObj { - public final static String ATTR_SERIALNO = "serialNo"; - public final static String ATTR_PUB_STATUS = "publishingStatus"; + public final static String ATTR_SERIALNO = "serialNo"; + public final static String ATTR_PUB_STATUS = "publishingStatus"; - /** - * Retrieves serial number. - * - * @return serial number - */ - public BigInteger getSerialNumber(); + /** + * Retrieves serial number. + * + * @return serial number + */ + public BigInteger getSerialNumber(); - public String getPublishingStatus(); + public String getPublishingStatus(); } |