diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/request/IRequest.java')
-rw-r--r-- | pki/base/common/src/com/netscape/certsrv/request/IRequest.java | 339 |
1 files changed, 180 insertions, 159 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/request/IRequest.java b/pki/base/common/src/com/netscape/certsrv/request/IRequest.java index 477a14c65..507d527ff 100644 --- a/pki/base/common/src/com/netscape/certsrv/request/IRequest.java +++ b/pki/base/common/src/com/netscape/certsrv/request/IRequest.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.request; - //import java.io.Serializable; import java.math.BigInteger; @@ -36,10 +35,9 @@ import netscape.security.x509.X509CertInfo; import com.netscape.certsrv.authentication.IAuthToken; import com.netscape.certsrv.base.IAttrSet; - /** * An interface that defines abilities of request objects, - * + * * @version $Revision$, $Date$ */ public interface IRequest { @@ -84,11 +82,11 @@ public interface IRequest { // Params added by agents on agent approval page public static final String AGENT_PARAMS = "AGENT_PARAMS"; // server attributes: attributes generated by server modules. - public static final String SERVER_ATTRS = "SERVER_ATTRS"; + public static final String SERVER_ATTRS = "SERVER_ATTRS"; - public static final String RESULT = "Result"; // service result. - public static final Integer RES_SUCCESS = Integer.valueOf(1); // result value - public static final Integer RES_ERROR = Integer.valueOf(2); // result value + public static final String RESULT = "Result"; // service result. + public static final Integer RES_SUCCESS = Integer.valueOf(1); // result value + public static final Integer RES_ERROR = Integer.valueOf(2); // result value public static final String REMOTE_SERVICE_AUTHORITY = "RemServiceAuthority"; public static final String SVCERRORS = "serviceErrors"; public static final String REMOTE_STATUS = "remoteStatus"; @@ -110,10 +108,9 @@ public interface IRequest { // also used for renewal public static final String CERT_INFO = "CERT_INFO"; public static final String ISSUED_CERTS = "issuedCerts"; - public static final String - REQUEST_TRUSTEDMGR_PRIVILEGE = "requestTrustedManagerPrivilege"; + public static final String REQUEST_TRUSTEDMGR_PRIVILEGE = "requestTrustedManagerPrivilege"; public static final String FINGERPRINTS = "fingerprints"; - + // enrollment request values public static final String SERVER_CERT = "server"; public static final String CLIENT_CERT = "client"; @@ -124,7 +121,7 @@ public interface IRequest { public static final String OTHER_CERT = "other"; public static final String ROUTER_CERT = "router"; // deprecated public static final String CEP_CERT = "CEP-Request"; - + // renewal request attributes. (internally set) // also used for revocation public static final String OLD_CERTS = "OLD_CERTS"; @@ -143,13 +140,13 @@ public interface IRequest { public final static String CRL_PUBLISH_ERROR = "crlPublishError"; public static final String REQUESTOR_TYPE = "requestorType"; - // Netkey request attributes + // Netkey request attributes public final static String NETKEY_ATTR_CUID = "CUID"; public final static String NETKEY_ATTR_USERID = "USERID"; public final static String NETKEY_ATTR_DRMTRANS_DES_KEY = "drm_trans_desKey"; - public final static String NETKEY_ATTR_ARCHIVE_FLAG ="archive"; - public final static String NETKEY_ATTR_SERVERSIDE_MUSCLE_FLAG ="serverSideMuscle"; - public final static String NETKEY_ATTR_ENC_PRIVKEY_FLAG ="encryptPrivKey"; + public final static String NETKEY_ATTR_ARCHIVE_FLAG = "archive"; + public final static String NETKEY_ATTR_SERVERSIDE_MUSCLE_FLAG = "serverSideMuscle"; + public final static String NETKEY_ATTR_ENC_PRIVKEY_FLAG = "encryptPrivKey"; public final static String NETKEY_ATTR_USER_CERT = "cert"; public final static String NETKEY_ATTR_KEY_SIZE = "keysize"; @@ -174,90 +171,89 @@ public interface IRequest { /** * Gets the primary identifier for this request. - * + * * @return request id */ RequestId getRequestId(); /** * Gets the current state of this request. - * + * * @return request status */ RequestStatus getRequestStatus(); /** - * Gets the "sourceId" for the request. The sourceId is + * Gets the "sourceId" for the request. The sourceId is * assigned by the originator of the request (for example, * the EE servlet or the RA servlet. * <p> - * The sourceId should be unique so that it can be used - * to retrieve request later without knowing the locally - * assigned primary id (RequestID) + * The sourceId should be unique so that it can be used to retrieve request later without knowing the locally assigned primary id (RequestID) * <p> + * * @return - * the sourceId value (or null if none has been set) + * the sourceId value (or null if none has been set) */ public String getSourceId(); /** - * Sets the "sourceId" for this request. The request must be updated - * in the database for this change to take effect. This can be done + * Sets the "sourceId" for this request. The request must be updated + * in the database for this change to take effect. This can be done * by calling IRequestQueue.update() or by performing one of the * other operations like processRequest or approveRequest. - * + * * @param id source id for this request */ public void setSourceId(String id); /** * Gets the current owner of this request. - * + * * @return request owner */ public String getRequestOwner(); /** * Sets the current owner of this request. - * + * * @param owner - * The new owner of this request. If this value is set to null - * there will be no current owner + * The new owner of this request. If this value is set to null + * there will be no current owner */ public void setRequestOwner(String owner); /** * Gets the type of this request. - * + * * @return request type */ public String getRequestType(); /** * Sets the type or this request. - * + * * @param type request type */ public void setRequestType(String type); /** * Gets the version of this request. - * + * * @return request version */ public String getRequestVersion(); /** * Gets the time this request was created. - * + * * @return request creation time */ Date getCreationTime(); /** * Gets the time this request was last modified (defined - * as updated in the queue) (See IRequestQueue.update) - * + * as updated in the queue) (See IRequestQueue.update) + * * @return request last modification time */ Date getModificationTime(); @@ -278,61 +274,60 @@ public interface IRequest { public static final String ERROR = "Error"; /** - * Copies meta attributes (excluding request Id, etc.) of another request + * Copies meta attributes (excluding request Id, etc.) of another request * to this request. - * + * * @param req another request */ public void copyContents(IRequest req); /** * Gets context of this request. - * + * * @return request context */ public String getContext(); /** * Sets context of this request. - * + * * @param ctx request context */ public void setContext(String ctx); /** * Sets status of this request. - * + * * @param s request status */ public void setRequestStatus(RequestStatus s); /** * Gets status of connector transfer. - * + * * @return status of connector transfer */ public boolean isSuccess(); /** * Gets localized error message from connector transfer. - * + * * @param locale request locale * @return error message from connector transfer */ public String getError(Locale locale); - /************************************************************** * ExtData data methods: - * + * * These methods should be used in place of the mAttrData methods * deprecated above. - * - * These methods all store Strings in LDAP. This means they can no longer - * be used as a garbage dump for all sorts of objects. A limited number + * + * These methods all store Strings in LDAP. This means they can no longer + * be used as a garbage dump for all sorts of objects. A limited number * of helper methods are provided for Vectors/Arrays/Hashtables but the * keys and values for all of these should be Strings. - * + * * The keys are used in the LDAP attribute names, and so much obey LDAP * key syntax rules: A-Za-z0-9 and hyphen. */ @@ -340,8 +335,8 @@ public interface IRequest { /** * Sets an Extended Data string-key string-value pair. * All keys are lower cased because LDAP does not preserve case. - * - * @param key The extended data key + * + * @param key The extended data key * @param value The extended data value * @return false if key is invalid. */ @@ -351,10 +346,10 @@ public interface IRequest { * Sets an Extended Data string-key string-value pair. * The key and hashtable keys are all lowercased because LDAP does not * preserve case. - * - * @param key The extended data key + * + * @param key The extended data key * @param value The extended data value - * the Hashtable contains an illegal key. + * the Hashtable contains an illegal key. * @return false if the key or hashtable keys are invalid */ public boolean setExtData(String key, Hashtable value); @@ -362,39 +357,42 @@ public interface IRequest { /** * Checks whether the key is storing a simple String value, or a complex * (Vector/hashtable) structure. - * @param key The key to check for. - * @return True if the key maps to a string. False if it maps to a + * + * @param key The key to check for. + * @return True if the key maps to a string. False if it maps to a * hashtable. */ public boolean isSimpleExtDataValue(String key); /** - * Returns the String value stored for the String key. Returns null - * if not found. Throws exception if key stores a complex data structure + * Returns the String value stored for the String key. Returns null + * if not found. Throws exception if key stores a complex data structure * (Vector/Hashtable). - * @param key The key to lookup (case-insensitive) - * @return The value associated with the key. null if not found or if the - * key is associated with a non-string value. + * + * @param key The key to lookup (case-insensitive) + * @return The value associated with the key. null if not found or if the + * key is associated with a non-string value. */ public String getExtDataInString(String key); /** - * Returns the Hashtable value for the String key. Returns null if not - * found. Throws exception if the key stores a String value. - * + * Returns the Hashtable value for the String key. Returns null if not + * found. Throws exception if the key stores a String value. + * * The Hashtable returned is actually a subclass of Hashtable that - * lowercases all keys used to access the hashtable. Its purpose is to + * lowercases all keys used to access the hashtable. Its purpose is to * to make lookups seemless, but be aware it is not a normal hashtable and * might behave strangely in some cases (e.g., iterating keys) - * - * @param key The key to lookup (case-insensitive) - * @return The hashtable value associated with the key. null if not found + * + * @param key The key to lookup (case-insensitive) + * @return The hashtable value associated with the key. null if not found * or if the key is associated with a string-value. */ public Hashtable getExtDataInHashtable(String key); /** * Returns all the keys stored in ExtData + * * @return Enumeration of all the keys. */ public Enumeration getExtDataKeys(); @@ -402,24 +400,26 @@ public interface IRequest { /** * Stores an array of Strings in ExtData. * The indices of the array are used as subkeys. - * @param key the ExtData key - * @param values the array of string values to store + * + * @param key the ExtData key + * @param values the array of string values to store * @return False if the key is invalid */ public boolean setExtData(String key, String[] values); /** * Retrieves an array of Strings stored with the key. - * This only works if the data was stored as an array. If the data + * This only works if the data was stored as an array. If the data * is not correct, this method will return null. - * @param key The ExtData key - * @return The value. Null if not found or the data isn't an array. + * + * @param key The ExtData key + * @return The value. Null if not found or the data isn't an array. */ public String[] getExtDataInStringArray(String key); /** * Removes the value of an extdata attribute. - * + * * @param type key to delete */ void deleteExtData(String type); @@ -430,90 +430,95 @@ public interface IRequest { /** * Helper method to add subkey/value pair to a ExtData hashtable. - * If the hashtable it exists, the subkey/value are added to it. Otherwise + * If the hashtable it exists, the subkey/value are added to it. Otherwise * a new hashtable is created. - * + * * The key and subkey are lowercased because LDAP does not preserve case. - * - * @param key The top level key + * + * @param key The top level key * @param subkey The hashtable data key - * @param value The hashtable value + * @param value The hashtable value * @return False if the key or subkey are invalid */ public boolean setExtData(String key, String subkey, String value); /** * Helper method to retrieve an individual value from a Hashtable value. - * @param key the ExtData key - * @param subkey the key in the Hashtable value (case insensitive) + * + * @param key the ExtData key + * @param subkey the key in the Hashtable value (case insensitive) * @return the value corresponding to the key/subkey */ public String getExtDataInString(String key, String subkey); /** - * Helper method to store an Integer value. It converts the integer value + * Helper method to store an Integer value. It converts the integer value * to a String and stores it. - * - * @param key the ExtData key - * @param value the Integer to store (as a String) + * + * @param key the ExtData key + * @param value the Integer to store (as a String) * @return False if the key or value are invalid */ public boolean setExtData(String key, Integer value); /** - * Retrieves an integer value. Returns null if not found or + * Retrieves an integer value. Returns null if not found or * the value can't be represented as an Integer. - * - * @param key The ExtData key to lookup - * @return The integer value or null if not possible. + * + * @param key The ExtData key to lookup + * @return The integer value or null if not possible. */ public Integer getExtDataInInteger(String key); /** * Stores an array of Integers - * @param key The extdata key - * @param values The array of Integers to store - * @return false if the key is invalid + * + * @param key The extdata key + * @param values The array of Integers to store + * @return false if the key is invalid */ public boolean setExtData(String key, Integer[] values); /** * Retrieves an array of Integers - * @param key The extdata key + * + * @param key The extdata key * @return The array of Integers or null on error. */ public Integer[] getExtDataInIntegerArray(String key); /** - * Helper method to store a BigInteger value. It converts the integer value + * Helper method to store a BigInteger value. It converts the integer value * to a String and stores it. - * - * @param key the ExtData key - * @param value the BigInteger to store (as a String) + * + * @param key the ExtData key + * @param value the BigInteger to store (as a String) * @return False if the key or value are invalid */ public boolean setExtData(String key, BigInteger value); /** - * Retrieves a BigInteger value. Returns null if not found or + * Retrieves a BigInteger value. Returns null if not found or * the value can't be represented as a BigInteger. - * - * @param key The ExtData key to lookup - * @return The integer value or null if not possible. + * + * @param key The ExtData key to lookup + * @return The integer value or null if not possible. */ public BigInteger getExtDataInBigInteger(String key); /** * Stores an array of BigIntegers - * @param key The extdata key - * @param values The array of BigIntegers to store - * @return false if the key is invalid + * + * @param key The extdata key + * @param values The array of BigIntegers to store + * @return false if the key is invalid */ public boolean setExtData(String key, BigInteger[] values); /** * Retrieves an array of BigIntegers - * @param key The extdata key + * + * @param key The extdata key * @return The array of BigIntegers or null on error. */ public BigInteger[] getExtDataInBigIntegerArray(String key); @@ -521,102 +526,114 @@ public interface IRequest { /** * Helper method to store an exception. * It actually stores the e.toString() value. - * - * @param key The ExtData key to store under - * @param e The throwable to store - * @return False if the key is invalid. + * + * @param key The ExtData key to store under + * @param e The throwable to store + * @return False if the key is invalid. */ public boolean setExtData(String key, Throwable e); /** * Stores a byte array as base64 encoded text - * @param key The ExtData key - * @param data The byte array to store - * @return False if the key is invalid. + * + * @param key The ExtData key + * @param data The byte array to store + * @return False if the key is invalid. */ public boolean setExtData(String key, byte[] data); /** * Retrieves the data, which should be base64 encoded as a byte array. - * @param key The ExtData key - * @return The data, or null if an error occurs. + * + * @param key The ExtData key + * @return The data, or null if an error occurs. */ public byte[] getExtDataInByteArray(String key); /** * Stores a X509CertImpl as base64 encoded text using the getEncode() * method. - * @param key The ExtData key - * @param data certificate - * @return False if the key is invalid. + * + * @param key The ExtData key + * @param data certificate + * @return False if the key is invalid. */ public boolean setExtData(String key, X509CertImpl data); /** * Retrieves the data, which should be base64 encoded as a byte array. - * @param key The ExtData key - * @return The data, or null if an error occurs. + * + * @param key The ExtData key + * @return The data, or null if an error occurs. */ public X509CertImpl getExtDataInCert(String key); /** * Stores an array of X509CertImpls as a base64 encoded text. + * * @param key The ExtData key - * @param data The array of certs to store + * @param data The array of certs to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, X509CertImpl[] data); /** * Retrieves an array of X509CertImpl. - * @param key The ExtData key - * @return Array of certs, or null if not found or invalid data. + * + * @param key The ExtData key + * @return Array of certs, or null if not found or invalid data. */ public X509CertImpl[] getExtDataInCertArray(String key); /** * Stores a X509CertInfo as base64 encoded text using the getEncodedInfo() * method. - * @param key The ExtData key - * @param data certificate - * @return False if the key is invalid. + * + * @param key The ExtData key + * @param data certificate + * @return False if the key is invalid. */ public boolean setExtData(String key, X509CertInfo data); /** * Retrieves the data, which should be base64 encoded as a byte array. - * @param key The ExtData key - * @return The data, or null if an error occurs. + * + * @param key The ExtData key + * @return The data, or null if an error occurs. */ public X509CertInfo getExtDataInCertInfo(String key); /** * Stores an array of X509CertInfos as a base64 encoded text. + * * @param key The ExtData key - * @param data The array of cert infos to store + * @param data The array of cert infos to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, X509CertInfo[] data); /** * Retrieves an array of X509CertInfo. - * @param key The ExtData key - * @return Array of cert infos, or null if not found or invalid data. + * + * @param key The ExtData key + * @return Array of cert infos, or null if not found or invalid data. */ public X509CertInfo[] getExtDataInCertInfoArray(String key); /** * Stores an array of RevokedCertImpls as a base64 encoded text. + * * @param key The ExtData key - * @param data The array of cert infos to store + * @param data The array of cert infos to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, RevokedCertImpl[] data); /** * Retrieves an array of RevokedCertImpl. - * @param key The ExtData key - * @return Array of cert infos, or null if not found or invalid data. + * + * @param key The ExtData key + * @return Array of cert infos, or null if not found or invalid data. */ public RevokedCertImpl[] getExtDataInRevokedCertArray(String key); @@ -624,42 +641,41 @@ public interface IRequest { * Stores the contents of the String Vector in ExtData. * TODO - as soon as we're allowed to use JDK5 this should be changed * to use Vector<String> data. - * + * * Note that modifications to the Vector are not automatically reflected - * after it is stored. You must call set() again to make the changes. - * - * @param key The extdata key to store + * after it is stored. You must call set() again to make the changes. + * + * @param key The extdata key to store * @param data A vector of Strings to store - * @return False on key error or invalid data. + * @return False on key error or invalid data. */ public boolean setExtData(String key, Vector data); /** * Returns a vector of strings for the key. * Note that the returned vector, if modified, does not make changes - * in ExtData. You must call setExtData() to propogate changes back + * in ExtData. You must call setExtData() to propogate changes back * into ExtData. - * - * @param key The extdata key - * @return A Vector of strings, or null on error. + * + * @param key The extdata key + * @return A Vector of strings, or null on error. */ public Vector<String> getExtDataInStringVector(String key); /** * Gets boolean value for given type or default value - * if attribute is absent. - * + * if attribute is absent. + * * @param type attribute type * @param defVal default attribute value * @return attribute value */ boolean getExtDataInBoolean(String type, boolean defVal); - /** * Gets extdata boolean value for given type or default value - * if attribute is absent for this request with this prefix. - * + * if attribute is absent for this request with this prefix. + * * @param prefix request prefix * @param type attribute type * @param defVal default attribute value @@ -667,59 +683,64 @@ public interface IRequest { */ public boolean getExtDataInBoolean(String prefix, String type, boolean defVal); - /** * Stores an AuthToken the same as a Hashtable. + * * @param key The ExtData key - * @param data The authtoken to store + * @param data The authtoken to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, IAuthToken data); /** * Retrieves an authtoken. - * @param key The ExtData key - * @return AuthToken, or null if not found or invalid data. + * + * @param key The ExtData key + * @return AuthToken, or null if not found or invalid data. */ public IAuthToken getExtDataInAuthToken(String key); /** * Stores a CertificateExtensions in extdata. + * * @param key The ExtData key - * @param data The CertificateExtensions to store + * @param data The CertificateExtensions to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, CertificateExtensions data); /** * Retrieves the CertificateExtensions associated with the key. - * @param key The ExtData key - * @return the object, or null if not found or invalid data. + * + * @param key The ExtData key + * @return the object, or null if not found or invalid data. */ public CertificateExtensions getExtDataInCertExts(String key); /** * Stores a CertificateSubjectName in extdata. + * * @param key The ExtData key - * @param data The CertificateSubjectName to store + * @param data The CertificateSubjectName to store * @return False if the key or data is invalid. */ public boolean setExtData(String key, CertificateSubjectName data); /** * Retrieves the CertificateSubjectName associated with the key. - * @param key The ExtData key - * @return the object, or null if not found or invalid data. + * + * @param key The ExtData key + * @return the object, or null if not found or invalid data. */ public CertificateSubjectName getExtDataInCertSubjectName(String key); /** * This method returns an IAttrSet wrapper for the IRequest. - * Use of this method is strongly discouraged. It provides extremely + * Use of this method is strongly discouraged. It provides extremely * limited functionality, and is only provided for the two places IRequest - * is being used as such in the code. If you are considering using this + * is being used as such in the code. If you are considering using this * method, please don't. - * + * * @return IAttrSet wrapper with basic "get" functionality. * @deprecated */ |