Package com.microstrategy.web.app.beans
Class HttpRequestKeys
- java.lang.Object
-
- com.microstrategy.web.beans.GenericRequestKeys
-
- com.microstrategy.web.app.beans.HttpRequestKeys
-
- All Implemented Interfaces:
RequestKeys
public class HttpRequestKeys extends GenericRequestKeys
The HttpRequestKeys class makes available to the application the values of parameters passed on the URL (Query String), post (form data), cookies and session variables.
It has been implemented as case insensitive, meaning that if one key is recorded as "abc" with value "1" and another with key as "ABC" and value "2", both values will be accessible via the same key (that can be requested as "abc", "ABC", "aBC", etc)- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description static int
COOKIE_SPACE
Flag for including cookies on the key space property of the HttpRequestKeys instancestatic int
FORM_AND_QUERY_DATA_SPACE
Flag for including form data on the key space property of the HttpRequestKeys instancestatic int
SESSION_SPACE
Flag for including session variables on the key space property of the HttpRequestKeys instance-
Fields inherited from class com.microstrategy.web.beans.GenericRequestKeys
src
-
-
Constructor Summary
Constructors Constructor Description HttpRequestKeys(ContainerServices containerServices)
Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
add(java.lang.String key, java.lang.String value)
Add the requested key and its value to the collection.java.util.Enumeration
getKeyListByPrefix(java.lang.String prefix)
Returns an enumeration over all the keys with the specified prefix.int
getKeySpace()
Get the key space set for this HttpRequestKeys instance.java.lang.String
getValue(java.lang.String keyName)
Returns from this collection a comma separated string of all the values mapped by the specifiedkeyName
.java.lang.String
getValue(java.lang.String keyName, int valueIndex)
Returns the value at the specified position mapped by the specified keyName.int
getValueCount(java.lang.String keyName)
Returns from this collection the number of values mapped with the keyName.protected void
initializeRequestKeys()
Initializes the collection with the values from the Request and/or Session, according to what was specified by the keySpace.void
setKeySpace(int keySpace)
Set the key space to be used with this HttpRequestKeys instance.-
Methods inherited from class com.microstrategy.web.beans.GenericRequestKeys
add, addKeyValue, addObject, getAllValues, getDebugOut, getIntValue, getIntValue, getName, getNameCount, getObjectAtIndex, getSource, getValueObject, getValueObject, isEmpty, remove, setInitialized, setObjectAtIndex, setSource, setValue, setValueObject, toString
-
-
-
-
Field Detail
-
COOKIE_SPACE
public static final int COOKIE_SPACE
Flag for including cookies on the key space property of the HttpRequestKeys instance- See Also:
- Constant Field Values
-
FORM_AND_QUERY_DATA_SPACE
public static final int FORM_AND_QUERY_DATA_SPACE
Flag for including form data on the key space property of the HttpRequestKeys instance- See Also:
- Constant Field Values
-
SESSION_SPACE
public static final int SESSION_SPACE
Flag for including session variables on the key space property of the HttpRequestKeys instance- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpRequestKeys
public HttpRequestKeys(ContainerServices containerServices)
Class constructor. Initialization requires a non-null Container Services object.- Parameters:
containerServices
- an initialized instance ofContainerServices
-
-
Method Detail
-
getValue
public java.lang.String getValue(java.lang.String keyName)
Returns from this collection a comma separated string of all the values mapped by the specifiedkeyName
.- Specified by:
getValue
in interfaceRequestKeys
- Overrides:
getValue
in classGenericRequestKeys
- Parameters:
keyName
- a key in this collection- Returns:
- all the values mapped to the keyName, separated by the character comma; null if the key does not exist.
-
getValue
public java.lang.String getValue(java.lang.String keyName, int valueIndex)
Returns the value at the specified position mapped by the specified keyName.- Specified by:
getValue
in interfaceRequestKeys
- Overrides:
getValue
in classGenericRequestKeys
- Parameters:
keyName
- a key in this collectionvalueIndex
- the index of a value mapped to the key specified- Returns:
- the value at the specified position mapped by the specified key; null if the key does not exist.
-
getValueCount
public int getValueCount(java.lang.String keyName)
Returns from this collection the number of values mapped with the keyName.- Specified by:
getValueCount
in interfaceRequestKeys
- Overrides:
getValueCount
in classGenericRequestKeys
- Parameters:
keyName
- a key to a value collection- Returns:
- the count of values to which the specified key is mapped in this collection; 0 if the key is not found.
-
getKeyListByPrefix
public java.util.Enumeration getKeyListByPrefix(java.lang.String prefix)
Returns an enumeration over all the keys with the specified prefix.
Returns all the keys if the specified prefix is null or empty.
Returns an empty list if no key is found.- Specified by:
getKeyListByPrefix
in interfaceRequestKeys
- Overrides:
getKeyListByPrefix
in classGenericRequestKeys
- Parameters:
prefix
- the prefix of keys.- Returns:
- an enumeration over all the keys that have the specified prefix.
-
getKeySpace
public int getKeySpace()
Get the key space set for this HttpRequestKeys instance.- Returns:
- an
int
value representing the flags from where the information for the HttpRequestKeys is going to be taken from.
-
setKeySpace
public void setKeySpace(int keySpace)
Set the key space to be used with this HttpRequestKeys instance.- Parameters:
keySpace
- anint
value representing the flags from where the information for the HttpRequestKeys is going to be taken from.
-
add
public java.lang.String add(java.lang.String key, java.lang.String value)
Add the requested key and its value to the collection. Before adding manually new key values, this RequestKeys instance should have initialized the session and request properties, so all the values are added correctly.- Specified by:
add
in interfaceRequestKeys
- Overrides:
add
in classGenericRequestKeys
- Parameters:
key
- the key under which the new value will be appendedvalue
- the value to be appended- Returns:
- a copy of the value added
- Since:
- MicroStrategy Web 9.0.0
-
initializeRequestKeys
protected void initializeRequestKeys()
Initializes the collection with the values from the Request and/or Session, according to what was specified by the keySpace.- Overrides:
initializeRequestKeys
in classGenericRequestKeys
-
-