Package com.microstrategy.web.app.beans
Class CaseInsensitiveRequestKeys
- java.lang.Object
-
- com.microstrategy.web.beans.GenericRequestKeys
-
- com.microstrategy.web.app.beans.CaseInsensitiveRequestKeys
-
- All Implemented Interfaces:
RequestKeys
- Direct Known Subclasses:
StringRequestKeys
public abstract class CaseInsensitiveRequestKeys extends GenericRequestKeys
The CaseInsensitiveRequestKeys abstract class makes available the architecture required for being able to handle request keys as case insensitive. 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).
Any child of this class should call thegetKeyToSearch(java.lang.String)
andupdateKeyMapping(java.lang.String)
whenever requests with keys are directly called. These methods take care of mapping the user-given key to the one actually used for storing the values.- Since:
- MicroStrategy Web 7.5.0
-
-
Field Summary
-
Fields inherited from class com.microstrategy.web.beans.GenericRequestKeys
src
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveRequestKeys()
Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Enumeration
getKeyListByPrefix(java.lang.String prefix)
Returns an enumeration over all the keys with the specified prefix.protected java.lang.String
getKeyToSearch(java.lang.String originalKey)
Get which key to search, for supporting case insensitive scenarios.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
updateKeyMapping(java.lang.String originalKey)
Keep the key mapping list updated by calling this method with the key name requested by the user.-
Methods inherited from class com.microstrategy.web.beans.GenericRequestKeys
add, add, addKeyValue, addObject, getAllValues, getDebugOut, getIntValue, getIntValue, getName, getNameCount, getObjectAtIndex, getSource, getValueObject, getValueObject, initializeRequestKeys, isEmpty, remove, setInitialized, setObjectAtIndex, setSource, setValue, setValueObject, toString
-
-
-
-
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.
-
getKeyToSearch
protected java.lang.String getKeyToSearch(java.lang.String originalKey)
Get which key to search, for supporting case insensitive scenarios.- Parameters:
originalKey
- the original key requested by the user- Returns:
- a
String
value with the key with the correct casing that should be used for accessing the stored request values.
-
updateKeyMapping
protected void updateKeyMapping(java.lang.String originalKey)
Keep the key mapping list updated by calling this method with the key name requested by the user. If the key has already been mapped calling this method has no effect (it should still be done for security).- Parameters:
originalKey
-String
with the key used for storing or retrieving values.
-
-