Interface IRequest

  • All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    IEnrollmentRequest

    public interface IRequest
    extends java.io.Serializable
    An interface that defines abilities of request objects,
    Version:
    $Revision$, $Date$
    • Method Detail

      • getRequestId

        RequestId getRequestId()
        Gets the primary identifier for this request.
        Returns:
        request id
      • getRequestStatus

        RequestStatus getRequestStatus()
        Gets the current state of this request.
        Returns:
        request status
      • getSourceId

        java.lang.String getSourceId()
        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.

        The sourceId should be unique so that it can be used to retrieve request later without knowing the locally assigned primary id (RequestID)

        Returns:
        the sourceId value (or null if none has been set)
      • setSourceId

        void setSourceId​(java.lang.String id)
        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.
        Parameters:
        id - source id for this request
      • getRequestOwner

        java.lang.String getRequestOwner()
        Gets the current owner of this request.
        Returns:
        request owner
      • setRequestOwner

        void setRequestOwner​(java.lang.String owner)
        Sets the current owner of this request.
        Parameters:
        owner - The new owner of this request. If this value is set to null there will be no current owner
      • getRequestType

        java.lang.String getRequestType()
        Gets the type of this request.
        Returns:
        request type
      • setRequestType

        void setRequestType​(java.lang.String type)
        Sets the type or this request.
        Parameters:
        type - request type
      • getRequestVersion

        java.lang.String getRequestVersion()
        Gets the version of this request.
        Returns:
        request version
      • getCreationTime

        java.util.Date getCreationTime()
        Gets the time this request was created.
        Returns:
        request creation time
      • getModificationTime

        java.util.Date getModificationTime()
        Gets the time this request was last modified (defined as updated in the queue) (See IRequestQueue.update)
        Returns:
        request last modification time
      • copyContents

        void copyContents​(IRequest req)
        Copies meta attributes (excluding request Id, etc.) of another request to this request.
        Parameters:
        req - another request
      • getContext

        java.lang.String getContext()
        Gets context of this request.
        Returns:
        request context
      • setContext

        void setContext​(java.lang.String ctx)
        Sets context of this request.
        Parameters:
        ctx - request context
      • setRequestStatus

        void setRequestStatus​(RequestStatus s)
        Sets status of this request.
        Parameters:
        s - request status
      • isSuccess

        boolean isSuccess()
        Gets status of connector transfer.
        Returns:
        status of connector transfer
      • getError

        java.lang.String getError​(java.util.Locale locale)
        Gets localized error message from connector transfer.
        Parameters:
        locale - request locale
        Returns:
        error message from connector transfer
      • getErrorCode

        java.lang.String getErrorCode​(java.util.Locale locale)
        Get error code
        Parameters:
        locale - request locale
        Returns:
        error code
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.String value)
        Sets an Extended Data string-key string-value pair. All keys are lower cased because LDAP does not preserve case.
        Parameters:
        key - The extended data key
        value - The extended data value
        Returns:
        false if key is invalid.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.util.Hashtable<java.lang.String,​java.lang.String> value)
        Sets an Extended Data string-key string-value pair. The key and hashtable keys are all lowercased because LDAP does not preserve case.
        Parameters:
        key - The extended data key
        value - The extended data value the Hashtable contains an illegal key.
        Returns:
        false if the key or hashtable keys are invalid
      • isSimpleExtDataValue

        boolean isSimpleExtDataValue​(java.lang.String key)
        Checks whether the key is storing a simple String value, or a complex (Vector/hashtable) structure.
        Parameters:
        key - The key to check for.
        Returns:
        True if the key maps to a string. False if it maps to a hashtable.
      • getExtDataInString

        java.lang.String getExtDataInString​(java.lang.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 (Vector/Hashtable).
        Parameters:
        key - The key to lookup (case-insensitive)
        Returns:
        The value associated with the key. null if not found or if the key is associated with a non-string value.
      • getExtDataInHashtable

        java.util.Hashtable<java.lang.String,​java.lang.String> getExtDataInHashtable​(java.lang.String key)
        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 to make lookups seemless, but be aware it is not a normal hashtable and might behave strangely in some cases (e.g., iterating keys)
        Parameters:
        key - The key to lookup (case-insensitive)
        Returns:
        The hashtable value associated with the key. null if not found or if the key is associated with a string-value.
      • getExtDataKeys

        java.util.Enumeration<java.lang.String> getExtDataKeys()
        Returns all the keys stored in ExtData
        Returns:
        Enumeration of all the keys.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.String[] values)
        Stores an array of Strings in ExtData. The indices of the array are used as subkeys.
        Parameters:
        key - the ExtData key
        values - the array of string values to store
        Returns:
        False if the key is invalid
      • getExtDataInStringArray

        java.lang.String[] getExtDataInStringArray​(java.lang.String key)
        Retrieves an array of Strings stored with the key. This only works if the data was stored as an array. If the data is not correct, this method will return null.
        Parameters:
        key - The ExtData key
        Returns:
        The value. Null if not found or the data isn't an array.
      • deleteExtData

        void deleteExtData​(java.lang.String type)
        Removes the value of an extdata attribute.
        Parameters:
        type - key to delete
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.String subkey,
                           java.lang.String value)
        Helper method to add subkey/value pair to a ExtData hashtable. 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.
        Parameters:
        key - The top level key
        subkey - The hashtable data key
        value - The hashtable value
        Returns:
        False if the key or subkey are invalid
      • getExtDataInString

        java.lang.String getExtDataInString​(java.lang.String key,
                                            java.lang.String subkey)
        Helper method to retrieve an individual value from a Hashtable value.
        Parameters:
        key - the ExtData key
        subkey - the key in the Hashtable value (case insensitive)
        Returns:
        the value corresponding to the key/subkey
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.Integer value)
        Helper method to store an Integer value. It converts the integer value to a String and stores it.
        Parameters:
        key - the ExtData key
        value - the Integer to store (as a String)
        Returns:
        False if the key or value are invalid
      • getExtDataInInteger

        java.lang.Integer getExtDataInInteger​(java.lang.String key)
        Retrieves an integer value. Returns null if not found or the value can't be represented as an Integer.
        Parameters:
        key - The ExtData key to lookup
        Returns:
        The integer value or null if not possible.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.Integer[] values)
        Stores an array of Integers
        Parameters:
        key - The extdata key
        values - The array of Integers to store
        Returns:
        false if the key is invalid
      • getExtDataInIntegerArray

        java.lang.Integer[] getExtDataInIntegerArray​(java.lang.String key)
        Retrieves an array of Integers
        Parameters:
        key - The extdata key
        Returns:
        The array of Integers or null on error.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.math.BigInteger value)
        Helper method to store a BigInteger value. It converts the integer value to a String and stores it.
        Parameters:
        key - the ExtData key
        value - the BigInteger to store (as a String)
        Returns:
        False if the key or value are invalid
      • getExtDataInBigInteger

        java.math.BigInteger getExtDataInBigInteger​(java.lang.String key)
        Retrieves a BigInteger value. Returns null if not found or the value can't be represented as a BigInteger.
        Parameters:
        key - The ExtData key to lookup
        Returns:
        The integer value or null if not possible.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.math.BigInteger[] values)
        Stores an array of BigIntegers
        Parameters:
        key - The extdata key
        values - The array of BigIntegers to store
        Returns:
        false if the key is invalid
      • getExtDataInBigIntegerArray

        java.math.BigInteger[] getExtDataInBigIntegerArray​(java.lang.String key)
        Retrieves an array of BigIntegers
        Parameters:
        key - The extdata key
        Returns:
        The array of BigIntegers or null on error.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.lang.Throwable e)
        Helper method to store an exception. It actually stores the e.toString() value.
        Parameters:
        key - The ExtData key to store under
        e - The throwable to store
        Returns:
        False if the key is invalid.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           byte[] data)
        Stores a byte array as base64 encoded text
        Parameters:
        key - The ExtData key
        data - The byte array to store
        Returns:
        False if the key is invalid.
      • getExtDataInByteArray

        byte[] getExtDataInByteArray​(java.lang.String key)
        Retrieves the data, which should be base64 encoded as a byte array.
        Parameters:
        key - The ExtData key
        Returns:
        The data, or null if an error occurs.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.X509CertImpl data)
        Stores a X509CertImpl as base64 encoded text using the getEncode() method.
        Parameters:
        key - The ExtData key
        data - certificate
        Returns:
        False if the key is invalid.
      • getExtDataInCert

        org.mozilla.jss.netscape.security.x509.X509CertImpl getExtDataInCert​(java.lang.String key)
        Retrieves the data, which should be base64 encoded as a byte array.
        Parameters:
        key - The ExtData key
        Returns:
        The data, or null if an error occurs.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.X509CertImpl[] data)
        Stores an array of X509CertImpls as a base64 encoded text.
        Parameters:
        key - The ExtData key
        data - The array of certs to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInCertArray

        org.mozilla.jss.netscape.security.x509.X509CertImpl[] getExtDataInCertArray​(java.lang.String key)
        Retrieves an array of X509CertImpl.
        Parameters:
        key - The ExtData key
        Returns:
        Array of certs, or null if not found or invalid data.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.X509CertInfo data)
        Stores a X509CertInfo as base64 encoded text using the getEncodedInfo() method.
        Parameters:
        key - The ExtData key
        data - certificate
        Returns:
        False if the key is invalid.
      • getExtDataInCertInfo

        org.mozilla.jss.netscape.security.x509.X509CertInfo getExtDataInCertInfo​(java.lang.String key)
        Retrieves the data, which should be base64 encoded as a byte array.
        Parameters:
        key - The ExtData key
        Returns:
        The data, or null if an error occurs.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.X509CertInfo[] data)
        Stores an array of X509CertInfos as a base64 encoded text.
        Parameters:
        key - The ExtData key
        data - The array of cert infos to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInCertInfoArray

        org.mozilla.jss.netscape.security.x509.X509CertInfo[] getExtDataInCertInfoArray​(java.lang.String key)
        Retrieves an array of X509CertInfo.
        Parameters:
        key - The ExtData key
        Returns:
        Array of cert infos, or null if not found or invalid data.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.RevokedCertImpl[] data)
        Stores an array of RevokedCertImpls as a base64 encoded text.
        Parameters:
        key - The ExtData key
        data - The array of cert infos to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInRevokedCertArray

        org.mozilla.jss.netscape.security.x509.RevokedCertImpl[] getExtDataInRevokedCertArray​(java.lang.String key)
        Retrieves an array of RevokedCertImpl.
        Parameters:
        key - The ExtData key
        Returns:
        Array of cert infos, or null if not found or invalid data.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           java.util.Vector<?> data)
        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 data. Note that modifications to the Vector are not automatically reflected after it is stored. You must call set() again to make the changes.
        Parameters:
        key - The extdata key to store
        data - A vector of Strings to store
        Returns:
        False on key error or invalid data.
      • getExtDataInStringVector

        java.util.Vector<java.lang.String> getExtDataInStringVector​(java.lang.String key)
        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 into ExtData.
        Parameters:
        key - The extdata key
        Returns:
        A Vector of strings, or null on error.
      • getExtDataInBoolean

        boolean getExtDataInBoolean​(java.lang.String type,
                                    boolean defVal)
        Gets boolean value for given type or default value if attribute is absent.
        Parameters:
        type - attribute type
        defVal - default attribute value
        Returns:
        attribute value
      • getExtDataInBoolean

        boolean getExtDataInBoolean​(java.lang.String prefix,
                                    java.lang.String type,
                                    boolean defVal)
        Gets extdata boolean value for given type or default value if attribute is absent for this request with this prefix.
        Parameters:
        prefix - request prefix
        type - attribute type
        defVal - default attribute value
        Returns:
        attribute value
      • setExtData

        boolean setExtData​(java.lang.String key,
                           IAuthToken data)
        Stores an AuthToken the same as a Hashtable.
        Parameters:
        key - The ExtData key
        data - The authtoken to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInAuthToken

        IAuthToken getExtDataInAuthToken​(java.lang.String key)
        Retrieves an authtoken.
        Parameters:
        key - The ExtData key
        Returns:
        AuthToken, or null if not found or invalid data.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.CertificateExtensions data)
        Stores a CertificateExtensions in extdata.
        Parameters:
        key - The ExtData key
        data - The CertificateExtensions to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInCertExts

        org.mozilla.jss.netscape.security.x509.CertificateExtensions getExtDataInCertExts​(java.lang.String key)
        Retrieves the CertificateExtensions associated with the key.
        Parameters:
        key - The ExtData key
        Returns:
        the object, or null if not found or invalid data.
      • setExtData

        boolean setExtData​(java.lang.String key,
                           org.mozilla.jss.netscape.security.x509.CertificateSubjectName data)
        Stores a CertificateSubjectName in extdata.
        Parameters:
        key - The ExtData key
        data - The CertificateSubjectName to store
        Returns:
        False if the key or data is invalid.
      • getExtDataInCertSubjectName

        org.mozilla.jss.netscape.security.x509.CertificateSubjectName getExtDataInCertSubjectName​(java.lang.String key)
        Retrieves the CertificateSubjectName associated with the key.
        Parameters:
        key - The ExtData key
        Returns:
        the object, or null if not found or invalid data.
      • asIAttrSet

        IAttrSet asIAttrSet()
        Returns:
        IAttrSet wrapper with basic "get" functionality.
      • getRealm

        java.lang.String getRealm()
        Get realm
        Returns:
        String
      • setRealm

        void setRealm​(java.lang.String realm)
        Set the realm
        Parameters:
        realm -