diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/apps')
3 files changed, 531 insertions, 564 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java index 4842e0ec..137a609f 100644 --- a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java +++ b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.apps; + import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.math.BigInteger; @@ -97,15 +98,18 @@ import com.netscape.certsrv.usrgrp.IUGSubsystem; import com.netscape.cmsutil.net.ISocketFactory; import com.netscape.cmsutil.password.IPasswordStore; + /** - * This represents the CMS server. Plugins can access other public objects such - * as subsystems via this inteface. This object also include a set of utility - * functions. - * - * This object does not include the actual implementation. It acts as a public - * interface for plugins, and the actual implementation is in the CMS engine - * (com.netscape.cmscore.apps.CMSEngine) that implements ICMSEngine interface. - * + * This represents the CMS server. Plugins can access other + * public objects such as subsystems via this inteface. + * This object also include a set of utility functions. + * + * This object does not include the actual implementation. + * It acts as a public interface for plugins, and the + * actual implementation is in the CMS engine + * (com.netscape.cmscore.apps.CMSEngine) that implements + * ICMSEngine interface. + * * @version $Revision$, $Date$ */ public final class CMS { @@ -125,7 +129,7 @@ public final class CMS { public static final String SUBSYSTEM_KRA = IKeyRecoveryAuthority.ID; public static final String SUBSYSTEM_OCSP = IOCSPAuthority.ID; public static final String SUBSYSTEM_TKS = ITKSAuthority.ID; - public static final String SUBSYSTEM_UG = IUGSubsystem.ID; + public static final String SUBSYSTEM_UG = IUGSubsystem.ID; public static final String SUBSYSTEM_AUTH = IAuthSubsystem.ID; public static final String SUBSYSTEM_AUTHZ = IAuthzSubsystem.ID; public static final String SUBSYSTEM_REGISTRY = IPluginRegistry.ID; @@ -137,7 +141,7 @@ public final class CMS { /** * Private constructor. - * + * * @param engine CMS engine implementation */ private CMS(ICMSEngine engine) { @@ -145,9 +149,8 @@ public final class CMS { } /** - * This method is used for unit tests. It allows the underlying _engine to - * be stubbed out. - * + * This method is used for unit tests. It allows the underlying _engine + * to be stubbed out. * @param engine The stub engine to set, for testing. */ public static void setCMSEngine(ICMSEngine engine) { @@ -156,7 +159,7 @@ public final class CMS { /** * Gets this ID . - * + * * @return CMS engine identifier */ public static String getId() { @@ -164,9 +167,9 @@ public final class CMS { } /** - * Sets the identifier of this subsystem. Should never be called. Returns - * error. - * + * Sets the identifier of this subsystem. Should never be called. + * Returns error. + * * @param id CMS engine identifier */ public static void setId(String id) throws EBaseException { @@ -175,14 +178,14 @@ public final class CMS { /** * Initialize all static, dynamic and final static subsystems. - * + * * @param owner null * @param config main config store. - * @exception EBaseException if any error occur in subsystems during - * initialization. + * @exception EBaseException if any error occur in subsystems during + * initialization. */ - public static void init(ISubsystem owner, IConfigStore config) - throws EBaseException { + public static void init(ISubsystem owner, IConfigStore config) + throws EBaseException { _engine.init(owner, config); } @@ -192,7 +195,7 @@ public final class CMS { /** * Starts up all subsystems. subsystems must be initialized. - * + * * @exception EBaseException if any subsystem fails to startup. */ public static void startup() throws EBaseException { @@ -214,10 +217,10 @@ public final class CMS { } /** - * Checks to ensure that all new incoming requests have been blocked. This - * method is used for reentrancy protection. + * Checks to ensure that all new incoming requests have been blocked. + * This method is used for reentrancy protection. * <P> - * + * * @return true or false */ public static boolean areRequestsDisabled() { @@ -225,33 +228,34 @@ public final class CMS { } /** - * Shuts down subsystems in backwards order exceptions are ignored. process - * exists at end to force exit. + * Shuts down subsystems in backwards order + * exceptions are ignored. process exists at end to force exit. */ public static void shutdown() { _engine.shutdown(); } /** - * Shuts down subsystems in backwards order exceptions are ignored. process - * exists at end to force exit. + * Shuts down subsystems in backwards order + * exceptions are ignored. process exists at end to force exit. */ - public static void forceShutdown() { + public static void forceShutdown() { - _engine.forceShutdown(); - } + _engine.forceShutdown(); + } - /** - * mode = 0 (pre-operational) mode = 1 (running) - */ - public static void setCSState(int mode) { - _engine.setCSState(mode); - } + /** + * mode = 0 (pre-operational) + * mode = 1 (running) + */ + public static void setCSState(int mode) { + _engine.setCSState(mode); + } - public static int getCSState() { - return _engine.getCSState(); - } + public static int getCSState() { + return _engine.getCSState(); + } public static boolean isPreOpMode() { return _engine.isPreOpMode(); @@ -262,9 +266,10 @@ public final class CMS { } /** - * Is the server in running state. After server startup, the server will be - * initialization state first. After the initialization state, the server - * will be in the running state. + * Is the server in running state. After server startup, the + * server will be initialization state first. After the + * initialization state, the server will be in the running + * state. * * @return true if the server is in the running state */ @@ -273,9 +278,10 @@ public final class CMS { } /** - * Returns the logger of the current server. The logger can be used to log - * critical informational or critical error messages. - * + * Returns the logger of the current server. The logger can + * be used to log critical informational or critical error + * messages. + * * @return logger */ public static ILogger getLogger() { @@ -283,9 +289,10 @@ public final class CMS { } /** - * Returns the signed audit logger of the current server. This logger can be - * used to log critical informational or critical error messages. - * + * Returns the signed audit logger of the current server. This logger can + * be used to log critical informational or critical error + * messages. + * * @return signed audit logger */ public static ILogger getSignedAuditLogger() { @@ -294,7 +301,7 @@ public final class CMS { /** * Creates a repository record in the internal database. - * + * * @return repository record */ public static IRepositoryRecord createRepositoryRecord() { @@ -303,10 +310,8 @@ public final class CMS { /** * Parse ACL resource attributes - * * @param resACLs same format as the resourceACLs attribute: - * - * <PRE> + * <PRE> * <resource name>:<permission1,permission2,...permissionn>: * <allow|deny> (<subset of the permission set>) <evaluator expression> * </PRE> @@ -319,18 +324,16 @@ public final class CMS { /** * Creates an issuing poing record. - * + * * @return issuing record */ - public static ICRLIssuingPointRecord createCRLIssuingPointRecord(String id, - BigInteger crlNumber, Long crlSize, Date thisUpdate, Date nextUpdate) { - return _engine.createCRLIssuingPointRecord(id, crlNumber, crlSize, - thisUpdate, nextUpdate); + public static ICRLIssuingPointRecord createCRLIssuingPointRecord(String id, BigInteger crlNumber, Long crlSize, Date thisUpdate, Date nextUpdate) { + return _engine.createCRLIssuingPointRecord(id, crlNumber, crlSize, thisUpdate, nextUpdate); } /** * Retrieves the default CRL issuing point record name. - * + * * @return CRL issuing point record name */ public static String getCRLIssuingPointRecordName() { @@ -339,7 +342,7 @@ public final class CMS { /** * Retrieves the process id of this server. - * + * * @return process id of the server */ public static int getpid() { @@ -348,7 +351,7 @@ public final class CMS { /** * Retrieves the instance roort path of this server. - * + * * @return instance directory path name */ public static String getInstanceDir() { @@ -356,9 +359,9 @@ public final class CMS { } /** - * Returns a server wide system time. Plugins should call this method to - * retrieve system time. - * + * Returns a server wide system time. Plugins should call + * this method to retrieve system time. + * * @return current time */ public static Date getCurrentDate() { @@ -369,7 +372,7 @@ public final class CMS { /** * Puts data of an byte array into the debug file. - * + * * @param data byte array to be recorded in the debug file */ public static void debug(byte data[]) { @@ -379,7 +382,7 @@ public final class CMS { /** * Puts a message into the debug file. - * + * * @param msg debugging message */ public static void debug(String msg) { @@ -389,7 +392,7 @@ public final class CMS { /** * Puts a message into the debug file. - * + * * @param level 0-10 (0 is less detail, 10 is more detail) * @param msg debugging message */ @@ -400,7 +403,7 @@ public final class CMS { /** * Puts an exception into the debug file. - * + * * @param e exception */ public static void debug(Throwable e) { @@ -410,7 +413,7 @@ public final class CMS { /** * Checks if the debug mode is on or not. - * + * * @return true if debug mode is on */ public static boolean debugOn() { @@ -427,46 +430,42 @@ public final class CMS { _engine.debugStackTrace(); } - /* - * If debugging for the particular realm is enabled, output name/value pair - * info to the debug file. This is useful to dump out what hidden config - * variables the server is looking at, or what HTTP variables it is - * expecting to find, or what database attributes it is looking for. - * - * @param type indicates what the source of key/val is. For example, this - * could be 'CS.cfg', or something else. In the debug subsystem, there is a - * mechanism to filter this so only the types you care about are listed - * - * @param key the 'key' of the hashtable which is being accessed. This could - * be the name of the config parameter, or the http param name. - * - * @param val the value of the parameter - * + /* + * If debugging for the particular realm is enabled, output name/value + * pair info to the debug file. This is useful to dump out what hidden + * config variables the server is looking at, or what HTTP variables it + * is expecting to find, or what database attributes it is looking for. + * @param type indicates what the source of key/val is. For example, + * this could be 'CS.cfg', or something else. In the debug + * subsystem, there is a mechanism to filter this so only the types + * you care about are listed + * @param key the 'key' of the hashtable which is being accessed. + * This could be the name of the config parameter, or the http param + * name. + * @param val the value of the parameter * @param default the default value if the param is not found - */ + */ public static void traceHashKey(String type, String key) { if (_engine != null) { - _engine.traceHashKey(type, key); - } - } - + _engine.traceHashKey(type, key); + } + } public static void traceHashKey(String type, String key, String val) { if (_engine != null) { - _engine.traceHashKey(type, key, val); - } - } - - public static void traceHashKey(String type, String key, String val, - String def) { + _engine.traceHashKey(type, key, val); + } + } + public static void traceHashKey(String type, String key, String val, String def) { if (_engine != null) { - _engine.traceHashKey(type, key, val, def); - } - } + _engine.traceHashKey(type, key, val, def); + } + } + /** * Returns the names of all the registered subsystems. - * + * * @return a list of string-based subsystem names */ public static Enumeration getSubsystemNames() { @@ -479,7 +478,7 @@ public final class CMS { /** * Returns all the registered subsystems. - * + * * @return a list of ISubsystem-based subsystems */ public static Enumeration getSubsystems() { @@ -488,7 +487,7 @@ public final class CMS { /** * Retrieves the registered subsytem with the given name. - * + * * @param name subsystem name * @return subsystem of the given name */ @@ -498,7 +497,7 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param msgID message id defined in UserMessages.properties * @return localized user message */ @@ -510,7 +509,7 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @return localized user message @@ -523,7 +522,7 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter * @return localized user message @@ -531,13 +530,12 @@ public final class CMS { public static String getUserMessage(String msgID, String p1) { if (_engine == null) return msgID; - return _engine.getUserMessage(null /* from session context */, msgID, - p1); + return _engine.getUserMessage(null /* from session context */, msgID, p1); } /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter @@ -551,7 +549,7 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -560,21 +558,19 @@ public final class CMS { public static String getUserMessage(String msgID, String p1, String p2) { if (_engine == null) return msgID; - return _engine.getUserMessage(null /* from session context */, msgID, - p1, p2); + return _engine.getUserMessage(null /* from session context */, msgID, p1, p2); } /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter * @param p2 2nd parameter * @return localized user message */ - public static String getUserMessage(Locale locale, String msgID, String p1, - String p2) { + public static String getUserMessage(Locale locale, String msgID, String p1, String p2) { if (_engine == null) return msgID; return _engine.getUserMessage(locale, msgID, p1, p2); @@ -582,31 +578,30 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter * @param p2 2nd parameter * @param p3 3rd parameter * @return localized user message */ - public static String getUserMessage(String msgID, String p1, String p2, - String p3) { + public static String getUserMessage(String msgID, String p1, String p2, String p3) { if (_engine == null) return msgID; - return _engine.getUserMessage(null /* from session context */, msgID, - p1, p2, p3); + return _engine.getUserMessage(null /* from session context */, msgID, p1, p2, p3); } public static LDAPConnection getBoundConnection(String host, int port, - int version, LDAPSSLSocketFactoryExt fac, String bindDN, - String bindPW) throws LDAPException { - return _engine.getBoundConnection(host, port, version, fac, bindDN, - bindPW); + int version, LDAPSSLSocketFactoryExt fac, String bindDN, + String bindPW) throws LDAPException + { + return _engine.getBoundConnection(host, port, version, fac, + bindDN, bindPW); } /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter @@ -614,8 +609,7 @@ public final class CMS { * @param p3 3rd parameter * @return localized user message */ - public static String getUserMessage(Locale locale, String msgID, String p1, - String p2, String p3) { + public static String getUserMessage(Locale locale, String msgID, String p1, String p2, String p3) { if (_engine == null) return msgID; return _engine.getUserMessage(locale, msgID, p1, p2, p3); @@ -623,7 +617,7 @@ public final class CMS { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param msgID message id defined in UserMessages.properties * @param p an array of parameters * @return localized user message @@ -631,13 +625,12 @@ public final class CMS { public static String getUserMessage(String msgID, String p[]) { if (_engine == null) return msgID; - return _engine - .getUserMessage(null /* from session context */, msgID, p); + return _engine.getUserMessage(null /* from session context */, msgID, p); } /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p an array of parameters @@ -651,7 +644,7 @@ public final class CMS { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @return localized log message */ @@ -661,7 +654,7 @@ public final class CMS { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p an array of parameters * @return localized log message @@ -672,7 +665,7 @@ public final class CMS { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @return localized log message @@ -683,7 +676,7 @@ public final class CMS { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -695,21 +688,20 @@ public final class CMS { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter * @param p3 3rd parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3) { + public static String getLogMessage(String msgID, String p1, String p2, String p3) { return _engine.getLogMessage(msgID, p1, p2, p3); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -717,14 +709,13 @@ public final class CMS { * @param p4 4th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4) { return _engine.getLogMessage(msgID, p1, p2, p3, p4); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -733,14 +724,13 @@ public final class CMS { * @param p5 5th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4, String p5) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5) { return _engine.getLogMessage(msgID, p1, p2, p3, p4, p5); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -750,14 +740,13 @@ public final class CMS { * @param p6 6th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4, String p5, String p6) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6) { return _engine.getLogMessage(msgID, p1, p2, p3, p4, p5, p6); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -768,14 +757,13 @@ public final class CMS { * @param p7 7th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4, String p5, String p6, String p7) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7) { return _engine.getLogMessage(msgID, p1, p2, p3, p4, p5, p6, p7); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -787,14 +775,13 @@ public final class CMS { * @param p8 8th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4, String p5, String p6, String p7, String p8) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8) { return _engine.getLogMessage(msgID, p1, p2, p3, p4, p5, p6, p7, p8); } /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -807,15 +794,13 @@ public final class CMS { * @param p9 9th parameter * @return localized log message */ - public static String getLogMessage(String msgID, String p1, String p2, - String p3, String p4, String p5, String p6, String p7, String p8, - String p9) { + public static String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) { return _engine.getLogMessage(msgID, p1, p2, p3, p4, p5, p6, p7, p8, p9); } /** * Returns the main config store. It is a handle to CMS.cfg. - * + * * @return configuration store */ public static IConfigStore getConfigStore() { @@ -824,7 +809,7 @@ public final class CMS { /** * Retrieves time server started up. - * + * * @return last startup time */ public static long getStartupTime() { @@ -833,41 +818,41 @@ public final class CMS { /** * Retrieves the HTTP Connection for use with connector. - * + * * @param authority remote authority * @param factory socket factory * @return http connection to the remote authority */ - public static IHttpConnection getHttpConnection(IRemoteAuthority authority, - ISocketFactory factory) { + public static IHttpConnection getHttpConnection(IRemoteAuthority authority, + ISocketFactory factory) { return _engine.getHttpConnection(authority, factory); } /** * Retrieves the HTTP Connection for use with connector. - * + * * @param authority remote authority * @param factory socket factory * @param timeout return error if connection cannot be established within - * the timeout period + * the timeout period * @return http connection to the remote authority */ - public static IHttpConnection getHttpConnection(IRemoteAuthority authority, - ISocketFactory factory, int timeout) { + public static IHttpConnection getHttpConnection(IRemoteAuthority authority, + ISocketFactory factory, int timeout) { return _engine.getHttpConnection(authority, factory, timeout); } /** * Retrieves the request sender for use with connector. - * + * * @param authority local authority * @param nickname nickname of the client certificate * @param remote remote authority * @param interval timeout interval * @return resender */ - public static IResender getResender(IAuthority authority, String nickname, - IRemoteAuthority remote, int interval) { + public static IResender getResender(IAuthority authority, String nickname, + IRemoteAuthority remote, int interval) { return _engine.getResender(authority, nickname, remote, interval); } @@ -882,7 +867,7 @@ public final class CMS { /** * Sets the nickname of the server's server certificate. - * + * * @param tokenName name of token where the certificate is located * @param nickName name of server certificate */ @@ -892,7 +877,7 @@ public final class CMS { /** * Sets the nickname of the server's server certificate. - * + * * @param newName new nickname of server certificate */ public static void setServerCertNickname(String newName) { @@ -901,7 +886,7 @@ public final class CMS { /** * Retrieves the host name of the server's secure end entity service. - * + * * @return host name of end-entity service */ public static String getEEHost() { @@ -910,7 +895,7 @@ public final class CMS { /** * Retrieves the host name of the server's non-secure end entity service. - * + * * @return host name of end-entity non-secure service */ public static String getEENonSSLHost() { @@ -919,7 +904,7 @@ public final class CMS { /** * Retrieves the IP address of the server's non-secure end entity service. - * + * * @return ip address of end-entity non-secure service */ public static String getEENonSSLIP() { @@ -928,7 +913,7 @@ public final class CMS { /** * Retrieves the port number of the server's non-secure end entity service. - * + * * @return port of end-entity non-secure service */ public static String getEENonSSLPort() { @@ -937,7 +922,7 @@ public final class CMS { /** * Retrieves the host name of the server's secure end entity service. - * + * * @return port of end-entity secure service */ public static String getEESSLHost() { @@ -946,7 +931,7 @@ public final class CMS { /** * Retrieves the host name of the server's secure end entity service. - * + * * @return port of end-entity secure service */ public static String getEEClientAuthSSLPort() { @@ -955,7 +940,7 @@ public final class CMS { /** * Retrieves the IP address of the server's secure end entity service. - * + * * @return ip address of end-entity secure service */ public static String getEESSLIP() { @@ -964,7 +949,7 @@ public final class CMS { /** * Retrieves the port number of the server's secure end entity service. - * + * * @return port of end-entity secure service */ public static String getEESSLPort() { @@ -973,7 +958,7 @@ public final class CMS { /** * Retrieves the host name of the server's agent service. - * + * * @return host name of agent service */ public static String getAgentHost() { @@ -982,7 +967,7 @@ public final class CMS { /** * Retrieves the IP address of the server's agent service. - * + * * @return ip address of agent service */ public static String getAgentIP() { @@ -991,7 +976,7 @@ public final class CMS { /** * Retrieves the port number of the server's agent service. - * + * * @return port of agent service */ public static String getAgentPort() { @@ -1000,7 +985,7 @@ public final class CMS { /** * Retrieves the host name of the server's administration service. - * + * * @return host name of administration service */ public static String getAdminHost() { @@ -1009,7 +994,7 @@ public final class CMS { /** * Retrieves the IP address of the server's administration service. - * + * * @return ip address of administration service */ public static String getAdminIP() { @@ -1018,7 +1003,7 @@ public final class CMS { /** * Retrieves the port number of the server's administration service. - * + * * @return port of administration service */ public static String getAdminPort() { @@ -1027,27 +1012,26 @@ public final class CMS { /** * Creates a general name constraints. - * + * * @param generalNameChoice type of general name * @param value general name string * @return general name object * @exception EBaseException failed to create general name constraint */ - public static GeneralName form_GeneralNameAsConstraints( - String generalNameChoice, String value) throws EBaseException { + public static GeneralName form_GeneralNameAsConstraints(String generalNameChoice, String value) throws EBaseException { return _engine.form_GeneralName(generalNameChoice, value); } /** * Creates a general name. - * + * * @param generalNameChoice type of general name * @param value general name string * @return general name object * @exception EBaseException failed to create general name */ public static GeneralName form_GeneralName(String generalNameChoice, - String value) throws EBaseException { + String value) throws EBaseException { return _engine.form_GeneralName(generalNameChoice, value); } @@ -1057,195 +1041,193 @@ public final class CMS { * @param name configuration name * @param params configuration parameters */ - public static void getSubjAltNameConfigDefaultParams(String name, - Vector params) { + public static void getSubjAltNameConfigDefaultParams(String name, + Vector params) { _engine.getSubjAltNameConfigDefaultParams(name, params); } /** * Get extended plugin info for subject alt name configuration. - * + * * @param name configuration name * @param params configuration parameters */ - public static void getSubjAltNameConfigExtendedPluginInfo(String name, - Vector params) { + public static void getSubjAltNameConfigExtendedPluginInfo(String name, + Vector params) { _engine.getSubjAltNameConfigExtendedPluginInfo(name, params); } /** * Creates subject alt name configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @exception EBaseException failed to create subject alt name configuration */ - public static ISubjAltNameConfig createSubjAltNameConfig(String name, - IConfigStore config, boolean isValueConfigured) - throws EBaseException { - return _engine.createSubjAltNameConfig(name, config, isValueConfigured); + public static ISubjAltNameConfig createSubjAltNameConfig(String name, IConfigStore config, boolean isValueConfigured) throws EBaseException { + return _engine.createSubjAltNameConfig( + name, config, isValueConfigured); } /** * Retrieves default general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param params configuration parameters * @exception EBaseException failed to create subject alt name configuration */ public static void getGeneralNameConfigDefaultParams(String name, - boolean isValueConfigured, Vector params) { - _engine.getGeneralNameConfigDefaultParams(name, isValueConfigured, - params); + boolean isValueConfigured, Vector params) { + _engine.getGeneralNameConfigDefaultParams(name, + isValueConfigured, params); } /** * Retrieves default general names configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param params configuration parameters * @exception EBaseException failed to create subject alt name configuration */ public static void getGeneralNamesConfigDefaultParams(String name, - boolean isValueConfigured, Vector params) { - _engine.getGeneralNamesConfigDefaultParams(name, isValueConfigured, - params); + boolean isValueConfigured, Vector params) { + _engine.getGeneralNamesConfigDefaultParams(name, + isValueConfigured, params); } /** * Retrieves extended plugin info for general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param info configuration parameters * @exception EBaseException failed to create subject alt name configuration */ public static void getGeneralNameConfigExtendedPluginInfo(String name, - boolean isValueConfigured, Vector info) { - _engine.getGeneralNameConfigExtendedPluginInfo(name, isValueConfigured, - info); + boolean isValueConfigured, Vector info) { + _engine.getGeneralNameConfigExtendedPluginInfo(name, + isValueConfigured, info); } /** * Retrieves extended plugin info for general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param info configuration parameters * @exception EBaseException failed to create subject alt name configuration */ public static void getGeneralNamesConfigExtendedPluginInfo(String name, - boolean isValueConfigured, Vector info) { + boolean isValueConfigured, Vector info) { _engine.getGeneralNamesConfigExtendedPluginInfo(name, - isValueConfigured, info); + isValueConfigured, info); } /** * Created general names configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public static IGeneralNamesConfig createGeneralNamesConfig(String name, - IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException { - return _engine.createGeneralNamesConfig(name, config, - isValueConfigured, isPolicyEnabled); + public static IGeneralNamesConfig createGeneralNamesConfig(String name, + IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException { + return _engine.createGeneralNamesConfig(name, config, isValueConfigured, + isPolicyEnabled); } /** * Created general name constraints configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public static IGeneralNameAsConstraintsConfig createGeneralNameAsConstraintsConfig( - String name, IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException { - return _engine.createGeneralNameAsConstraintsConfig(name, config, - isValueConfigured, isPolicyEnabled); + public static IGeneralNameAsConstraintsConfig createGeneralNameAsConstraintsConfig(String name, IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException { + return _engine.createGeneralNameAsConstraintsConfig( + name, config, isValueConfigured, isPolicyEnabled); } /** * Created general name constraints configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public static IGeneralNamesAsConstraintsConfig createGeneralNamesAsConstraintsConfig( - String name, IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException { - return _engine.createGeneralNamesAsConstraintsConfig(name, config, - isValueConfigured, isPolicyEnabled); + public static IGeneralNamesAsConstraintsConfig createGeneralNamesAsConstraintsConfig(String name, IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException { + return _engine.createGeneralNamesAsConstraintsConfig( + name, config, isValueConfigured, isPolicyEnabled); } /** * Returns the finger print of the given certificate. - * - * @param cert certificate + * + * @param cert certificate * @return finger print of certificate */ public static String getFingerPrint(Certificate cert) - throws CertificateEncodingException, NoSuchAlgorithmException { + throws CertificateEncodingException, NoSuchAlgorithmException { return _engine.getFingerPrint(cert); } /** * Returns the finger print of the given certificate. - * - * @param certDer DER byte array of the certificate + * + * @param certDer DER byte array of the certificate * @return finger print of certificate */ public static String getFingerPrints(byte[] certDer) - throws NoSuchAlgorithmException { + throws NoSuchAlgorithmException { return _engine.getFingerPrints(certDer); } /** * Returns the finger print of the given certificate. - * - * @param cert certificate + * + * @param cert certificate * @return finger print of certificate */ public static String getFingerPrints(Certificate cert) - throws NoSuchAlgorithmException, CertificateEncodingException { + throws NoSuchAlgorithmException, CertificateEncodingException { return _engine.getFingerPrints(cert); } - /** - * Creates a HTTP PKI Message that can be sent to a remote authority. - * + /** + * Creates a HTTP PKI Message that can be sent to a remote + * authority. + * * @return a new PKI Message for remote authority */ public static IPKIMessage getHttpPKIMessage() { return _engine.getHttpPKIMessage(); } - /** - * Creates a request encoder. A request cannot be sent to the remote - * authority in its regular format. - * + /** + * Creates a request encoder. A request cannot be sent to + * the remote authority in its regular format. + * * @return a request encoder */ public static IRequestEncoder getHttpRequestEncoder() { return _engine.getHttpRequestEncoder(); } - /** + /** * Converts a BER-encoded byte array into a MIME-64 encoded string. - * + * * @param data data in byte array format * @return base-64 encoding for the data */ @@ -1253,9 +1235,9 @@ public final class CMS { return _engine.BtoA(data); } - /** + /** * Converts a MIME-64 encoded string into a BER-encoded byte array. - * + * * @param data base-64 encoding for the data * @return data data in byte array format */ @@ -1264,40 +1246,42 @@ public final class CMS { } /** - * Retrieves the ldap connection information from the configuration store. - * + * Retrieves the ldap connection information from the configuration + * store. + * * @param config configuration parameters of ldap connection * @return a LDAP connection info */ public static ILdapConnInfo getLdapConnInfo(IConfigStore config) - throws EBaseException, ELdapException { + throws EBaseException, ELdapException { return _engine.getLdapConnInfo(config); } /** - * Creates a LDAP SSL socket with the given nickname. The certificate - * associated with the nickname will be used for client authentication. - * + * Creates a LDAP SSL socket with the given nickname. The + * certificate associated with the nickname will be used + * for client authentication. + * * @param certNickname nickname of client certificate * @return LDAP SSL socket factory */ - public static LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory( - String certNickname) { + public static LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory( + String certNickname) { return _engine.getLdapJssSSLSocketFactory(certNickname); } /** * Creates a LDAP SSL socket. - * + * * @return LDAP SSL socket factory */ - public static LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory() { + public static LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory() { return _engine.getLdapJssSSLSocketFactory(); } /** * Creates a LDAP Auth Info object. - * + * * @return LDAP authentication info */ public static ILdapAuthInfo getLdapAuthInfo() { @@ -1306,27 +1290,27 @@ public final class CMS { /** * Retrieves the LDAP connection factory. - * + * * @return bound LDAP connection pool */ public static ILdapConnFactory getLdapBoundConnFactory() - throws ELdapException { + throws ELdapException { return _engine.getLdapBoundConnFactory(); } /** * Retrieves the LDAP connection factory. - * + * * @return anonymous LDAP connection pool */ public static ILdapConnFactory getLdapAnonConnFactory() - throws ELdapException { + throws ELdapException { return _engine.getLdapAnonConnFactory(); } /** * Retrieves the default X.509 certificate template. - * + * * @return default certificate template */ public static X509CertInfo getDefaultX509CertInfo() { @@ -1334,9 +1318,9 @@ public final class CMS { } /** - * Retrieves the certifcate in MIME-64 encoded format with header and - * footer. - * + * Retrieves the certifcate in MIME-64 encoded format + * with header and footer. + * * @param cert certificate * @return base-64 format certificate */ @@ -1344,26 +1328,26 @@ public final class CMS { return _engine.getEncodedCert(cert); } - /** - * Verifies all system certs with tags defined in <subsystemtype>.cert.list - */ + /** + * Verifies all system certs + * with tags defined in <subsystemtype>.cert.list + */ public static boolean verifySystemCerts() { return _engine.verifySystemCerts(); } - /** - * Verify a system cert by tag name with tags defined in - * <subsystemtype>.cert.list - */ + /** + * Verify a system cert by tag name + * with tags defined in <subsystemtype>.cert.list + */ public static boolean verifySystemCertByTag(String tag) { return _engine.verifySystemCertByTag(tag); } - /** - * Verify a system cert by certificate nickname - */ - public static boolean verifySystemCertByNickname(String nickname, - String certificateUsage) { + /** + * Verify a system cert by certificate nickname + */ + public static boolean verifySystemCertByNickname(String nickname, String certificateUsage) { return _engine.verifySystemCertByNickname(nickname, certificateUsage); } @@ -1376,7 +1360,7 @@ public final class CMS { /** * Checks if the given certificate is a signing certificate. - * + * * @param cert certificate * @return true if the given certificate is a signing certificate */ @@ -1386,7 +1370,7 @@ public final class CMS { /** * Checks if the given certificate is an encryption certificate. - * + * * @param cert certificate * @return true if the given certificate is an encryption certificate */ @@ -1396,7 +1380,7 @@ public final class CMS { /** * Retrieves the email form processor. - * + * * @return email form processor */ public static IEmailFormProcessor getEmailFormProcessor() { @@ -1405,7 +1389,7 @@ public final class CMS { /** * Retrieves the email form template. - * + * * @return email template */ public static IEmailTemplate getEmailTemplate(String path) { @@ -1414,7 +1398,7 @@ public final class CMS { /** * Retrieves the email notification handler. - * + * * @return email notification */ public static IMailNotification getMailNotification() { @@ -1423,7 +1407,7 @@ public final class CMS { /** * Retrieves the email key resolver. - * + * * @return email key resolver */ public static IEmailResolverKeys getEmailResolverKeys() { @@ -1432,19 +1416,19 @@ public final class CMS { /** * Checks if the given OID is valid. - * + * * @param attrName attribute name * @param value attribute value * @return object identifier of the given attrName */ - public static ObjectIdentifier checkOID(String attrName, String value) - throws EBaseException { + public static ObjectIdentifier checkOID(String attrName, String value) + throws EBaseException { return _engine.checkOID(attrName, value); } /** * Retrieves the email resolver that checks for subjectAlternateName. - * + * * @return email key resolver */ public static IEmailResolver getReqCertSANameEmailResolver() { @@ -1453,7 +1437,7 @@ public final class CMS { /** * Retrieves the extension pretty print handler. - * + * * @param e extension * @param indent indentation * @return extension pretty print handler @@ -1461,10 +1445,10 @@ public final class CMS { public static IExtPrettyPrint getExtPrettyPrint(Extension e, int indent) { return _engine.getExtPrettyPrint(e, indent); } - + /** * Retrieves the certificate pretty print handler. - * + * * @param delimiter delimiter * @return certificate pretty print handler */ @@ -1474,7 +1458,7 @@ public final class CMS { /** * Retrieves the CRL pretty print handler. - * + * * @param crl CRL * @return CRL pretty print handler */ @@ -1484,7 +1468,7 @@ public final class CMS { /** * Retrieves the CRL cache pretty print handler. - * + * * @param ip CRL issuing point * @return CRL pretty print handler */ @@ -1494,7 +1478,7 @@ public final class CMS { /** * Retrieves the certificate pretty print handler. - * + * * @param cert certificate * @return certificate pretty print handler */ @@ -1512,7 +1496,7 @@ public final class CMS { /** * Retrieves the password check. - * + * * @return default password checker */ public static IPasswordCheck getPasswordChecker() { @@ -1521,7 +1505,7 @@ public final class CMS { /** * Puts a password entry into the single-sign on cache. - * + * * @param tag password tag * @param pw password */ @@ -1540,7 +1524,7 @@ public final class CMS { /** * Retrieves command queue - * + * * @return command queue */ public static ICommandQueue getCommandQueue() { @@ -1549,28 +1533,33 @@ public final class CMS { /** * Loads the configuration file and starts CMS's core implementation. - * + * * @param path path to configuration file (CMS.cfg) * @exception EBaseException failed to start CMS */ public static void start(String path) throws EBaseException { - // FileConfigStore mainConfig = null; - /* - * try { mainConfig = new FileConfigStore(path); } catch (EBaseException - * e) { e.printStackTrace(); System.out.println( - * "Error: The Server is not fully configured.\n" + - * "Finish configuring server using Configure Setup Wizard in " + - * "the Certificate Server Console."); System.out.println(e.toString()); - * System.exit(0); } - */ + //FileConfigStore mainConfig = null; +/* + try { + mainConfig = new FileConfigStore(path); + } catch (EBaseException e) { + e.printStackTrace(); + System.out.println( + "Error: The Server is not fully configured.\n" + + "Finish configuring server using Configure Setup Wizard in " + + "the Certificate Server Console."); + System.out.println(e.toString()); + System.exit(0); + } +*/ String classname = "com.netscape.cmscore.apps.CMSEngine"; CMS cms = null; try { - ICMSEngine engine = (ICMSEngine) Class.forName(classname) - .newInstance(); + ICMSEngine engine = (ICMSEngine) + Class.forName(classname).newInstance(); cms = new CMS(engine); IConfigStore mainConfig = createFileConfigStore(path); @@ -1579,16 +1568,16 @@ public final class CMS { } catch (EBaseException e) { // catch everything here purposely CMS.debug("CMS:Caught EBaseException"); - CMS.debug(e); + CMS.debug(e); - // Raidzilla Bug #57592: Always print error message to stdout. + // Raidzilla Bug #57592: Always print error message to stdout. System.out.println(e.toString()); shutdown(); throw e; - } catch (Exception e) { // catch everything here purposely - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(bos); + } catch (Exception e) { // catch everything here purposely + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(bos); e.printStackTrace(ps); System.out.println(Constants.SERVER_SHUTDOWN_MESSAGE); @@ -1597,8 +1586,7 @@ public final class CMS { } } - public static IConfigStore createFileConfigStore(String path) - throws EBaseException { + public static IConfigStore createFileConfigStore(String path) throws EBaseException { return _engine.createFileConfigStore(path); } @@ -1618,11 +1606,10 @@ public final class CMS { return _engine.isRevoked(certificates); } - public static void setListOfVerifiedCerts(int size, long interval, - long unknownStateInterval) { + public static void setListOfVerifiedCerts(int size, long interval, long unknownStateInterval) { _engine.setListOfVerifiedCerts(size, interval, unknownStateInterval); } - + public static IPasswordStore getPasswordStore() { return _engine.getPasswordStore(); } diff --git a/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java b/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java index 7a4e13c0..506a5e33 100644 --- a/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java +++ b/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.apps; + import java.math.BigInteger; import java.security.NoSuchAlgorithmException; import java.security.cert.Certificate; @@ -80,135 +81,135 @@ import com.netscape.cmsutil.net.ISocketFactory; import com.netscape.cmsutil.password.IPasswordStore; /** - * This interface represents the CMS core framework. The framework contains a - * set of services that provide the foundation of a security application. + * This interface represents the CMS core framework. The + * framework contains a set of services that provide + * the foundation of a security application. * <p> - * The engine implementation is loaded by CMS at startup. It is responsible for - * starting up all the related subsystems. + * The engine implementation is loaded by CMS at startup. + * It is responsible for starting up all the related + * subsystems. * <p> - * + * * @version $Revision$, $Date$ */ public interface ICMSEngine extends ISubsystem { /** * Gets this ID . - * + * * @return CMS engine identifier */ public String getId(); /** - * Sets the identifier of this subsystem. Should never be called. Returns - * error. - * + * Sets the identifier of this subsystem. Should never be called. + * Returns error. + * * @param id CMS engine identifier */ public void setId(String id) throws EBaseException; /** * Retrieves the process id of this server. - * + * * @return process id of the server */ public int getpid(); public void reinit(String id) throws EBaseException; - public int getCSState(); - public void setCSState(int mode); - public boolean isPreOpMode(); - public boolean isRunningMode(); - /** * Retrieves the instance roort path of this server. - * + * * @return instance directory path name */ public String getInstanceDir(); /** - * Returns a server wide system time. Plugins should call this method to - * retrieve system time. - * + * Returns a server wide system time. Plugins should call + * this method to retrieve system time. + * * @return current time */ public Date getCurrentDate(); /** * Retrieves time server started up. - * + * * @return last startup time */ public long getStartupTime(); /** - * Is the server in running state. After server startup, the server will be - * initialization state first. After the initialization state, the server - * will be in the running state. - * + * Is the server in running state. After server startup, the + * server will be initialization state first. After the + * initialization state, the server will be in the running + * state. + * * @return true if the server is in the running state */ public boolean isInRunningState(); /** * Returns the names of all the registered subsystems. - * + * * @return a list of string-based subsystem names */ public Enumeration getSubsystemNames(); /** * Returns all the registered subsystems. - * + * * @return a list of ISubsystem-based subsystems */ public Enumeration getSubsystems(); /** * Retrieves the registered subsytem with the given name. - * + * * @param name subsystem name * @return subsystem of the given name */ public ISubsystem getSubsystem(String name); /** - * Returns the logger of the current server. The logger can be used to log - * critical informational or critical error messages. - * + * Returns the logger of the current server. The logger can + * be used to log critical informational or critical error + * messages. + * * @return logger */ public ILogger getLogger(); /** - * Returns the signed audit logger of the current server. This logger can be - * used to log critical informational or critical error messages. - * + * Returns the signed audit logger of the current server. This logger can + * be used to log critical informational or critical error + * messages. + * * @return signed audit logger */ public ILogger getSignedAuditLogger(); /** * Puts data of an byte array into the debug file. - * + * * @param data byte array to be recorded in the debug file */ public void debug(byte data[]); /** * Puts a message into the debug file. - * + * * @param msg debugging message */ public void debug(String msg); /** * Puts a message into the debug file. - * + * * @param level 0-10 * @param msg debugging message */ @@ -216,14 +217,14 @@ public interface ICMSEngine extends ISubsystem { /** * Puts an exception into the debug file. - * + * * @param e exception */ public void debug(Throwable e); /** * Checks if the debug mode is on or not. - * + * * @return true if debug mode is on */ public boolean debugOn(); @@ -233,20 +234,20 @@ public interface ICMSEngine extends ISubsystem { */ public void debugStackTrace(); - /** - * Dump name/value pair debug information to debug file - */ + + /** + * Dump name/value pair debug information to debug file + */ public void traceHashKey(String type, String key); - public void traceHashKey(String type, String key, String val); - public void traceHashKey(String type, String key, String val, String def); + public byte[] getPKCS7(Locale locale, IRequest req); /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @return localized user message @@ -255,7 +256,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p an array of parameters @@ -265,7 +266,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter @@ -275,19 +276,18 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter * @param p2 2nd parameter * @return localized user message */ - public String getUserMessage(Locale locale, String msgID, String p1, - String p2); + public String getUserMessage(Locale locale, String msgID, String p1, String p2); /** * Retrieves the localized user message from UserMessages.properties. - * + * * @param locale end-user locale * @param msgID message id defined in UserMessages.properties * @param p1 1st parameter @@ -295,12 +295,11 @@ public interface ICMSEngine extends ISubsystem { * @param p3 3rd parameter * @return localized user message */ - public String getUserMessage(Locale locale, String msgID, String p1, - String p2, String p3); + public String getUserMessage(Locale locale, String msgID, String p1, String p2, String p3); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @return localized log message */ @@ -308,7 +307,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p an array of parameters * @return localized log message @@ -317,7 +316,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @return localized log message @@ -326,7 +325,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -336,7 +335,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -347,7 +346,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -355,12 +354,11 @@ public interface ICMSEngine extends ISubsystem { * @param p4 4th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -369,12 +367,11 @@ public interface ICMSEngine extends ISubsystem { * @param p5 5th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4, String p5); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -384,12 +381,11 @@ public interface ICMSEngine extends ISubsystem { * @param p6 6th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4, String p5, String p6); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -400,12 +396,11 @@ public interface ICMSEngine extends ISubsystem { * @param p7 7th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4, String p5, String p6, String p7); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -417,12 +412,11 @@ public interface ICMSEngine extends ISubsystem { * @param p8 8th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4, String p5, String p6, String p7, String p8); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8); /** * Retrieves the centralized log message from LogMessages.properties. - * + * * @param msgID message id defined in LogMessages.properties * @param p1 1st parameter * @param p2 2nd parameter @@ -435,15 +429,12 @@ public interface ICMSEngine extends ISubsystem { * @param p9 9th parameter * @return localized log message */ - public String getLogMessage(String msgID, String p1, String p2, String p3, - String p4, String p5, String p6, String p7, String p8, String p9); + public String getLogMessage(String msgID, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9); /** * Parse ACL resource attributes - * * @param resACLs same format as the resourceACLs attribute: - * - * <PRE> + * <PRE> * <resource name>:<permission1,permission2,...permissionn>: * <allow|deny> (<subset of the permission set>) <evaluator expression> * </PRE> @@ -454,72 +445,71 @@ public interface ICMSEngine extends ISubsystem { /** * Creates an issuing poing record. - * + * * @return issuing record */ - public ICRLIssuingPointRecord createCRLIssuingPointRecord(String id, - BigInteger crlNumber, Long crlSize, Date thisUpdate, Date nextUpdate); + public ICRLIssuingPointRecord createCRLIssuingPointRecord(String id, BigInteger crlNumber, Long crlSize, Date thisUpdate, Date nextUpdate); /** * Retrieves the default CRL issuing point record name. - * + * * @return CRL issuing point record name */ public String getCRLIssuingPointRecordName(); /** * Returns the finger print of the given certificate. - * + * * @param cert certificate * @return finger print of certificate */ public String getFingerPrint(Certificate cert) - throws CertificateEncodingException, NoSuchAlgorithmException; + throws CertificateEncodingException, NoSuchAlgorithmException; /** * Returns the finger print of the given certificate. - * + * * @param cert certificate * @return finger print of certificate */ public String getFingerPrints(Certificate cert) - throws NoSuchAlgorithmException, CertificateEncodingException; + throws NoSuchAlgorithmException, CertificateEncodingException; - /* + /* * Returns the finger print of the given certificate. - * + * * @param certDer DER byte array of certificate - * * @return finger print of certificate */ public String getFingerPrints(byte[] certDer) - throws NoSuchAlgorithmException; + throws NoSuchAlgorithmException; /** * Creates a repository record in the internal database. - * + * * @return repository record */ public IRepositoryRecord createRepositoryRecord(); /** - * Creates a HTTP PKI Message that can be sent to a remote authority. - * + * Creates a HTTP PKI Message that can be sent to a remote + * authority. + * * @return a new PKI Message for remote authority */ public IPKIMessage getHttpPKIMessage(); /** - * Creates a request encoder. A request cannot be sent to the remote - * authority in its regular format. - * + * Creates a request encoder. A request cannot be sent to + * the remote authority in its regular format. + * * @return a request encoder */ public IRequestEncoder getHttpRequestEncoder(); /** * Converts a BER-encoded byte array into a MIME-64 encoded string. - * + * * @param data data in byte array format * @return base-64 encoding for the data */ @@ -527,16 +517,16 @@ public interface ICMSEngine extends ISubsystem { /** * Converts a MIME-64 encoded string into a BER-encoded byte array. - * + * * @param data base-64 encoding for the data * @return data data in byte array format */ public byte[] AtoB(String data); /** - * Retrieves the certifcate in MIME-64 encoded format with header and - * footer. - * + * Retrieves the certifcate in MIME-64 encoded format + * with header and footer. + * * @param cert certificate * @return base-64 format certificate */ @@ -544,7 +534,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the certificate pretty print handler. - * + * * @param delimiter delimiter * @return certificate pretty print handler */ @@ -552,7 +542,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the extension pretty print handler. - * + * * @param e extension * @param indent indentation * @return extension pretty print handler @@ -561,7 +551,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the certificate pretty print handler. - * + * * @param cert certificate * @return certificate pretty print handler */ @@ -569,7 +559,7 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the CRL pretty print handler. - * + * * @param crl CRL * @return CRL pretty print handler */ @@ -577,73 +567,74 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the CRL cache pretty print handler. - * + * * @param ip CRL issuing point * @return CRL pretty print handler */ public ICRLPrettyPrint getCRLCachePrettyPrint(ICRLIssuingPoint ip); /** - * Retrieves the ldap connection information from the configuration store. - * + * Retrieves the ldap connection information from the configuration + * store. + * * @param config configuration parameters of ldap connection * @return a LDAP connection info */ - public ILdapConnInfo getLdapConnInfo(IConfigStore config) - throws EBaseException, ELdapException; + public ILdapConnInfo getLdapConnInfo(IConfigStore config) + throws EBaseException, ELdapException; /** - * Creates a LDAP SSL socket with the given nickname. The certificate - * associated with the nickname will be used for client authentication. - * + * Creates a LDAP SSL socket with the given nickname. The + * certificate associated with the nickname will be used + * for client authentication. + * * @param certNickname nickname of client certificate * @return LDAP SSL socket factory */ - public LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory( - String certNickname); + public LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory( + String certNickname); /** * Creates a LDAP SSL socket. - * + * * @return LDAP SSL socket factory */ - public LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory(); + public LDAPSSLSocketFactoryExt getLdapJssSSLSocketFactory(); /** * Creates a LDAP Auth Info object. - * + * * @return LDAP authentication info */ public ILdapAuthInfo getLdapAuthInfo(); /** * Retrieves the LDAP connection factory. - * + * * @return bound LDAP connection pool */ public ILdapConnFactory getLdapBoundConnFactory() throws ELdapException; public LDAPConnection getBoundConnection(String host, int port, - int version, LDAPSSLSocketFactoryExt fac, String bindDN, - String bindPW) throws LDAPException; - + int version, LDAPSSLSocketFactoryExt fac, String bindDN, + String bindPW) throws LDAPException; /** * Retrieves the LDAP connection factory. - * + * * @return anonymous LDAP connection pool */ public ILdapConnFactory getLdapAnonConnFactory() throws ELdapException; /** * Retrieves the password check. - * + * * @return default password checker */ public IPasswordCheck getPasswordChecker(); /** * Puts a password entry into the single-sign on cache. - * + * * @param tag password tag * @param pw password */ @@ -651,21 +642,21 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the password callback. - * + * * @return default password callback */ public PasswordCallback getPasswordCallback(); /** * Retrieves the nickname of the server's server certificate. - * + * * @return nickname of the server certificate */ public String getServerCertNickname(); /** * Sets the nickname of the server's server certificate. - * + * * @param tokenName name of token where the certificate is located * @param nickName name of server certificate */ @@ -673,143 +664,137 @@ public interface ICMSEngine extends ISubsystem { /** * Sets the nickname of the server's server certificate. - * + * * @param newName new nickname of server certificate */ public void setServerCertNickname(String newName); /** * Retrieves the host name of the server's secure end entity service. - * + * * @return host name of end-entity service */ public String getEEHost(); /** * Retrieves the host name of the server's non-secure end entity service. - * + * * @return host name of end-entity non-secure service */ public String getEENonSSLHost(); /** * Retrieves the IP address of the server's non-secure end entity service. - * + * * @return ip address of end-entity non-secure service */ public String getEENonSSLIP(); /** * Retrieves the port number of the server's non-secure end entity service. - * + * * @return port of end-entity non-secure service */ public String getEENonSSLPort(); /** * Retrieves the host name of the server's secure end entity service. - * + * * @return port of end-entity secure service */ public String getEESSLHost(); /** * Retrieves the IP address of the server's secure end entity service. - * + * * @return ip address of end-entity secure service */ public String getEESSLIP(); /** * Retrieves the port number of the server's secure end entity service. - * + * * @return port of end-entity secure service */ public String getEESSLPort(); /** - * Retrieves the port number of the server's client auth secure end entity - * service. - * + * Retrieves the port number of the server's client auth secure end entity service. + * * @return port of end-entity client auth secure service */ public String getEEClientAuthSSLPort(); /** * Retrieves the host name of the server's agent service. - * + * * @return host name of agent service */ public String getAgentHost(); /** * Retrieves the IP address of the server's agent service. - * + * * @return ip address of agent service */ public String getAgentIP(); /** * Retrieves the port number of the server's agent service. - * + * * @return port of agent service */ public String getAgentPort(); /** * Retrieves the host name of the server's administration service. - * + * * @return host name of administration service */ public String getAdminHost(); /** * Retrieves the IP address of the server's administration service. - * + * * @return ip address of administration service */ public String getAdminIP(); /** * Retrieves the port number of the server's administration service. - * + * * @return port of administration service */ public String getAdminPort(); /** * Verifies all system certificates - * * @return true if all passed, false otherwise */ - public boolean verifySystemCerts(); + public boolean verifySystemCerts(); /** - * Verifies a system certificate by its tag name as defined in - * <subsystemtype>.cert.list - * + * Verifies a system certificate by its tag name + * as defined in <subsystemtype>.cert.list * @return true if passed, false otherwise */ public boolean verifySystemCertByTag(String tag); /** * Verifies a system certificate by its nickname - * * @return true if passed, false otherwise */ - public boolean verifySystemCertByNickname(String nickname, - String certificateUsage); + public boolean verifySystemCertByNickname(String nickname, String certificateUsage); /** * get the CertificateUsage as defined in JSS CryptoManager - * * @return CertificateUsage as defined in JSS CryptoManager */ public CertificateUsage getCertificateUsage(String certusage); /** * Checks if the given certificate is a signing certificate. - * + * * @param cert certificate * @return true if the given certificate is a signing certificate */ @@ -817,7 +802,7 @@ public interface ICMSEngine extends ISubsystem { /** * Checks if the given certificate is an encryption certificate. - * + * * @param cert certificate * @return true if the given certificate is an encryption certificate */ @@ -825,215 +810,209 @@ public interface ICMSEngine extends ISubsystem { /** * Retrieves the default X.509 certificate template. - * + * * @return default certificate template */ public X509CertInfo getDefaultX509CertInfo(); /** * Retrieves the email form processor. - * + * * @return email form processor */ public IEmailFormProcessor getEmailFormProcessor(); /** * Retrieves the email form template. - * + * * @return email template */ public IEmailTemplate getEmailTemplate(String path); /** * Retrieves the email notification handler. - * + * * @return email notification */ public IMailNotification getMailNotification(); /** * Retrieves the email key resolver. - * + * * @return email key resolver */ public IEmailResolverKeys getEmailResolverKeys(); /** * Retrieves the email resolver that checks for subjectAlternateName. - * + * * @return email key resolver */ public IEmailResolver getReqCertSANameEmailResolver(); /** * Checks if the given OID is valid. - * + * * @param attrName attribute name * @param value attribute value * @return object identifier of the given attrName */ public ObjectIdentifier checkOID(String attrName, String value) - throws EBaseException; + throws EBaseException; /** * Creates a general name constraints. - * + * * @param generalNameChoice type of general name * @param value general name string * @return general name object * @exception EBaseException failed to create general name constraint */ - public GeneralName form_GeneralNameAsConstraints(String generalNameChoice, - String value) throws EBaseException; + public GeneralName form_GeneralNameAsConstraints(String generalNameChoice, String value) throws EBaseException; /** * Creates a general name. - * + * * @param generalNameChoice type of general name * @param value general name string * @return general name object * @exception EBaseException failed to create general name */ - public GeneralName form_GeneralName(String generalNameChoice, String value) - throws EBaseException; + public GeneralName form_GeneralName(String generalNameChoice, + String value) throws EBaseException; /** * Retrieves default general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param params configuration parameters * @exception EBaseException failed to create subject alt name configuration */ - public void getGeneralNameConfigDefaultParams(String name, - boolean isValueConfigured, Vector params); + public void getGeneralNameConfigDefaultParams(String name, + boolean isValueConfigured, Vector params); /** * Retrieves default general names configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param params configuration parameters * @exception EBaseException failed to create subject alt name configuration */ - public void getGeneralNamesConfigDefaultParams(String name, - boolean isValueConfigured, Vector params); + public void getGeneralNamesConfigDefaultParams(String name, + boolean isValueConfigured, Vector params); /** * Retrieves extended plugin info for general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param info configuration parameters * @exception EBaseException failed to create subject alt name configuration */ - public void getGeneralNameConfigExtendedPluginInfo(String name, - boolean isValueConfigured, Vector info); + public void getGeneralNameConfigExtendedPluginInfo(String name, + boolean isValueConfigured, Vector info); /** * Retrieves extended plugin info for general name configuration. - * + * * @param name configuration name * @param isValueConfigured true if value is configured * @param info configuration parameters * @exception EBaseException failed to create subject alt name configuration */ - public void getGeneralNamesConfigExtendedPluginInfo(String name, - boolean isValueConfigured, Vector info); + public void getGeneralNamesConfigExtendedPluginInfo(String name, + boolean isValueConfigured, Vector info); /** * Created general names configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public IGeneralNamesConfig createGeneralNamesConfig(String name, - IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException; + public IGeneralNamesConfig createGeneralNamesConfig(String name, + IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException; /** * Created general name constraints configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public IGeneralNameAsConstraintsConfig createGeneralNameAsConstraintsConfig( - String name, IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException; + public IGeneralNameAsConstraintsConfig createGeneralNameAsConstraintsConfig(String name, IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException; /** * Created general name constraints configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @param isPolicyEnabled true if policy is enabled * @exception EBaseException failed to create subject alt name configuration */ - public IGeneralNamesAsConstraintsConfig createGeneralNamesAsConstraintsConfig( - String name, IConfigStore config, boolean isValueConfigured, - boolean isPolicyEnabled) throws EBaseException; + public IGeneralNamesAsConstraintsConfig createGeneralNamesAsConstraintsConfig(String name, IConfigStore config, boolean isValueConfigured, + boolean isPolicyEnabled) throws EBaseException; /** * Get default parameters for subject alt name configuration. - * + * * @param name configuration name * @param params configuration parameters */ - public void getSubjAltNameConfigDefaultParams(String name, Vector params); + public void getSubjAltNameConfigDefaultParams(String name, Vector params); /** * Get extended plugin info for subject alt name configuration. - * + * * @param name configuration name * @param params configuration parameters */ - public void getSubjAltNameConfigExtendedPluginInfo(String name, - Vector params); + public void getSubjAltNameConfigExtendedPluginInfo(String name, Vector params); /** * Creates subject alt name configuration. - * + * * @param name configuration name * @param config configuration store * @param isValueConfigured true if value is configured * @exception EBaseException failed to create subject alt name configuration */ - public ISubjAltNameConfig createSubjAltNameConfig(String name, - IConfigStore config, boolean isValueConfigured) - throws EBaseException; + public ISubjAltNameConfig createSubjAltNameConfig(String name, IConfigStore config, boolean isValueConfigured) throws EBaseException; /** * Retrieves the HTTP Connection for use with connector. - * + * * @param authority remote authority * @param factory socket factory * @return http connection to the remote authority */ public IHttpConnection getHttpConnection(IRemoteAuthority authority, - ISocketFactory factory); + ISocketFactory factory); /** * Retrieves the HTTP Connection for use with connector. - * + * * @param authority remote authority * @param factory socket factory * @param timeout return error if connection cannot be established within - * the timeout period + * the timeout period * @return http connection to the remote authority */ public IHttpConnection getHttpConnection(IRemoteAuthority authority, - ISocketFactory factory, int timeout); + ISocketFactory factory, int timeout); /** * Retrieves the request sender for use with connector. - * + * * @param authority local authority * @param nickname nickname of the client certificate * @param remote remote authority @@ -1041,11 +1020,11 @@ public interface ICMSEngine extends ISubsystem { * @return resender */ public IResender getResender(IAuthority authority, String nickname, - IRemoteAuthority remote, int interval); + IRemoteAuthority remote, int interval); /** * Retrieves command queue - * + * * @return command queue */ public ICommandQueue getCommandQueue(); @@ -1061,24 +1040,22 @@ public interface ICMSEngine extends ISubsystem { public void terminateRequests(); /** - * Checks to ensure that all new incoming requests have been blocked. This - * method is used for reentrancy protection. + * Checks to ensure that all new incoming requests have been blocked. + * This method is used for reentrancy protection. * <P> - * + * * @return true or false */ public boolean areRequestsDisabled(); /** * Create configuration file. - * + * * @param path configuration path * @return configuration store * @exception EBaseException failed to create file */ - public IConfigStore createFileConfigStore(String path) - throws EBaseException; - + public IConfigStore createFileConfigStore(String path) throws EBaseException; /** * Creates argument block. */ @@ -1095,31 +1072,31 @@ public interface ICMSEngine extends ISubsystem { public IArgBlock createArgBlock(Hashtable httpReq); /** - * Checks against the local certificate repository to see if the - * certificates are revoked. - * + * Checks against the local certificate repository to see + * if the certificates are revoked. + * * @param certificates certificates - * @return true if certificate is revoked in the local certificate - * repository + * @return true if certificate is revoked in the local + * certificate repository */ public boolean isRevoked(X509Certificate[] certificates); /** * Sets list of verified certificates - * + * * @param size size of verified certificates list - * @param interval interval in which certificate is not recheck against - * local certificate repository - * @param unknownStateInterval interval in which certificate may not recheck - * against local certificate repository + * @param interval interval in which certificate is not recheck + * against local certificate repository + * @param unknownStateInterval interval in which certificate + * may not recheck against local certificate repository */ - public void setListOfVerifiedCerts(int size, long interval, - long unknownStateInterval); + public void setListOfVerifiedCerts(int size, long interval, long unknownStateInterval); /** - * Performs graceful shutdown of CMS. Subsystems are shutdown in reverse - * order. Exceptions are ignored. - */ + * Performs graceful shutdown of CMS. + * Subsystems are shutdown in reverse order. + * Exceptions are ignored. + */ public void forceShutdown(); public IPasswordStore getPasswordStore(); @@ -1130,3 +1107,4 @@ public interface ICMSEngine extends ISubsystem { public String getConfigSDSessionId(); } + diff --git a/pki/base/common/src/com/netscape/certsrv/apps/ICommandQueue.java b/pki/base/common/src/com/netscape/certsrv/apps/ICommandQueue.java index c9035e9d..5e223192 100644 --- a/pki/base/common/src/com/netscape/certsrv/apps/ICommandQueue.java +++ b/pki/base/common/src/com/netscape/certsrv/apps/ICommandQueue.java @@ -17,9 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.apps; + + + /** - * This interface represents a command queue for registeration and - * unregisteration proccess for clean shutdown + * This interface represents a command queue for registeration + * and unregisteration proccess for clean shutdown * * @version $Revision$, $Date$ */ @@ -27,18 +30,17 @@ public interface ICommandQueue { /** * Registers a thread into the command queue. - * + * * @param currentRequest request object * @param currentServlet servlet that serves the request object */ public boolean registerProcess(Object currentRequest, Object currentServlet); - /** * UnRegisters a thread from the command queue. - * + * * @param currentRequest request object * @param currentServlet servlet that serves the request object */ public void unRegisterProccess(Object currentRequest, Object currentServlet); - + } // CommandQueue |