Package com.netscape.cmscore.base
Class ArgBlock
- java.lang.Object
-
- com.netscape.cmscore.base.ArgBlock
-
- All Implemented Interfaces:
IArgBlock,java.io.Serializable
public class ArgBlock extends java.lang.Object implements IArgBlock
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCERT_NEW_REQUEST_HEADERstatic java.lang.StringCERT_NEW_REQUEST_TRAILERstatic java.lang.StringCERT_RENEWAL_HEADERstatic java.lang.StringCERT_RENEWAL_TRAILERstatic org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description ArgBlock()Constructs an empty argument block.ArgBlock(java.lang.String realm, java.util.Hashtable<java.lang.String,java.lang.String> httpReq)Constructs an argument block with the given hashtable values.ArgBlock(java.util.Hashtable<java.lang.String,java.lang.String> httpReq)Constructs an argument block with the given hashtable values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectaddBigIntegerValue(java.lang.String n, java.math.BigInteger v, int radix)Adds integer-type arguments to this block.java.lang.ObjectaddBooleanValue(java.lang.String n, boolean v)Adds boolean-type arguments to this block.java.lang.ObjectaddIntegerValue(java.lang.String n, int v)Adds integer-type arguments to this block.java.lang.ObjectaddLongValue(java.lang.String n, long v)Adds long-type arguments to this block.java.lang.ObjectaddStringValue(java.lang.String n, java.lang.String v)Adds string-based value into this argument block.voiddelete(java.lang.String name)Deletes argument by the given key.java.util.Enumeration<java.lang.String>elements()Retrieves a list of argument keys.java.lang.Objectget(java.lang.String name)Retrieves argument.java.util.Enumeration<java.lang.String>getElements()Retrieves a list of argument keys.java.lang.ObjectgetValue(java.lang.Object n)Retrieves argument value as objectjava.lang.ObjectgetValue(java.lang.Object n, java.lang.Object def)Retrieves argument value as objectjava.math.BigIntegergetValueAsBigInteger(java.lang.String n)Retrieves argument value as big integer.java.math.BigIntegergetValueAsBigInteger(java.lang.String n, java.math.BigInteger def)Retrieves argument value as big integer.booleangetValueAsBoolean(java.lang.String name)Gets boolean value.booleangetValueAsBoolean(java.lang.String name, boolean def)Gets boolean value.intgetValueAsInt(java.lang.String n)Retrieves argument value as integer.intgetValueAsInt(java.lang.String n, int def)Retrieves argument value as integer.KeyGenInfogetValueAsKeyGenInfo(java.lang.String name, KeyGenInfo def)Gets KeyGenInfoorg.mozilla.jss.netscape.security.pkcs.PKCS10getValueAsPKCS10(java.lang.String name, boolean checkheader)Retrieves PKCS10org.mozilla.jss.netscape.security.pkcs.PKCS10getValueAsPKCS10(java.lang.String name, boolean checkheader, org.mozilla.jss.netscape.security.pkcs.PKCS10 def)Retrieves PKCS10org.mozilla.jss.netscape.security.pkcs.PKCS10getValueAsRawPKCS10(java.lang.String name)Gets PKCS10 request.org.mozilla.jss.netscape.security.pkcs.PKCS10getValueAsRawPKCS10(java.lang.String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def)Gets PKCS10 request.java.lang.StringgetValueAsString(java.lang.String n)Retrieves argument value as string.java.lang.StringgetValueAsString(java.lang.String n, java.lang.String def)Retrieves argument value as string.org.mozilla.jss.netscape.security.pkcs.PKCS10getValuePKCS10(java.lang.String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def)Retrieves PKCS10booleanisValuePresent(java.lang.String n)Checks if this argument block contains the given key.voidset(java.lang.String name, java.lang.Object ob)Sets argument into this block.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
CERT_NEW_REQUEST_HEADER
public static final java.lang.String CERT_NEW_REQUEST_HEADER
- See Also:
- Constant Field Values
-
CERT_NEW_REQUEST_TRAILER
public static final java.lang.String CERT_NEW_REQUEST_TRAILER
- See Also:
- Constant Field Values
-
CERT_RENEWAL_HEADER
public static final java.lang.String CERT_RENEWAL_HEADER
- See Also:
- Constant Field Values
-
CERT_RENEWAL_TRAILER
public static final java.lang.String CERT_RENEWAL_TRAILER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArgBlock
public ArgBlock(java.lang.String realm, java.util.Hashtable<java.lang.String,java.lang.String> httpReq)Constructs an argument block with the given hashtable values.- Parameters:
realm- the type of argblock - used for debugging the values
-
ArgBlock
public ArgBlock(java.util.Hashtable<java.lang.String,java.lang.String> httpReq)
Constructs an argument block with the given hashtable values.- Parameters:
httpReq- hashtable keys and values
-
ArgBlock
public ArgBlock()
Constructs an empty argument block.
-
-
Method Detail
-
isValuePresent
public boolean isValuePresent(java.lang.String n)
Checks if this argument block contains the given key.- Specified by:
isValuePresentin interfaceIArgBlock- Parameters:
n- key- Returns:
- true if key is present
-
addStringValue
public java.lang.Object addStringValue(java.lang.String n, java.lang.String v)Adds string-based value into this argument block.- Specified by:
addStringValuein interfaceIArgBlock- Parameters:
n- keyv- value- Returns:
- value
-
getValueAsString
public java.lang.String getValueAsString(java.lang.String n) throws EBaseExceptionRetrieves argument value as string.- Specified by:
getValueAsStringin interfaceIArgBlock- Parameters:
n- key- Returns:
- argument value as string
- Throws:
EBaseException- failed to retrieve value
-
getValueAsString
public java.lang.String getValueAsString(java.lang.String n, java.lang.String def)Retrieves argument value as string.- Specified by:
getValueAsStringin interfaceIArgBlock- Parameters:
n- keydef- default value to be returned if key is not present- Returns:
- argument value as string
-
getValueAsInt
public int getValueAsInt(java.lang.String n) throws EBaseExceptionRetrieves argument value as integer.- Specified by:
getValueAsIntin interfaceIArgBlock- Parameters:
n- key- Returns:
- argument value as int
- Throws:
EBaseException- failed to retrieve value
-
getValueAsInt
public int getValueAsInt(java.lang.String n, int def)Retrieves argument value as integer.- Specified by:
getValueAsIntin interfaceIArgBlock- Parameters:
n- keydef- default value to be returned if key is not present- Returns:
- argument value as int
-
getValueAsBigInteger
public java.math.BigInteger getValueAsBigInteger(java.lang.String n) throws EBaseExceptionRetrieves argument value as big integer.- Specified by:
getValueAsBigIntegerin interfaceIArgBlock- Parameters:
n- key- Returns:
- argument value as big integer
- Throws:
EBaseException- failed to retrieve value
-
getValueAsBigInteger
public java.math.BigInteger getValueAsBigInteger(java.lang.String n, java.math.BigInteger def)Retrieves argument value as big integer.- Specified by:
getValueAsBigIntegerin interfaceIArgBlock- Parameters:
n- keydef- default value to be returned if key is not present- Returns:
- argument value as big integer
-
getValue
public java.lang.Object getValue(java.lang.Object n) throws EBaseExceptionRetrieves argument value as object- Specified by:
getValuein interfaceIArgBlock- Parameters:
n- key- Returns:
- argument value as object
- Throws:
EBaseException- failed to retrieve value
-
getValue
public java.lang.Object getValue(java.lang.Object n, java.lang.Object def)Retrieves argument value as object
-
getValueAsBoolean
public boolean getValueAsBoolean(java.lang.String name) throws EBaseExceptionGets boolean value. They should be "true" or "false".- Specified by:
getValueAsBooleanin interfaceIArgBlock- Parameters:
name- name of the input type- Returns:
- boolean type:
trueorfalse - Throws:
EBaseException- failed to retrieve value
-
getValueAsBoolean
public boolean getValueAsBoolean(java.lang.String name, boolean def)Gets boolean value. They should be "true" or "false".- Specified by:
getValueAsBooleanin interfaceIArgBlock- Parameters:
name- name of the input typedef- Default value to return.- Returns:
- boolean type:
trueorfalse
-
getValueAsKeyGenInfo
public KeyGenInfo getValueAsKeyGenInfo(java.lang.String name, KeyGenInfo def) throws EBaseException
Gets KeyGenInfo- Specified by:
getValueAsKeyGenInfoin interfaceIArgBlock- Parameters:
name- name of the input typeverify- true if signature validation is required- Returns:
- KeyGenInfo object
- Throws:
EBaseException
-
getValueAsRawPKCS10
public org.mozilla.jss.netscape.security.pkcs.PKCS10 getValueAsRawPKCS10(java.lang.String name) throws EBaseExceptionGets PKCS10 request. This pkcs10 attribute does not contain header information.- Specified by:
getValueAsRawPKCS10in 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(java.lang.String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseExceptionGets PKCS10 request. This pkcs10 attribute does not contain header information.- Specified by:
getValueAsRawPKCS10in 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(java.lang.String name, boolean checkheader) throws EBaseExceptionRetrieves PKCS10- Specified by:
getValueAsPKCS10in 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(java.lang.String name, boolean checkheader, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseExceptionRetrieves PKCS10- Specified by:
getValueAsPKCS10in 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(java.lang.String name, org.mozilla.jss.netscape.security.pkcs.PKCS10 def) throws EBaseExceptionRetrieves PKCS10- Specified by:
getValuePKCS10in interfaceIArgBlock- Parameters:
name- name of the input typedef- default PKCS10- Returns:
- PKCS10 object
- Throws:
EBaseException
-
set
public void set(java.lang.String name, java.lang.Object ob)Sets argument into this block.
-
get
public java.lang.Object get(java.lang.String name)
Retrieves argument.
-
delete
public void delete(java.lang.String name)
Deletes argument by the given key.
-
getElements
public java.util.Enumeration<java.lang.String> getElements()
Retrieves a list of argument keys.- Specified by:
getElementsin interfaceIArgBlock- Returns:
- a list of string-based keys
-
elements
public java.util.Enumeration<java.lang.String> elements()
Retrieves a list of argument keys.
-
addLongValue
public java.lang.Object addLongValue(java.lang.String n, long v)Adds long-type arguments to this block.- Specified by:
addLongValuein interfaceIArgBlock- Parameters:
n- keyv- value- Returns:
- value
-
addIntegerValue
public java.lang.Object addIntegerValue(java.lang.String n, int v)Adds integer-type arguments to this block.- Specified by:
addIntegerValuein interfaceIArgBlock- Parameters:
n- keyv- value- Returns:
- value
-
addBooleanValue
public java.lang.Object addBooleanValue(java.lang.String n, boolean v)Adds boolean-type arguments to this block.- Specified by:
addBooleanValuein interfaceIArgBlock- Parameters:
n- keyv- value- Returns:
- value
-
addBigIntegerValue
public java.lang.Object addBigIntegerValue(java.lang.String n, java.math.BigInteger v, int radix)Adds integer-type arguments to this block.- Specified by:
addBigIntegerValuein interfaceIArgBlock- Parameters:
n- keyv- valueradix- radix- Returns:
- value
-
-