Package com.netscape.cmscore.base
Class ArgBlock
java.lang.Object
com.netscape.cmscore.base.ArgBlock
- All Implemented Interfaces:
IArgBlock
,Serializable
This class represents a set of indexed arguments.
Each argument is indexed by a key, which can be
used during the argument retrieval.
- Version:
- $Revision$, $Date$
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBigIntegerValue
(String n, BigInteger v, int radix) Adds integer-type arguments to this block.addBooleanValue
(String n, boolean v) Adds boolean-type arguments to this block.addIntegerValue
(String n, int v) Adds integer-type arguments to this block.addLongValue
(String n, long v) Adds long-type arguments to this block.addStringValue
(String n, String v) Adds string-based value into this argument block.void
Deletes argument by the given key.elements()
Retrieves a list of argument keys.Retrieves argument.Retrieves a list of argument keys.Retrieves argument value as objectRetrieves argument value as objectRetrieves argument value as big integer.getValueAsBigInteger
(String n, BigInteger def) Retrieves argument value as big integer.boolean
getValueAsBoolean
(String name) Gets boolean value.boolean
getValueAsBoolean
(String name, boolean def) Gets boolean value.int
Retrieves argument value as integer.int
getValueAsInt
(String n, int def) Retrieves argument value as integer.getValueAsKeyGenInfo
(String name, KeyGenInfo def) Gets KeyGenInfoorg.mozilla.jss.netscape.security.pkcs.PKCS10
getValueAsPKCS10
(String name, boolean checkheader) Retrieves PKCS10org.mozilla.jss.netscape.security.pkcs.PKCS10
getValueAsPKCS10
(String name, boolean checkheader, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) Retrieves PKCS10org.mozilla.jss.netscape.security.pkcs.PKCS10
getValueAsRawPKCS10
(String name) Gets PKCS10 request.org.mozilla.jss.netscape.security.pkcs.PKCS10
getValueAsRawPKCS10
(String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) Gets PKCS10 request.Retrieves argument value as string.getValueAsString
(String n, String def) Retrieves argument value as string.org.mozilla.jss.netscape.security.pkcs.PKCS10
getValuePKCS10
(String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) Retrieves PKCS10boolean
Checks if this argument block contains the given key.void
Sets argument into this block.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
CERT_NEW_REQUEST_HEADER
- See Also:
-
CERT_NEW_REQUEST_TRAILER
- See Also:
-
CERT_RENEWAL_HEADER
- See Also:
-
CERT_RENEWAL_TRAILER
- See Also:
-
-
Constructor Details
-
ArgBlock
Constructs an argument block with the given hashtable values.- Parameters:
realm
- the type of argblock - used for debugging the values
-
ArgBlock
Constructs an argument block with the given hashtable values.- Parameters:
httpReq
- hashtable keys and values
-
ArgBlock
public ArgBlock()Constructs an empty argument block.
-
-
Method Details
-
isValuePresent
Checks if this argument block contains the given key.- Specified by:
isValuePresent
in interfaceIArgBlock
- Parameters:
n
- key- Returns:
- true if key is present
-
addStringValue
Adds string-based value into this argument block.- Specified by:
addStringValue
in interfaceIArgBlock
- Parameters:
n
- keyv
- value- Returns:
- value
-
getValueAsString
Retrieves argument value as string.- Specified by:
getValueAsString
in interfaceIArgBlock
- Parameters:
n
- key- Returns:
- argument value as string
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsString
Retrieves argument value as string.- Specified by:
getValueAsString
in interfaceIArgBlock
- Parameters:
n
- keydef
- default value to be returned if key is not present- Returns:
- argument value as string
-
getValueAsInt
Retrieves argument value as integer.- Specified by:
getValueAsInt
in interfaceIArgBlock
- Parameters:
n
- key- Returns:
- argument value as int
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsInt
Retrieves argument value as integer.- Specified by:
getValueAsInt
in interfaceIArgBlock
- Parameters:
n
- keydef
- default value to be returned if key is not present- Returns:
- argument value as int
-
getValueAsBigInteger
Retrieves argument value as big integer.- Specified by:
getValueAsBigInteger
in interfaceIArgBlock
- Parameters:
n
- key- Returns:
- argument value as big integer
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsBigInteger
Retrieves argument value as big integer.- Specified by:
getValueAsBigInteger
in interfaceIArgBlock
- Parameters:
n
- keydef
- default value to be returned if key is not present- Returns:
- argument value as big integer
-
getValue
Retrieves argument value as object- Specified by:
getValue
in interfaceIArgBlock
- Parameters:
n
- key- Returns:
- argument value as object
- Throws:
EBaseException
- failed to retrieve value
-
getValue
Retrieves argument value as object -
getValueAsBoolean
Gets boolean value. They should be "true" or "false".- Specified by:
getValueAsBoolean
in interfaceIArgBlock
- Parameters:
name
- name of the input type- Returns:
- boolean type:
true
orfalse
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsBoolean
Gets boolean value. They should be "true" or "false".- Specified by:
getValueAsBoolean
in interfaceIArgBlock
- Parameters:
name
- name of the input typedef
- Default value to return.- Returns:
- boolean type:
true
orfalse
-
getValueAsKeyGenInfo
Gets KeyGenInfo- Specified by:
getValueAsKeyGenInfo
in interfaceIArgBlock
- Parameters:
name
- name of the input typedef
- default value- Returns:
- KeyGenInfo object
- Throws:
EBaseException
-
getValueAsRawPKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValueAsRawPKCS10(String name) throws EBaseException Gets PKCS10 request. This pkcs10 attribute does not contain header information.- Specified by:
getValueAsRawPKCS10
in interfaceIArgBlock
- Parameters:
name
- name of the input type- Returns:
- pkcs10 request
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsRawPKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValueAsRawPKCS10(String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseException Gets PKCS10 request. This pkcs10 attribute does not contain header information.- Specified by:
getValueAsRawPKCS10
in interfaceIArgBlock
- Parameters:
name
- name of the input typedef
- default PKCS10- Returns:
- pkcs10 request
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsPKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValueAsPKCS10(String name, boolean checkheader) throws EBaseException Retrieves PKCS10- Specified by:
getValueAsPKCS10
in interfaceIArgBlock
- Parameters:
name
- name of the input typecheckheader
- true if header must be present- Returns:
- PKCS10 object
- Throws:
EBaseException
- failed to retrieve value
-
getValueAsPKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValueAsPKCS10(String name, boolean checkheader, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseException Retrieves PKCS10- Specified by:
getValueAsPKCS10
in interfaceIArgBlock
- Parameters:
name
- name of the input typecheckheader
- true if header must be presentdef
- default PKCS10- Returns:
- PKCS10 object
- Throws:
EBaseException
-
getValuePKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValuePKCS10(String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseException Retrieves PKCS10- Specified by:
getValuePKCS10
in interfaceIArgBlock
- Parameters:
name
- name of the input typedef
- default PKCS10- Returns:
- PKCS10 object
- Throws:
EBaseException
-
set
Sets argument into this block. -
get
Retrieves argument. -
delete
Deletes argument by the given key. -
getElements
Retrieves a list of argument keys.- Specified by:
getElements
in interfaceIArgBlock
- Returns:
- a list of string-based keys
-
elements
Retrieves a list of argument keys. -
addLongValue
Adds long-type arguments to this block.- Specified by:
addLongValue
in interfaceIArgBlock
- Parameters:
n
- keyv
- value- Returns:
- value
-
addIntegerValue
Adds integer-type arguments to this block.- Specified by:
addIntegerValue
in interfaceIArgBlock
- Parameters:
n
- keyv
- value- Returns:
- value
-
addBooleanValue
Adds boolean-type arguments to this block.- Specified by:
addBooleanValue
in interfaceIArgBlock
- Parameters:
n
- keyv
- value- Returns:
- value
-
addBigIntegerValue
Adds integer-type arguments to this block.- Specified by:
addBigIntegerValue
in interfaceIArgBlock
- Parameters:
n
- keyv
- valueradix
- radix- Returns:
- value
-