public abstract class

CaseInsensitiveRequestKeys

extends GenericRequestKeys
java.lang.Object
   ↳ com.microstrategy.web.beans.GenericRequestKeys
     ↳ com.microstrategy.web.app.beans.CaseInsensitiveRequestKeys
Known Direct Subclasses

Class Overview

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 the getKeyToSearch(String) and updateKeyMapping(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.

Summary

Public Constructors
CaseInsensitiveRequestKeys()
Class constructor.
Public Methods
Enumeration getKeyListByPrefix(String prefix)
Returns an enumeration over all the keys with the specified prefix.
String getValue(String keyName)
Returns from this collection a comma separated string of all the values mapped by the specified keyName.
String getValue(String keyName, int valueIndex)
Returns the value at the specified position mapped by the specified keyName.
int getValueCount(String keyName)
Returns from this collection the number of values mapped with the keyName.
Protected Methods
String getKeyToSearch(String originalKey)
Get which key to search, for supporting case insensitive scenarios.
void updateKeyMapping(String originalKey)
Keep the key mapping list updated by calling this method with the key name requested by the user.
[Expand]
Inherited Methods
From class com.microstrategy.web.beans.GenericRequestKeys
From class java.lang.Object
From interface com.microstrategy.web.beans.RequestKeys

Public Constructors

public CaseInsensitiveRequestKeys ()

Class constructor.

Public Methods

public Enumeration getKeyListByPrefix (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.

Parameters
prefix the prefix of keys.
Returns
  • an enumeration over all the keys that have the specified prefix.

public String getValue (String keyName)

Returns from this collection a comma separated string of all the values mapped by the specified keyName.

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.

public String getValue (String keyName, int valueIndex)

Returns the value at the specified position mapped by the specified keyName.

Parameters
keyName a key in this collection
valueIndex 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.

public int getValueCount (String keyName)

Returns from this collection the number of values mapped with the keyName.

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.

Protected Methods

protected String getKeyToSearch (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.

protected void updateKeyMapping (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.