diff options
author | Ade Lee <alee@redhat.com> | 2012-01-11 12:57:53 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2012-01-11 13:49:04 -0500 |
commit | 10cfe7756e967ac91c66d33b392aeab9cf3780fb (patch) | |
tree | d5ac9b58442265d2ce5ef60e31f041ddacba1b4f /pki/base/common/src/com/netscape/certsrv/base | |
parent | edcb24f65cc3700e75d0a1d14dc2483f210b0ee4 (diff) | |
download | pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.gz pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.xz pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.zip |
Formatting (no line wrap in comments or code)
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/base')
31 files changed, 432 insertions, 448 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/base/ASubsystem.java b/pki/base/common/src/com/netscape/certsrv/base/ASubsystem.java index ea3342308..2b4c6d15a 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ASubsystem.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ASubsystem.java @@ -17,12 +17,11 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - /** * This class represents a basic subsystem. Each basic - * subsystem is named with an identifier and has a + * subsystem is named with an identifier and has a * configuration store. - * + * * @version $Revision$, $Date$ */ public abstract class ASubsystem implements ISubsystem { @@ -33,7 +32,7 @@ public abstract class ASubsystem implements ISubsystem { /** * Initializes this subsystem. - * + * * @param parent parent subsystem * @param cfg configuration store */ @@ -44,7 +43,7 @@ public abstract class ASubsystem implements ISubsystem { /** * Retrieves the configuration store. - * + * * @return configuration store */ public IConfigStore getConfigStore() { @@ -53,7 +52,7 @@ public abstract class ASubsystem implements ISubsystem { /** * Sets the identifier of this subsystem. - * + * * @param id subsystem identifier */ public void setId(String id) { @@ -62,7 +61,7 @@ public abstract class ASubsystem implements ISubsystem { /** * Retrieves the subsystem identifier. - * + * * @return subsystem identifier */ public String getId() { diff --git a/pki/base/common/src/com/netscape/certsrv/base/AttributeNameHelper.java b/pki/base/common/src/com/netscape/certsrv/base/AttributeNameHelper.java index 786148a0e..5b6db131e 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/AttributeNameHelper.java +++ b/pki/base/common/src/com/netscape/certsrv/base/AttributeNameHelper.java @@ -17,25 +17,24 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - /** - * AttributeNameHelper. This Helper class used to decompose + * AttributeNameHelper. This Helper class used to decompose * dot-separated attribute name into prefix and suffix. - * + * * @version $Revision$, $Date$ */ public class AttributeNameHelper { // Public members private static final char SEPARATOR = '.'; - + // Private data members private String prefix = null; private String suffix = null; - + /** * Default constructor for the class. Name is of the form * "proofOfPosession.type". - * + * * @param name the attribute name. */ public AttributeNameHelper(String name) { @@ -51,20 +50,19 @@ public class AttributeNameHelper { /** * Return the prefix of the name. - * + * * @return attribute prefix */ public String getPrefix() { return (prefix); } - + /** * Return the suffix of the name. - * + * * @return attribute suffix */ public String getSuffix() { return (suffix); } } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/BaseResources.java b/pki/base/common/src/com/netscape/certsrv/base/BaseResources.java index f54f13772..41159481f 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/BaseResources.java +++ b/pki/base/common/src/com/netscape/certsrv/base/BaseResources.java @@ -17,15 +17,13 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.ListResourceBundle; - /** * A class represents a resource bundle for the entire * system. * <P> - * + * * @version $Revision$, $Date$ * @see java.util.ListResourceBundle */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/EBaseException.java b/pki/base/common/src/com/netscape/certsrv/base/EBaseException.java index e58aaca2f..26def60f5 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/EBaseException.java +++ b/pki/base/common/src/com/netscape/certsrv/base/EBaseException.java @@ -17,15 +17,13 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Locale; - /** - * An exception with localizable error messages. It is the - * base class for all exceptions in certificate server. + * An exception with localizable error messages. It is the + * base class for all exceptions in certificate server. * <P> - * + * * @version $Revision$, $Date$ * @see java.text.MessageFormat * @see com.netscape.certsrv.base.BaseResources @@ -50,11 +48,12 @@ public class EBaseException extends Exception { /** * Constructs an instance of this exception with the given resource key. - * If resource key is not found in the resource bundle, the resource key + * If resource key is not found in the resource bundle, the resource key * specified is used as the error message. + * * <pre> - * new EBaseException(BaseResources.PERMISSION_DENIED); - * new EBaseException("An plain error message"); + * new EBaseException(BaseResources.PERMISSION_DENIED); + * new EBaseException("An plain error message"); * <P> * @param msgFormat The error message resource key. */ @@ -65,11 +64,13 @@ public class EBaseException extends Exception { /** * Constructs an instance of this exception with the given resource key - * and a parameter as a string. + * and a parameter as a string. + * * <PRE> - * new EBaseException(BaseResource.NO_CONFIG_FILE, fileName); + * new EBaseException(BaseResource.NO_CONFIG_FILE, fileName); * </PRE> * <P> + * * @param msgFormat exception details in message string format * @param param message string parameter */ @@ -80,8 +81,9 @@ public class EBaseException extends Exception { } /** - * Constructs an instance of the exception given the resource key and - * a exception parameter. + * Constructs an instance of the exception given the resource key and + * a exception parameter. + * * <PRE> * try { * ... @@ -90,6 +92,7 @@ public class EBaseException extends Exception { * } * </PRE> * <P> + * * @param msgFormat The resource key * @param param The parameter as an exception */ @@ -103,6 +106,7 @@ public class EBaseException extends Exception { * Constructs an instance of this exception given the resource key and * an array of parameters. * <P> + * * @param msgFormat The resource key * @param params Array of params */ @@ -114,7 +118,7 @@ public class EBaseException extends Exception { /** * Returns the list of parameters. * <P> - * + * * @return List of parameters. */ public Object[] getParameters() { @@ -124,6 +128,7 @@ public class EBaseException extends Exception { /** * Returns the exception string in the default locale. * <P> + * * @return The exception string in the default locale. */ public String toString() { @@ -133,6 +138,7 @@ public class EBaseException extends Exception { /** * Returns the exception string in the given locale. * <P> + * * @param locale The locale * @return The exception string in the given locale. */ @@ -143,6 +149,7 @@ public class EBaseException extends Exception { /** * Returns the given resource bundle name. + * * @return the name of the resource bundle for this class. */ protected String getBundleName() { diff --git a/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotDefined.java b/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotDefined.java index 938c9fffe..466306582 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotDefined.java +++ b/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotDefined.java @@ -17,13 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - /** - * This class represents an exception thrown when a + * This class represents an exception thrown when a * property is not defined (empty string) the configuration store. * It extends EBaseException and uses the same resource bundle. * <p> - * + * * @version $Revision$, $Date$ * @see com.netscape.certsrv.base.EBaseException */ @@ -38,6 +37,7 @@ public class EPropertyNotDefined extends EBaseException { * Constructs an instance of this exception given the name of the * property that's not found. * <p> + * * @param errorString Detailed error message. */ public EPropertyNotDefined(String errorString) { diff --git a/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotFound.java b/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotFound.java index 833a393a9..5a8a9550f 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotFound.java +++ b/pki/base/common/src/com/netscape/certsrv/base/EPropertyNotFound.java @@ -17,13 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - /** - * This class represents an exception thrown when a + * This class represents an exception thrown when a * property is not found in the configuration store. * It extends EBaseException and uses the same resource bundle. * <p> - * + * * @version $Revision$, $Date$ * @see com.netscape.certsrv.base.EBaseException */ @@ -38,6 +37,7 @@ public class EPropertyNotFound extends EBaseException { * Constructs an instance of this exception given the name of the * property that's not found. * <p> + * * @param errorString Detailed error message. */ public EPropertyNotFound(String errorString) { diff --git a/pki/base/common/src/com/netscape/certsrv/base/ExtendedPluginInfo.java b/pki/base/common/src/com/netscape/certsrv/base/ExtendedPluginInfo.java index a0399d349..86f5999d9 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ExtendedPluginInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ExtendedPluginInfo.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Locale; - /** * Plugin which can return extended information to console * <p> - * + * * @version $Revision$, $Date$ */ public class ExtendedPluginInfo implements IExtendedPluginInfo { @@ -33,7 +31,7 @@ public class ExtendedPluginInfo implements IExtendedPluginInfo { /** * Constructs an extended plugin info object. - * + * * @param epi plugin info list */ public ExtendedPluginInfo(String epi[]) { @@ -41,48 +39,48 @@ public class ExtendedPluginInfo implements IExtendedPluginInfo { } /** - * This method returns an array of strings. Each element of the - * array represents a configurable parameter, or some other - * meta-info (such as help-token) + * This method returns an array of strings. Each element of the + * array represents a configurable parameter, or some other + * meta-info (such as help-token) + * + * there is an entry indexed on that parameter name + * <param-name>;<type_info>[,required];<description>;... + * + * Where: + * + * type_info is either 'string', 'number', 'boolean', 'password' or + * 'choice(ch1,ch2,ch3,...)' + * + * If the marker 'required' is included after the type_info, + * the parameter will has some visually distinctive marking in + * the UI. + * + * 'description' is a short sentence describing the parameter + * 'choice' is rendered as a drop-down list. The first parameter in the + * list will be activated by default + * 'boolean' is rendered as a checkbox. The resulting parameter will be + * either 'true' or 'false' + * 'string' allows any characters + * 'number' allows only numbers + * 'password' is rendered as a password field (the characters are replaced + * with *'s when being types. This parameter is not passed through to + * the plugin. It is instead inserted directly into the password cache + * keyed on the instance name. The value of the parameter + * 'bindPWPrompt' (see example below) is set to the key. + * + * In addition to the configurable parameters, the following magic parameters + * may be defined: + * + * HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin + * HELP_TEXT;helptext - a general help string describing the plugin * - * there is an entry indexed on that parameter name - * <param-name>;<type_info>[,required];<description>;... - * - * Where: - * - * type_info is either 'string', 'number', 'boolean', 'password' or - * 'choice(ch1,ch2,ch3,...)' - * - * If the marker 'required' is included after the type_info, - * the parameter will has some visually distinctive marking in - * the UI. + * For example: + * "username;string;The username you wish to login as" + * "bindPWPrompt;password;Enter password to bind as above user with" + * "algorithm;choice(RSA,DSA);Which algorithm do you want to use" + * "enable;boolean;Do you want to run this plugin" + * "port;number;Which port number do you want to use" * - * 'description' is a short sentence describing the parameter - * 'choice' is rendered as a drop-down list. The first parameter in the - * list will be activated by default - * 'boolean' is rendered as a checkbox. The resulting parameter will be - * either 'true' or 'false' - * 'string' allows any characters - * 'number' allows only numbers - * 'password' is rendered as a password field (the characters are replaced - * with *'s when being types. This parameter is not passed through to - * the plugin. It is instead inserted directly into the password cache - * keyed on the instance name. The value of the parameter - * 'bindPWPrompt' (see example below) is set to the key. - * - * In addition to the configurable parameters, the following magic parameters - * may be defined: - * - * HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin - * HELP_TEXT;helptext - a general help string describing the plugin - * - * For example: - * "username;string;The username you wish to login as" - * "bindPWPrompt;password;Enter password to bind as above user with" - * "algorithm;choice(RSA,DSA);Which algorithm do you want to use" - * "enable;boolean;Do you want to run this plugin" - * "port;number;Which port number do you want to use" - * */ public String[] getExtendedPluginInfo(Locale locale) { return _epi; diff --git a/pki/base/common/src/com/netscape/certsrv/base/IArgBlock.java b/pki/base/common/src/com/netscape/certsrv/base/IArgBlock.java index 65ca140e8..adddccba6 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IArgBlock.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IArgBlock.java @@ -23,32 +23,32 @@ import java.util.Enumeration; import netscape.security.pkcs.PKCS10; - /** * This interface defines the abstraction for the generic collection * of attributes indexed by string names. * Set of cooperating implementations of this interface may exploit * dot-separated attribute names to provide seamless access to the - * attributes of attribute value which also implements AttrSet + * attributes of attribute value which also implements AttrSet * interface as if it was direct attribute of the container * E.g., ((AttrSet)container.get("x")).get("y") is equivalent to * container.get("x.y"); * <p> - * + * * @version $Revision$, $Date$ **/ public interface IArgBlock extends Serializable { /** * Checks if this argument block contains the given key. - * + * * @param n key * @return true if key is present */ public boolean isValuePresent(String n); + /** * Adds string-based value into this argument block. - * + * * @param n key * @param v value * @return value @@ -57,7 +57,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as string. - * + * * @param n key * @return argument value as string * @exception EBaseException failed to retrieve value @@ -66,7 +66,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as string. - * + * * @param n key * @param def default value to be returned if key is not present * @return argument value as string @@ -75,16 +75,16 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as integer. - * + * * @param n key * @return argument value as int * @exception EBaseException failed to retrieve value */ - public int getValueAsInt(String n) throws EBaseException; + public int getValueAsInt(String n) throws EBaseException; /** * Retrieves argument value as integer. - * + * * @param n key * @param def default value to be returned if key is not present * @return argument value as int @@ -93,7 +93,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as big integer. - * + * * @param n key * @return argument value as big integer * @exception EBaseException failed to retrieve value @@ -102,7 +102,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as big integer. - * + * * @param n key * @param def default value to be returned if key is not present * @return argument value as big integer @@ -111,7 +111,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as object - * + * * @param n key * @return argument value as object * @exception EBaseException failed to retrieve value @@ -120,7 +120,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument value as object - * + * * @param n key * @param def default value to be returned if key is not present * @return argument value as object @@ -129,7 +129,7 @@ public interface IArgBlock extends Serializable { /** * Gets boolean value. They should be "true" or "false". - * + * * @param name name of the input type * @return boolean type: <code>true</code> or <code>false</code> * @exception EBaseException failed to retrieve value @@ -138,16 +138,16 @@ public interface IArgBlock extends Serializable { /** * Gets boolean value. They should be "true" or "false". - * + * * @param name name of the input type - * @param def Default value to return. + * @param def Default value to return. * @return boolean type: <code>true</code> or <code>false</code> */ public boolean getValueAsBoolean(String name, boolean def); /** * Gets KeyGenInfo - * + * * @param name name of the input type * @param def default value to return * @exception EBaseException On error. @@ -158,7 +158,7 @@ public interface IArgBlock extends Serializable { /** * Gets PKCS10 request. This pkcs10 attribute does not * contain header information. - * + * * @param name name of the input type * @return pkcs10 request * @exception EBaseException failed to retrieve value @@ -168,7 +168,7 @@ public interface IArgBlock extends Serializable { /** * Gets PKCS10 request. This pkcs10 attribute does not * contain header information. - * + * * @param name name of the input type * @param def default PKCS10 * @return pkcs10 request @@ -178,8 +178,8 @@ public interface IArgBlock extends Serializable { /** * Retrieves PKCS10 - * - * @param name name of the input type + * + * @param name name of the input type * @param checkheader true if header must be present * @return PKCS10 object * @exception EBaseException failed to retrieve value @@ -188,8 +188,8 @@ public interface IArgBlock extends Serializable { /** * Retrieves PKCS10 - * - * @param name name of the input type + * + * @param name name of the input type * @param checkheader true if header must be present * @param def default PKCS10 * @return PKCS10 object @@ -199,8 +199,8 @@ public interface IArgBlock extends Serializable { /** * Retrieves PKCS10 - * - * @param name name of the input type + * + * @param name name of the input type * @param def default PKCS10 * @return PKCS10 object * @exception EBaseException on error @@ -209,14 +209,14 @@ public interface IArgBlock extends Serializable { /** * Retrieves a list of argument keys. - * + * * @return a list of string-based keys */ public Enumeration<String> elements(); /** * Adds long-type arguments to this block. - * + * * @param n key * @param v value * @return value @@ -225,7 +225,7 @@ public interface IArgBlock extends Serializable { /** * Adds integer-type arguments to this block. - * + * * @param n key * @param v value * @return value @@ -234,7 +234,7 @@ public interface IArgBlock extends Serializable { /** * Adds boolean-type arguments to this block. - * + * * @param n key * @param v value * @return value @@ -243,7 +243,7 @@ public interface IArgBlock extends Serializable { /** * Adds integer-type arguments to this block. - * + * * @param n key * @param v value * @param radix radix @@ -253,7 +253,7 @@ public interface IArgBlock extends Serializable { /** * Sets argument into this block. - * + * * @param name key * @param obj value */ @@ -261,7 +261,7 @@ public interface IArgBlock extends Serializable { /** * Retrieves argument. - * + * * @param name key * @return object value */ @@ -269,14 +269,14 @@ public interface IArgBlock extends Serializable { /** * Deletes argument by the given key. - * + * * @param name key */ public void delete(String name); /** * Retrieves a list of argument keys. - * + * * @return a list of string-based keys */ public Enumeration<String> getElements(); diff --git a/pki/base/common/src/com/netscape/certsrv/base/IAttrSet.java b/pki/base/common/src/com/netscape/certsrv/base/IAttrSet.java index 28e36da61..f7567292e 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IAttrSet.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IAttrSet.java @@ -17,38 +17,36 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.io.Serializable; import java.util.Enumeration; - /** * This interface defines the abstraction for the generic collection * of attributes indexed by string names. * Set of cooperating implementations of this interface may exploit * dot-separated attribute names to provide seamless access to the - * attributes of attribute value which also implements AttrSet + * attributes of attribute value which also implements AttrSet * interface as if it was direct attribute of the container * E.g., ((AttrSet)container.get("x")).get("y") is equivalent to * container.get("x.y"); * <p> - * + * * @version $Revision$, $Date$ **/ public interface IAttrSet extends Serializable { /** * Sets an attribute value within this AttrSet. - * + * * @param name the name of the attribute * @param obj the attribute object. * @exception EBaseException on attribute handling errors. */ - public void set(String name, Object obj)throws EBaseException; + public void set(String name, Object obj) throws EBaseException; /** * Gets an attribute value. - * + * * @param name the name of the attribute to return. * @exception EBaseException on attribute handling errors. */ @@ -56,7 +54,7 @@ public interface IAttrSet extends Serializable { /** * Deletes an attribute value from this AttrSet. - * + * * @param name the name of the attribute to delete. * @exception EBaseException on attribute handling errors. */ @@ -65,7 +63,7 @@ public interface IAttrSet extends Serializable { /** * Returns an enumeration of the names of the attributes existing within * this AttrSet. - * + * * @return an enumeration of the attribute names. */ public Enumeration<?> getElements(); diff --git a/pki/base/common/src/com/netscape/certsrv/base/IAuthInfo.java b/pki/base/common/src/com/netscape/certsrv/base/IAuthInfo.java index 91f9f51af..4806a94c0 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IAuthInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IAuthInfo.java @@ -17,9 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * An interface represents an authentication context. This * is an entity that encapsulates the authentication diff --git a/pki/base/common/src/com/netscape/certsrv/base/ICRLPrettyPrint.java b/pki/base/common/src/com/netscape/certsrv/base/ICRLPrettyPrint.java index c770121fd..d111063a7 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ICRLPrettyPrint.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ICRLPrettyPrint.java @@ -17,21 +17,19 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Locale; - /** * This interface represents a CRL pretty print handler. * It converts a CRL object into a printable CRL string. - * + * * @version $Revision$, $Date$ */ public interface ICRLPrettyPrint { /** * Retrieves the printable CRL string. - * + * * @param clientLocale end user clocale * @param crlSize CRL size * @param pageStart starting page number @@ -42,7 +40,7 @@ public interface ICRLPrettyPrint { /** * Retrieves the printable CRL string. - * + * * @param clientLocale end user clocale * @return printable CRL string */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/ICertPrettyPrint.java b/pki/base/common/src/com/netscape/certsrv/base/ICertPrettyPrint.java index fc4e8c291..e991d5a11 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ICertPrettyPrint.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ICertPrettyPrint.java @@ -17,22 +17,20 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Locale; - /** * This interface represents a certificate pretty print * handler. This handler converts certificate object into * a printable certificate string. * - * @version $Revision$, $Date$ + * @version $Revision$, $Date$ */ public interface ICertPrettyPrint { /** * Returns printable certificate string. - * + * * @param clientLocale end user locale * @return printable certificate string */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/IConfigStore.java b/pki/base/common/src/com/netscape/certsrv/base/IConfigStore.java index aef83b1cf..d12265e83 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IConfigStore.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IConfigStore.java @@ -17,16 +17,16 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.math.BigInteger; import java.util.Enumeration; - /** - * An interface represents a configuration store. - * A configuration store is an abstraction of a hierarchical store - * to keep arbitrary data indexed by string names.<p> - * In the following example: + * An interface represents a configuration store. + * A configuration store is an abstraction of a hierarchical store + * to keep arbitrary data indexed by string names. + * <p> + * In the following example: + * * <pre> * param1=value1 * configStore1.param11=value11 @@ -35,26 +35,27 @@ import java.util.Enumeration; * configStore1.subStore1.param112=value112 * configStore2.param21=value21 * </pre> - * The top config store has parameters <i>param1</i> and sub-stores - * <i>configStore1</i> and <i>configStore2</i>. <br> + * + * The top config store has parameters <i>param1</i> and sub-stores <i>configStore1</i> and <i>configStore2</i>. <br> * The following illustrates how a config store is used. + * * <pre> - * // the top config store is passed to the following method. - * public void init(IConfigStore config) throws EBaseException { - * IConfigStore store = config; - * String valx = config.getString("param1"); - * // valx is "value1" <p> - * - * IConfigStore substore1 = config.getSubstore("configStore1"); - * String valy = substore1.getString("param11"); - * // valy is "value11" <p> - * - * IConfigStore substore2 = config.getSubstore("configStore2"); - * String valz = substore2.getString("param21"); - * // valz is "value21" <p> - * } + * // the top config store is passed to the following method. + * public void init(IConfigStore config) throws EBaseException { + * IConfigStore store = config; + * String valx = config.getString("param1"); + * // valx is "value1" <p> + * + * IConfigStore substore1 = config.getSubstore("configStore1"); + * String valy = substore1.getString("param11"); + * // valy is "value11" <p> + * + * IConfigStore substore2 = config.getSubstore("configStore2"); + * String valz = substore2.getString("param21"); + * // valz is "value21" <p> + * } * </pre> - * + * * @version $Revision$, $Date$ */ public interface IConfigStore extends ISourceConfigStore { @@ -62,6 +63,7 @@ public interface IConfigStore extends ISourceConfigStore { /** * Gets the name of this Configuration Store. * <P> + * * @return The name of this Configuration store */ public String getName(); @@ -69,60 +71,66 @@ public interface IConfigStore extends ISourceConfigStore { /** * Retrieves the value of the given property as a string. * <p> + * * @param name The name of the property to get * @return The value of the property as a String * @exception EPropertyNotFound If the property is not present * @exception EBaseException If an internal error occurred */ - public String getString(String name) - throws EPropertyNotFound, EBaseException; + public String getString(String name) + throws EPropertyNotFound, EBaseException; /** - * Retrieves the value of a given property as a string or the + * Retrieves the value of a given property as a string or the * given default value if the property is not present. * <P> + * * @param name The property to retrive * @param defval The default value to return if the property is not present * @return The roperty value as a string * @exception EBaseException If an internal error occurred */ - public String getString(String name, String defval) - throws EBaseException; + public String getString(String name, String defval) + throws EBaseException; /** - * Stores a property and its value as a string. + * Stores a property and its value as a string. * <p> + * * @param name The name of the property * @param value The value as a string - */ + */ public void putString(String name, String value); /** * Retrieves the value of a property as a byte array. * <P> + * * @param name The property name * @return The property value as a byte array * @exception EPropertyNotFound If the property is not present * @exception EBaseException If an internal error occurred */ - public byte[] getByteArray(String name) - throws EPropertyNotFound, EBaseException; + public byte[] getByteArray(String name) + throws EPropertyNotFound, EBaseException; /** - * Retrieves the value of a property as a byte array, using the + * Retrieves the value of a property as a byte array, using the * given default value if property is not present. * <P> + * * @param name The name of the property * @param defval The default value if the property is not present. * @return The property value as a byte array. * @exception EBaseException If an internal error occurred */ - public byte[] getByteArray(String name, byte defval[]) - throws EBaseException; + public byte[] getByteArray(String name, byte defval[]) + throws EBaseException; /** * Stores the given property and value as a byte array. * <p> + * * @param name The property name * @param value The value as a byte array to store */ @@ -131,29 +139,32 @@ public interface IConfigStore extends ISourceConfigStore { /** * Retrieves the given property as a boolean. * <P> + * * @param name The name of the property as a string. * @return The value of the property as a boolean. * @exception EPropertyNotFound If the property is not present * @exception EBaseException If an internal error occurred */ - public boolean getBoolean(String name) - throws EPropertyNotFound, EBaseException; + public boolean getBoolean(String name) + throws EPropertyNotFound, EBaseException; /** * Retrieves the given property as a boolean. * <P> + * * @param name The name of the property - * @param defval The default value to turn as a boolean if - * property is not present + * @param defval The default value to turn as a boolean if + * property is not present * @return The value of the property as a boolean. * @exception EBaseException If an internal error occurred */ - public boolean getBoolean(String name, boolean defval) - throws EBaseException; + public boolean getBoolean(String name, boolean defval) + throws EBaseException; /** * Stores the given property and its value as a boolean. * <P> + * * @param name The property name * @param value The value as a boolean */ @@ -162,28 +173,31 @@ public interface IConfigStore extends ISourceConfigStore { /** * Retrieves the given property as an integer. * <P> + * * @param name The property name * @return The property value as an integer * @exception EPropertyNotFound If property is not found * @exception EBaseException If an internal error occurred */ - public int getInteger(String name) - throws EPropertyNotFound, EBaseException; + public int getInteger(String name) + throws EPropertyNotFound, EBaseException; /** * Retrieves the given property as an integer. * <P> + * * @param name The property name * @return int The default value to return as an integer - * @exception EBaseException If the value cannot be converted to a - * integer + * @exception EBaseException If the value cannot be converted to a + * integer */ - public int getInteger(String name, int defval) - throws EBaseException; + public int getInteger(String name, int defval) + throws EBaseException; /** * Sets a property and its value as an integer. * <P> + * * @param name parameter name * @param value integer value */ @@ -192,28 +206,31 @@ public interface IConfigStore extends ISourceConfigStore { /** * Retrieves the given property as a big integer. * <P> + * * @param name The property name * @return The property value as a big integer * @exception EPropertyNotFound If property is not found * @exception EBaseException If an internal error occurred */ - public BigInteger getBigInteger(String name) - throws EPropertyNotFound, EBaseException; + public BigInteger getBigInteger(String name) + throws EPropertyNotFound, EBaseException; /** * Retrieves the given property as a big integer. * <P> + * * @param name The property name * @return int The default value to return as a big integer - * @exception EBaseException If the value cannot be converted to a - * integer + * @exception EBaseException If the value cannot be converted to a + * integer */ - public BigInteger getBigInteger(String name, BigInteger defval) - throws EBaseException; + public BigInteger getBigInteger(String name, BigInteger defval) + throws EBaseException; /** * Sets a property and its value as an integer. * <P> + * * @param name parameter name * @param value big integer value */ @@ -222,23 +239,26 @@ public interface IConfigStore extends ISourceConfigStore { /** * Creates a nested sub-store with the specified name. * <P> + * * @param name The name of the sub-store * @return The sub-store created */ public IConfigStore makeSubStore(String name); /** - * Retrieves the given sub-store. + * Retrieves the given sub-store. * <P> + * * @param name The name of the sub-store * @return The sub-store */ public IConfigStore getSubStore(String name); /** - * Removes sub-store with the given name. + * Removes sub-store with the given name. * (Removes all properties and sub-stores under this sub-store.) * <P> + * * @param name The name of the sub-store to remove */ public void removeSubStore(String name); @@ -247,22 +267,24 @@ public interface IConfigStore extends ISourceConfigStore { /** * Retrives and enumeration of all properties in this config-store. + * * @return An enumeration of all properties in this config-store */ public Enumeration<String> getPropertyNames(); /** - * Returns an enumeration of the names of the substores of + * Returns an enumeration of the names of the substores of * this config-store. * <P> - * @return An enumeration of the names of the sub-stores of this - * config-store + * + * @return An enumeration of the names of the sub-stores of this + * config-store */ public Enumeration<String> getSubStoreNames(); /** * Commits all the data into file immediately. - * + * * @param createBackup true if a backup file should be created * @exception EBaseException failed to commit */ @@ -273,4 +295,3 @@ public interface IConfigStore extends ISourceConfigStore { */ public int size(); } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/IConfigStoreEventListener.java b/pki/base/common/src/com/netscape/certsrv/base/IConfigStoreEventListener.java index f2b6a03d4..376b4e91a 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IConfigStoreEventListener.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IConfigStoreEventListener.java @@ -17,34 +17,32 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Hashtable; - /** * ConfigStore Parameters Event Notification. - * + * * @version $Revision$, $Date$ */ public interface IConfigStoreEventListener { /** * Called to validate the config store parameters that changed - * + * * @param action action * @param params configuration parameters changed * @exception EBaseException failed to validate */ - public void validateConfigParams(String action, - Hashtable params) throws EBaseException; + public void validateConfigParams(String action, + Hashtable params) throws EBaseException; /** * Validates the config store parameters that changed - * + * * @param action action * @param params configuration parameters changed * @exception EBaseException failed to validate */ - public void doConfigParams(String action, - Hashtable params) throws EBaseException; + public void doConfigParams(String action, + Hashtable params) throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/base/IExtPrettyPrint.java b/pki/base/common/src/com/netscape/certsrv/base/IExtPrettyPrint.java index 73e95b776..8d95a40ca 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IExtPrettyPrint.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IExtPrettyPrint.java @@ -17,22 +17,18 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * This class will display the certificate content in predefined * format. - * + * * @version $Revision$, $Date$ */ public interface IExtPrettyPrint { /** * Retrieves the printable extension string. - * + * * @return printable extension string */ public String toString(); } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/IExtendedPluginInfo.java b/pki/base/common/src/com/netscape/certsrv/base/IExtendedPluginInfo.java index e8060b24a..aff3daf4d 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IExtendedPluginInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IExtendedPluginInfo.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Locale; - /** * Plugin which can return extended information to console * <p> - * + * * @version $Revision$, $Date$ */ public interface IExtendedPluginInfo { @@ -33,48 +31,48 @@ public interface IExtendedPluginInfo { public static final String HELP_TEXT = "HELP_TEXT"; /** - * This method returns an array of strings. Each element of the - * array represents a configurable parameter, or some other - * meta-info (such as help-token) + * This method returns an array of strings. Each element of the + * array represents a configurable parameter, or some other + * meta-info (such as help-token) + * + * there is an entry indexed on that parameter name + * <param-name>;<type_info>[,required];<description>;... + * + * Where: + * + * type_info is either 'string', 'number', 'boolean', 'password' or + * 'choice(ch1,ch2,ch3,...)' + * + * If the marker 'required' is included after the type_info, + * the parameter will has some visually distinctive marking in + * the UI. + * + * 'description' is a short sentence describing the parameter + * 'choice' is rendered as a drop-down list. The first parameter in the + * list will be activated by default + * 'boolean' is rendered as a checkbox. The resulting parameter will be + * either 'true' or 'false' + * 'string' allows any characters + * 'number' allows only numbers + * 'password' is rendered as a password field (the characters are replaced + * with *'s when being types. This parameter is not passed through to + * the plugin. It is instead inserted directly into the password cache + * keyed on the instance name. The value of the parameter + * 'bindPWPrompt' (see example below) is set to the key. + * + * In addition to the configurable parameters, the following magic parameters + * may be defined: + * + * HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin + * HELP_TEXT;helptext - a general help string describing the plugin * - * there is an entry indexed on that parameter name - * <param-name>;<type_info>[,required];<description>;... - * - * Where: - * - * type_info is either 'string', 'number', 'boolean', 'password' or - * 'choice(ch1,ch2,ch3,...)' - * - * If the marker 'required' is included after the type_info, - * the parameter will has some visually distinctive marking in - * the UI. + * For example: + * "username;string;The username you wish to login as" + * "bindPWPrompt;password;Enter password to bind as above user with" + * "algorithm;choice(RSA,DSA);Which algorithm do you want to use" + * "enable;boolean;Do you want to run this plugin" + * "port;number;Which port number do you want to use" * - * 'description' is a short sentence describing the parameter - * 'choice' is rendered as a drop-down list. The first parameter in the - * list will be activated by default - * 'boolean' is rendered as a checkbox. The resulting parameter will be - * either 'true' or 'false' - * 'string' allows any characters - * 'number' allows only numbers - * 'password' is rendered as a password field (the characters are replaced - * with *'s when being types. This parameter is not passed through to - * the plugin. It is instead inserted directly into the password cache - * keyed on the instance name. The value of the parameter - * 'bindPWPrompt' (see example below) is set to the key. - * - * In addition to the configurable parameters, the following magic parameters - * may be defined: - * - * HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin - * HELP_TEXT;helptext - a general help string describing the plugin - * - * For example: - * "username;string;The username you wish to login as" - * "bindPWPrompt;password;Enter password to bind as above user with" - * "algorithm;choice(RSA,DSA);Which algorithm do you want to use" - * "enable;boolean;Do you want to run this plugin" - * "port;number;Which port number do you want to use" - * */ public String[] getExtendedPluginInfo(Locale locale); diff --git a/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java b/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java index 4a55af607..566fef38f 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java @@ -17,12 +17,11 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Vector; /** * This interface represents a plugin instance. - * + * * @version $Revision$, $Date$ */ public interface IPluginImpl { @@ -32,6 +31,7 @@ public interface IPluginImpl { /** * Gets the description for this plugin instance. * <P> + * * @return The Description for this plugin instance. */ public String getDescription(); @@ -39,7 +39,7 @@ public interface IPluginImpl { /** * Returns the name of the plugin class. * <P> - * + * * @return The name of the plugin class. */ public String getImplName(); @@ -47,24 +47,24 @@ public interface IPluginImpl { /** * Returns the name of the plugin instance. * <P> - * - * @return The name of the plugin instance. If none is set - * the name of the implementation will be returned.xxxx + * + * @return The name of the plugin instance. If none is set + * the name of the implementation will be returned.xxxx */ public String getInstanceName(); /** * Initializes this plugin instance. - * + * * @param sys parent subsystem * @param instanceName instance name of this plugin * @param className class name of this plugin * @param config configuration store * @exception EBaseException failed to initialize */ - public void init(ISubsystem sys, String instanceName, String className, - IConfigStore config) - throws EBaseException; + public void init(ISubsystem sys, String instanceName, String className, + IConfigStore config) + throws EBaseException; /** * Shutdowns this plugin. @@ -73,33 +73,32 @@ public interface IPluginImpl { /** * Retrieves the configuration store. - * + * * @return configuration store */ public IConfigStore getConfigStore(); /** * Return configured parameters for a plugin instance. - * - * @return nvPairs A Vector of name/value pairs. Each name/value - * pair is constructed as a String in name=value format. + * + * @return nvPairs A Vector of name/value pairs. Each name/value + * pair is constructed as a String in name=value format. */ public Vector getInstanceParams(); /** * Retrieves a list of configuration parameter names. - * + * * @return a list of parameter names */ public String[] getConfigParams(); /** * Return default parameters for a plugin implementation. - * + * * @return nvPairs A Vector of name/value pairs. Each name/value - * pair is constructed as a String in name=value. + * pair is constructed as a String in name=value. */ public Vector getDefaultParams(); } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/IPrettyPrintFormat.java b/pki/base/common/src/com/netscape/certsrv/base/IPrettyPrintFormat.java index 1fba48f19..67c1b01d1 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IPrettyPrintFormat.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IPrettyPrintFormat.java @@ -17,32 +17,29 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * This class will display the certificate content in predefined * format. - * + * * @version $Revision$, $Date$ */ public interface IPrettyPrintFormat { /** * Retrieves a pretty print string of the given byte array. - * + * * @param in byte array * @param indentSize indentation size * @param lineLen length of line * @param separator separator string * @return pretty print string */ - public String toHexString(byte[] in, int indentSize, - int lineLen, String separator); + public String toHexString(byte[] in, int indentSize, + int lineLen, String separator); /** * Retrieves a pretty print string of the given byte array. - * + * * @param in byte array * @param indentSize indentation size * @param lineLen length of line @@ -52,7 +49,7 @@ public interface IPrettyPrintFormat { /** * Retrieves a pretty print string of the given byte array. - * + * * @param in byte array * @param indentSize indentation size * @return pretty print string @@ -61,7 +58,7 @@ public interface IPrettyPrintFormat { /** * Retrieves a pretty print string of the given byte array. - * + * * @param in byte array * @return pretty print string */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/ISecurityDomainSessionTable.java b/pki/base/common/src/com/netscape/certsrv/base/ISecurityDomainSessionTable.java index ced3886cb..24c55d086 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ISecurityDomainSessionTable.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ISecurityDomainSessionTable.java @@ -19,21 +19,30 @@ package com.netscape.certsrv.base; import java.util.Enumeration; - /** * This interface defines the abstraction for the cookie table. **/ public interface ISecurityDomainSessionTable { - public static final int SUCCESS =0; - public static final int FAILURE =1; + public static final int SUCCESS = 0; + public static final int FAILURE = 1; + public int addEntry(String cookieId, String ip, String uid, String group); + public int removeEntry(String sessionId); + public boolean isSessionIdExist(String sessionId); + public String getIP(String sessionId); + public String getUID(String sessionId); + public String getGroup(String sessionId); + public long getBeginTime(String sessionId); + public int getSize(); + public long getTimeToLive(); + public Enumeration<String> getSessionIds(); } diff --git a/pki/base/common/src/com/netscape/certsrv/base/ISourceConfigStore.java b/pki/base/common/src/com/netscape/certsrv/base/ISourceConfigStore.java index 03adb7009..eb848c54e 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ISourceConfigStore.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ISourceConfigStore.java @@ -17,20 +17,19 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; import java.util.Enumeration; - /** * An interface that represents the source that creates the configuration * store tree. Note that the tree can be built based on the information * from a text file or ldap entries. + * * @see com.netscape.certsrv.base.IConfigStore - * + * * @version $Revision$, $Date$ */ public interface ISourceConfigStore extends Serializable { @@ -38,7 +37,7 @@ public interface ISourceConfigStore extends Serializable { /** * Gets a property. * <P> - * + * * @param name The property name * @return property value */ @@ -47,7 +46,7 @@ public interface ISourceConfigStore extends Serializable { /** * Retrieves a property. * <P> - * + * * @param name The property name * @param value The property value */ @@ -56,7 +55,7 @@ public interface ISourceConfigStore extends Serializable { /** * Returns an enumeration of the config store's keys. * <P> - * + * * @return a list of keys * @see java.util.Hashtable#elements * @see java.util.Enumeration @@ -64,16 +63,16 @@ public interface ISourceConfigStore extends Serializable { public Enumeration<String> keys(); /** - * Reads a config store from an input stream. - * + * Reads a config store from an input stream. + * * @param in input stream where the properties are located * @exception IOException If an IO error occurs while loading from input. */ public void load(InputStream in) throws IOException; /** - * Stores this config store to the specified output stream. - * + * Stores this config store to the specified output stream. + * * @param out output stream where the properties should be serialized * @param header optional header to be serialized */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/ISubsystem.java b/pki/base/common/src/com/netscape/certsrv/base/ISubsystem.java index 77f1708ac..7b2a37d7d 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ISubsystem.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ISubsystem.java @@ -17,12 +17,9 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * An interface represents a CMS subsystem. CMS is made up of a list - * subsystems. Each subsystem is responsible for a set of + * subsystems. Each subsystem is responsible for a set of * speciailized functions. * <P> * @@ -32,14 +29,14 @@ public interface ISubsystem { /** * Retrieves the name of this subsystem. - * + * * @return subsystem identifier */ public String getId(); /** * Sets specific to this subsystem. - * + * * @param id subsystem identifier * @exception EBaseException failed to set id */ @@ -49,17 +46,17 @@ public interface ISubsystem { * Initializes this subsystem with the given configuration * store. * <P> - * + * * @param owner owner of this subsystem * @param config configuration store * @exception EBaseException failed to initialize */ public void init(ISubsystem owner, IConfigStore config) - throws EBaseException; + throws EBaseException; /** * Notifies this subsystem if owner is in running mode. - * + * * @exception EBaseException failed to start up */ public void startup() throws EBaseException; @@ -74,7 +71,7 @@ public interface ISubsystem { /** * Returns the root configuration storage of this system. * <P> - * + * * @return configuration store of this subsystem */ public IConfigStore getConfigStore(); diff --git a/pki/base/common/src/com/netscape/certsrv/base/ISubsystemSource.java b/pki/base/common/src/com/netscape/certsrv/base/ISubsystemSource.java index 23b82179e..f6bb6378b 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ISubsystemSource.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ISubsystemSource.java @@ -17,9 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * An interface represents a subsystem source. A subsystem * source is a container that manages multiple subsystems. @@ -31,7 +28,7 @@ public interface ISubsystemSource { /** * Retrieves subsystem from the source. - * + * * @param sid subsystem identifier * @return subsystem */ diff --git a/pki/base/common/src/com/netscape/certsrv/base/ITimeSource.java b/pki/base/common/src/com/netscape/certsrv/base/ITimeSource.java index f1e3e25e4..1e7dd0fb0 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/ITimeSource.java +++ b/pki/base/common/src/com/netscape/certsrv/base/ITimeSource.java @@ -17,10 +17,8 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Date; - /** * This interface represents a time source where * current time can be retrieved. CMS is installed @@ -35,7 +33,7 @@ public interface ITimeSource { /** * Retrieves current time and date. - * + * * @return current time and date */ public Date getCurrentDate(); diff --git a/pki/base/common/src/com/netscape/certsrv/base/KeyGenInfo.java b/pki/base/common/src/com/netscape/certsrv/base/KeyGenInfo.java index 17efca771..23cb1957a 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/KeyGenInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/base/KeyGenInfo.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.io.IOException; import netscape.security.util.DerInputStream; @@ -25,27 +24,27 @@ import netscape.security.util.DerValue; import netscape.security.x509.AlgorithmId; import netscape.security.x509.X509Key; - /** - * + * * The <code>KeyGenInfo</code> represents the information generated by * the KeyGen tag of the HTML forms. It provides the parsing and accessing - * mechanisms.<p> - * + * mechanisms. + * <p> + * * <pre> * SignedPublicKeyAndChallenge ::= SEQUENCE { * publicKeyAndChallenge PublicKeyAndChallenge, * signatureAlgorithm AlgorithmIdentifier, * signature BIT STRING * } - * + * * PublicKeyAndChallenge ::= SEQUENCE { * spki SubjectPublicKeyInfo, * challenge IA5STRING * } - *</pre> - * - * + * </pre> + * + * * @version $Revision$, $Date$ */ @@ -79,11 +78,11 @@ public class KeyGenInfo { /** * Construct KeyGenInfo using the SignedPublicKeyAndChallenge * string representation. - * + * * @param spkac SignedPublicKeyAndChallenge string representation */ public KeyGenInfo(String spkac) - throws IOException { + throws IOException { decode(spkac); } @@ -93,7 +92,7 @@ public class KeyGenInfo { /** * Initialize using the SPKAC string - * + * * @param spkac SPKAC string from the end user */ public void decode(String spkac) throws IOException { @@ -104,7 +103,7 @@ public class KeyGenInfo { /** * Der encoded into buffer - * + * * @return Der encoded buffer */ public byte[] encode() { @@ -113,7 +112,7 @@ public class KeyGenInfo { /** * Get SPKI in DerValue form - * + * * @return SPKI in DerValue form */ public DerValue getDerSPKI() { @@ -122,7 +121,7 @@ public class KeyGenInfo { /** * Get SPKI as X509Key - * + * * @return SPKI in X509Key form */ public X509Key getSPKI() { @@ -131,7 +130,7 @@ public class KeyGenInfo { /** * Get Challenge phrase in DerValue form - * + * * @return Challenge in DerValue form. null if none. */ public DerValue getDerChallenge() { @@ -140,7 +139,7 @@ public class KeyGenInfo { /** * Get Challenge phrase in string format - * + * * @return challenge phrase. null if none. */ public String getChallenge() { @@ -149,6 +148,7 @@ public class KeyGenInfo { /** * Get Signature + * * @return signature */ public byte[] getSignature() { @@ -157,6 +157,7 @@ public class KeyGenInfo { /** * Get Algorithm ID + * * @return the algorithm id */ public AlgorithmId getAlgorithmId() { @@ -165,7 +166,7 @@ public class KeyGenInfo { /** * Validate Signature and Challenge Phrase - * + * * @param challenge phrase; null if none * @return true if validated; otherwise, false */ @@ -180,7 +181,7 @@ public class KeyGenInfo { /** * String representation of KenGenInfo - * + * * @return string representation of KeGenInfo */ public String toString() { @@ -194,13 +195,13 @@ public class KeyGenInfo { *==========================================================*/ private byte[] base64Decode(String spkac) - throws IOException { + throws IOException { return com.netscape.osutil.OSUtil.AtoB(spkac); } private void derDecode(byte spkac[]) - throws IOException { + throws IOException { DerInputStream derIn = new DerInputStream(spkac); /* get SPKAC Algorithm & Signature */ @@ -224,4 +225,3 @@ public class KeyGenInfo { } } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/MessageFormatter.java b/pki/base/common/src/com/netscape/certsrv/base/MessageFormatter.java index 8e186fc48..903b534e0 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/MessageFormatter.java +++ b/pki/base/common/src/com/netscape/certsrv/base/MessageFormatter.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.lang.reflect.Method; import java.text.MessageFormat; import java.util.Date; @@ -25,13 +24,12 @@ import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; - /** - * Factors out common function of formatting internatinalized - * messages taking arguments and using java.util.ResourceBundle + * Factors out common function of formatting internatinalized + * messages taking arguments and using java.util.ResourceBundle * and java.text.MessageFormat mechanism. * <P> - * + * * @version $Revision$, $Date$ * @see java.text.MessageFormat * @see java.util.ResourceBundle @@ -42,22 +40,22 @@ public class MessageFormatter { /** * Retrieves the localized string. - * + * * @param locale end user locale * @param resourceBundleBaseName resource bundle class name * @param formatString format string * @return localized string */ public static String getLocalizedString( - Locale locale, String resourceBundleBaseName, - String formatString) { - return getLocalizedString(locale, resourceBundleBaseName, + Locale locale, String resourceBundleBaseName, + String formatString) { + return getLocalizedString(locale, resourceBundleBaseName, formatString, null); } /** * Retrieves the localized string. - * + * * @param locale end user locale * @param resourceBundleBaseName resource bundle class name * @param formatString format string @@ -65,18 +63,18 @@ public class MessageFormatter { * @return localized string */ public static String getLocalizedString( - Locale locale, String resourceBundleBaseName, - String formatString, Object params) { + Locale locale, String resourceBundleBaseName, + String formatString, Object params) { Object o[] = new Object[1]; o[0] = params; - return getLocalizedString(locale, resourceBundleBaseName, + return getLocalizedString(locale, resourceBundleBaseName, formatString, o); } /** * Retrieves the localized string. - * + * * @param locale end user locale * @param resourceBundleBaseName resource bundle class name * @param formatString format string @@ -84,8 +82,8 @@ public class MessageFormatter { * @return localized string */ public static String getLocalizedString( - Locale locale, String resourceBundleBaseName, - String formatString, Object[] params) { + Locale locale, String resourceBundleBaseName, + String formatString, Object[] params) { String localizedFormat = null; @@ -100,7 +98,7 @@ public class MessageFormatter { resourceBundleBaseName, locale).getString(formatString); } catch (MissingResourceException e) { return formatString; - + } Object[] localizedParams = params; Object[] localeArg = null; @@ -108,8 +106,8 @@ public class MessageFormatter { if (params != null) { for (int i = 0; i < params.length; ++i) { if (!(params[i] instanceof String) || - !(params[i] instanceof Date) || - !(params[i] instanceof Number)) { + !(params[i] instanceof Date) || + !(params[i] instanceof Number)) { if (localizedParams == params) { // only done once @@ -121,7 +119,7 @@ public class MessageFormatter { localizedParams = new Object[params.length]; System.arraycopy(params, 0, localizedParams, 0, - params.length); + params.length); } try { Method toStringMethod = params[i].getClass().getMethod( diff --git a/pki/base/common/src/com/netscape/certsrv/base/MetaAttributeDef.java b/pki/base/common/src/com/netscape/certsrv/base/MetaAttributeDef.java index 93dd25025..9450558c1 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/MetaAttributeDef.java +++ b/pki/base/common/src/com/netscape/certsrv/base/MetaAttributeDef.java @@ -17,17 +17,15 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Enumeration; import java.util.Hashtable; import netscape.security.util.ObjectIdentifier; - /** * A class representing a meta attribute defintion. * <P> - * + * * @version $Revision$, $Date$ */ public class MetaAttributeDef { @@ -40,66 +38,66 @@ public class MetaAttributeDef { private MetaAttributeDef() { } - + /** * Constructs a MetaAttribute defintion * <P> - * + * * @param name attribute name * @param valueClass attribute value class * @param oid attribute object identifier */ private MetaAttributeDef(String name, Class<?> valueClass, - ObjectIdentifier oid) { + ObjectIdentifier oid) { mName = name; mValueClass = valueClass; mOid = oid; } - + /** * Gets an attribute OID. * <P> - * + * * @return returns attribute OID or null if not defined. */ - public ObjectIdentifier getOID() { - return mOid; + public ObjectIdentifier getOID() { + return mOid; } /** * Gets an Java class for the attribute values * <P> - * + * * @return returns Java class for the attribute values */ public Class<?> getValueClass() { - return mValueClass; + return mValueClass; } /** * Gets attribute name * <P> - * - * @return returns attribute name + * + * @return returns attribute name */ - public String getName() { - return mName; + public String getName() { + return mName; } - + /** * Registers new MetaAttribute defintion - * Attribute is defined by name, Java class for attribute values and + * Attribute is defined by name, Java class for attribute values and * optional object identifier * <P> - * + * * @param name attribute name * @param valueClass attribute value class * @param oid attribute object identifier * @exception IllegalArgumentException if name or valueClass are null, or - * conflicting attribute definition already exists + * conflicting attribute definition already exists */ public static MetaAttributeDef register(String name, Class<?> valueClass, - ObjectIdentifier oid) { + ObjectIdentifier oid) { if (name == null) { throw new IllegalArgumentException( "Attribute name must not be null"); @@ -113,13 +111,13 @@ public class MetaAttributeDef { MetaAttributeDef oldDef; if ((oldDef = (MetaAttributeDef) mNameToAttrDef.get(name)) != null && - !oldDef.equals(newDef)) { + !oldDef.equals(newDef)) { throw new IllegalArgumentException( "Attribute \'" + name + "\' is already defined"); } if (oid != null && - (oldDef = (MetaAttributeDef) mOidToAttrDef.get(oid)) != null && - !oldDef.equals(newDef)) { + (oldDef = (MetaAttributeDef) mOidToAttrDef.get(oid)) != null && + !oldDef.equals(newDef)) { throw new IllegalArgumentException( "OID \'" + oid + "\' is already in use"); } @@ -128,37 +126,37 @@ public class MetaAttributeDef { mOidToAttrDef.put(oid, newDef); } return newDef; - } - + } + /** * Compares this attribute definition with another, for equality. * <P> - * - * @return true iff names, valueClasses and object identifiers - * are identical. + * + * @return true iff names, valueClasses and object identifiers + * are identical. */ public boolean equals(Object other) { if (other == this) return true; - + if (other instanceof MetaAttributeDef) { MetaAttributeDef otherDef = (MetaAttributeDef) other; - if ((mOid != null && otherDef.mOid != null && - !mOid.equals(otherDef.mOid)) || - (mOid == null && otherDef.mOid != null) || - !mName.equals(otherDef.mName) || - !mValueClass.equals(otherDef.mValueClass)) { + if ((mOid != null && otherDef.mOid != null && + !mOid.equals(otherDef.mOid)) || + (mOid == null && otherDef.mOid != null) || + !mName.equals(otherDef.mName) || + !mValueClass.equals(otherDef.mValueClass)) { return false; } } return false; } - + /** * Retrieves attribute definition by name * <P> - * + * * @param name attribute name * @return attribute definition or null if not found */ @@ -169,7 +167,7 @@ public class MetaAttributeDef { /** * Retrieves attribute definition by object identifier * <P> - * + * * @param oid attribute object identifier * @return attribute definition or null if not found */ @@ -180,7 +178,7 @@ public class MetaAttributeDef { /** * Returns enumeration of the registered attribute names * <P> - * + * * @return returns enumeration of the registered attribute names */ public static Enumeration<String> getAttributeNames() { @@ -190,7 +188,7 @@ public class MetaAttributeDef { /** * Returns enumeration of the registered attribute object identifiers * <P> - * + * * @return returns enumeration of the attribute object identifiers */ public static Enumeration<ObjectIdentifier> getAttributeNameOids() { diff --git a/pki/base/common/src/com/netscape/certsrv/base/MetaInfo.java b/pki/base/common/src/com/netscape/certsrv/base/MetaInfo.java index 65e401743..8aed6b840 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/MetaInfo.java +++ b/pki/base/common/src/com/netscape/certsrv/base/MetaInfo.java @@ -17,17 +17,15 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Enumeration; import java.util.Hashtable; - /** * A class represents meta information. A meta information * object is just a generic hashtable that is embedded into * a request object. * <P> - * + * * @version $Revision$, $Date$ */ public class MetaInfo implements IAttrSet { @@ -41,7 +39,7 @@ public class MetaInfo implements IAttrSet { private Hashtable<String, Object> content = new Hashtable<String, Object>(); - /** + /** * Constructs a meta information. * <P> */ @@ -51,7 +49,7 @@ public class MetaInfo implements IAttrSet { /** * Returns a short string describing this certificate attribute. * <P> - * + * * @return information about this certificate attribute. */ public String toString() { @@ -69,11 +67,11 @@ public class MetaInfo implements IAttrSet { sb.append("]\n"); return sb.toString(); } - + /** * Gets an attribute value. * <P> - * + * * @param name the name of the attribute to return. * @exception EBaseException on attribute handling errors. */ @@ -83,8 +81,8 @@ public class MetaInfo implements IAttrSet { /** * Sets an attribute value. - * - * @param name the name of the attribute + * + * @param name the name of the attribute * @param obj the attribute object. * * @exception EBaseException on attribute handling errors. @@ -92,18 +90,18 @@ public class MetaInfo implements IAttrSet { public void set(String name, Object obj) throws EBaseException { content.put(name, obj); } - + /** * Deletes an attribute value from this CertAttrSet. * <P> - * + * * @param name the name of the attribute to delete. * @exception EBaseException on attribute handling errors. */ public void delete(String name) throws EBaseException { content.remove(name); } - + /** * Returns an enumeration of the names of the attributes existing within * this attribute. diff --git a/pki/base/common/src/com/netscape/certsrv/base/Nonces.java b/pki/base/common/src/com/netscape/certsrv/base/Nonces.java index fde209332..cc0231ac3 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/Nonces.java +++ b/pki/base/common/src/com/netscape/certsrv/base/Nonces.java @@ -21,14 +21,13 @@ import java.security.cert.X509Certificate; import java.util.Hashtable; import java.util.Vector; - /** * This class manages nonces sometimes used to control request state flow. * <P> - * + * * @version $Revision$, $Date$ */ -public class Nonces { +public class Nonces { private Hashtable<Long, X509Certificate> mNonces = new Hashtable<Long, X509Certificate>(); private Vector<Long> mNonceList = new Vector<Long>(); @@ -49,17 +48,17 @@ public class Nonces { long i; long k = 0; long n = nonce; - long m = (long)((mNonceLimit / 2) + 1); + long m = (long) ((mNonceLimit / 2) + 1); for (i = 0; i < m; i++) { k = n + i; // avoid collisions - if (!mNonceList.contains((Object)k)) { + if (!mNonceList.contains((Object) k)) { break; } k = n - i; // avoid collisions - if (!mNonceList.contains((Object)k)) { + if (!mNonceList.contains((Object) k)) { break; } } @@ -67,9 +66,9 @@ public class Nonces { mNonceList.add(k); mNonces.put(k, cert); if (mNonceList.size() > mNonceLimit) { - n = ((Long)(mNonceList.firstElement())).longValue(); + n = ((Long) (mNonceList.firstElement())).longValue(); mNonceList.remove(0); - mNonces.remove((Object)n); + mNonces.remove((Object) n); } } else { // failed to resolved collision @@ -79,15 +78,15 @@ public class Nonces { } public X509Certificate getCertificate(long nonce) { - X509Certificate cert = (X509Certificate)mNonces.get(nonce); + X509Certificate cert = (X509Certificate) mNonces.get(nonce); return cert; } public X509Certificate getCertificate(int index) { X509Certificate cert = null; if (index >= 0 && index < mNonceList.size()) { - long nonce = ((Long)(mNonceList.elementAt(index))).longValue(); - cert = (X509Certificate)mNonces.get(nonce); + long nonce = ((Long) (mNonceList.elementAt(index))).longValue(); + cert = (X509Certificate) mNonces.get(nonce); } return cert; } @@ -95,17 +94,16 @@ public class Nonces { public long getNonce(int index) { long nonce = 0; if (index >= 0 && index < mNonceList.size()) { - nonce = ((Long)(mNonceList.elementAt(index))).longValue(); + nonce = ((Long) (mNonceList.elementAt(index))).longValue(); } return nonce; } public void removeNonce(long nonce) { - mNonceList.remove((Object)nonce); - mNonces.remove((Object)nonce); + mNonceList.remove((Object) nonce); + mNonces.remove((Object) nonce); } - public int size() { return mNonceList.size(); } diff --git a/pki/base/common/src/com/netscape/certsrv/base/PasswordResources.java b/pki/base/common/src/com/netscape/certsrv/base/PasswordResources.java index 287ce795d..c3309c5fa 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/PasswordResources.java +++ b/pki/base/common/src/com/netscape/certsrv/base/PasswordResources.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.ListResourceBundle; - /** * A class represents a resource bundle for the password checker. * <p> - * + * * @version $Revision$, $Date$ * @see java.util.ListResourceBundle */ @@ -42,4 +40,3 @@ public class PasswordResources extends ListResourceBundle { */ static final Object[][] contents = {}; } - diff --git a/pki/base/common/src/com/netscape/certsrv/base/Plugin.java b/pki/base/common/src/com/netscape/certsrv/base/Plugin.java index e7001ce56..79fae88ac 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/Plugin.java +++ b/pki/base/common/src/com/netscape/certsrv/base/Plugin.java @@ -17,9 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - - - /** * This represents a generici CMS plugin. * <p> @@ -41,10 +38,10 @@ public class Plugin { mId = id; mClassPath = classPath; } - + /** * Returns the plugin identifier. - * + * * @return plugin id */ public String getId() { @@ -53,7 +50,7 @@ public class Plugin { /** * Returns the plugin classpath. - * + * * @return plugin classpath */ public String getClassPath() { diff --git a/pki/base/common/src/com/netscape/certsrv/base/SessionContext.java b/pki/base/common/src/com/netscape/certsrv/base/SessionContext.java index 151c24205..b4ecd1241 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/SessionContext.java +++ b/pki/base/common/src/com/netscape/certsrv/base/SessionContext.java @@ -17,22 +17,20 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.base; - import java.util.Hashtable; - /** * This class specifies the context object that includes * authentication environment and connection information. * This object is later used in access control evaluation. - * This is a global object that can be accessible - * throughout the server. It is useful for passing + * This is a global object that can be accessible + * throughout the server. It is useful for passing * global and per-thread infomration in methods. * <P> - * + * * @version $Revision$, $Date$ */ -public class SessionContext extends Hashtable<Object,Object> { +public class SessionContext extends Hashtable<Object, Object> { /** * @@ -107,12 +105,12 @@ public class SessionContext extends Hashtable<Object,Object> { } /** - * Sets the current context. This allows the - * caller to associate a specific session context + * Sets the current context. This allows the + * caller to associate a specific session context * with the current thread. * This methods makes custom session context * possible. - * + * * @param sc session context */ public static void setContext(SessionContext sc) { @@ -120,10 +118,10 @@ public class SessionContext extends Hashtable<Object,Object> { } /** - * Retrieves the session context associated with + * Retrieves the session context associated with * the current thread. If no context is associated, * a context is created. - * + * * @return sesssion context */ public static SessionContext getContext() { @@ -137,15 +135,15 @@ public class SessionContext extends Hashtable<Object,Object> { } /** - * Retrieves the session context associated with + * Retrieves the session context associated with * the current thread. If no context is associated, * null is returned. - * + * * @return sesssion context */ public static SessionContext getExistingContext() { SessionContext sc = (SessionContext) - mContexts.get(Thread.currentThread()); + mContexts.get(Thread.currentThread()); if (sc == null) { return null; |