com.ibm.wbi.request
Class RequestInfo

com.ibm.wbi.request.RequestInfo

public class RequestInfo

The request info object is intended to describe the request that is flowing through the proxy (and the megs). Specific types of requests should be represented by request info subclasses that have their own identification number.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information.
protected  java.util.Properties extraRuleKeys
          The extra key/value pairs for the meg rule engine to consider.
protected  java.util.Hashtable keyToValueMap
          A mapping of key to values that can be used in the rules engine.
protected  java.util.Hashtable transactionData
          Store for extra key/value pair that are associated with this transaction.
static int UNIQUE_ID
          Unique number of the request info object.
 
Constructor Summary
RequestInfo()
          Constuct a new request info object.
 
Method Summary
 void addRuleValue(java.lang.String key, java.lang.String value)
          Add a key/value pair that will be evaluated by the rules engine.
 RequestInfo createInstance()
          Create an empty instance of this request info class.
 java.util.Enumeration getAllExtraRuleKeys()
          Gets an Enumeration of all keys in the extra key/value set.
 java.lang.String getExtraRuleKey(java.lang.String key)
          Gets the requested value from the list of key/value pairs for the meg rule engine to consider.
 int getIdentifier()
          Get the unique number of the request info class.
 java.util.Enumeration getRuleKeys()
          Get an enumeration of the rule keys.
 java.lang.String getRuleValue(java.lang.String key)
          Get the rule value from the specified key.
 java.util.Enumeration getRuleValues()
          Get an enumeration of the rule values.
 java.lang.Object getTransactionData(java.lang.Object key)
          Access a key/value pair that is associated with this transaction.
 java.util.Enumeration getTransactionDataElements()
          Get an enumeration of the values in the transaction data hashtable.
 java.util.Enumeration getTransactionDataKeys()
          Get an enumeration of the keys in the transaction data hashtable.
 void populateInstance(RequestInfo toCopy)
          Populate the object from the passed in request info (make this object a copy of the passed in one).
 boolean removeRuleValue(java.lang.String key)
          Remove a key/value pair that will be evaluated by the rules engine.
 void setExtraRuleKey(java.lang.String key, java.lang.String value)
          Sets an extra key/value pair for the meg rule engine to consider.
 void setTransactionData(java.lang.Object key, java.lang.Object value)
          Store a key/value pair that is associated with this transaction.
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information.

UNIQUE_ID

public static final int UNIQUE_ID
Unique number of the request info object.

keyToValueMap

protected java.util.Hashtable keyToValueMap
A mapping of key to values that can be used in the rules engine. The key represents the condition key and the value is the specific value for that key in the requetst info object.

extraRuleKeys

protected java.util.Properties extraRuleKeys
The extra key/value pairs for the meg rule engine to consider.

transactionData

protected java.util.Hashtable transactionData
Store for extra key/value pair that are associated with this transaction.
Constructor Detail

RequestInfo

public RequestInfo()
Constuct a new request info object.
Method Detail

createInstance

public RequestInfo createInstance()
Create an empty instance of this request info class.
Returns:
The request info object.
See Also:
com.ibm.wbi.request.RequestDescriptor

populateInstance

public void populateInstance(RequestInfo toCopy)
Populate the object from the passed in request info (make this object a copy of the passed in one).
Parameters:
toCopy - The request info to populate from.
See Also:
com.ibm.wbi.request.RequestDescriptor

getIdentifier

public int getIdentifier()
Get the unique number of the request info class.
Returns:
The unique identifier for the request info object.
See Also:
com.ibm.wbi.request.RequestDescriptor

addRuleValue

public void addRuleValue(java.lang.String key,
                         java.lang.String value)
Add a key/value pair that will be evaluated by the rules engine.
Parameters:
key - The key.
value - The value.

removeRuleValue

public boolean removeRuleValue(java.lang.String key)
Remove a key/value pair that will be evaluated by the rules engine.
Parameters:
key - The key of the key/value pair to remove.
Returns:
true if removed; false if not found.

getRuleValue

public java.lang.String getRuleValue(java.lang.String key)
Get the rule value from the specified key.
Parameters:
key - The key.
Returns:
The value associated with the key.

getRuleValues

public java.util.Enumeration getRuleValues()
Get an enumeration of the rule values.
Returns:
Rule value enumeration.

getRuleKeys

public java.util.Enumeration getRuleKeys()
Get an enumeration of the rule keys.
Returns:
Rule key enumeration.

setExtraRuleKey

public void setExtraRuleKey(java.lang.String key,
                            java.lang.String value)
Sets an extra key/value pair for the meg rule engine to consider. Any previous value for the key is replaced with the new one. These keys can be set by one meg and then used to switch other megs in and out of the meg chain by having their rules depend on the values of these keys.
Parameters:
key - The key to store the value under. Must begin with a '$' character.
value - The value to store under the key.

getExtraRuleKey

public java.lang.String getExtraRuleKey(java.lang.String key)
Gets the requested value from the list of key/value pairs for the meg rule engine to consider.
Parameters:
key - The key for which a value is needed. Must begin with a '$' character.
Returns:
The value stored under the given key; "" if key not defined.

getAllExtraRuleKeys

public java.util.Enumeration getAllExtraRuleKeys()
Gets an Enumeration of all keys in the extra key/value set. These keys can be set by one meg and then used to switch other megs in and out of the meg chain by having their rules depend on the values of these keys.
Returns:
An Enumeration of all the keys in the extra key/value set.

setTransactionData

public void setTransactionData(java.lang.Object key,
                               java.lang.Object value)
Store a key/value pair that is associated with this transaction. Any other meg can access this data using the getTransactionData() method on the RequestInfo object on its own MegInputStream. This mechanism can be used to communicate precomputed results between megs. The data is not available to a meg operating on a different transaction.
Parameters:
key - The key which the data is stored.
value - The data to store.

getTransactionData

public java.lang.Object getTransactionData(java.lang.Object key)
Access a key/value pair that is associated with this transaction.
Parameters:
key - The key under which the data is stored.
The - value of the data to store.

getTransactionDataElements

public java.util.Enumeration getTransactionDataElements()
Get an enumeration of the values in the transaction data hashtable.
Returns:
An enumeration of transaction data values.

getTransactionDataKeys

public java.util.Enumeration getTransactionDataKeys()
Get an enumeration of the keys in the transaction data hashtable.
Returns:
An enumeration of transaction data keys.