com.ibm.commerce.me.datatype
Class SupplierCookieTable

java.lang.Object
  java.util.Dictionary
      java.util.Hashtable
          com.ibm.commerce.me.datatype.SupplierCookieTable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class SupplierCookieTable
extends java.util.Hashtable
implements java.io.Serializable, java.lang.Cloneable

This stores the BuyerRequestInfo based on a cookie as a key. It provides a thread safe get and put methods to access the stored objects. It also has an inner class which cleans up the table periodically.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
IBM Copyright notice field
static java.lang.String PLUS_STRING_CONSTANT
value of '+' as a string
Method Summary
BuyerRequestInfo get(java.lang.String e_supplierCookie)
Retrieves the buyer info from the cookie table using the cookie
static SupplierCookieTable getInstance()
Gets the singleton instance.
java.lang.String put(BuyerRequestInfo reqestInfo)
Creates a new supplier cookie and add the buyer info into the cookie table.
static void setMerchantKey(java.lang.String newMerchantKey)
Sets the merchant key with which you can encrypt and decrypt the supplier cookie generated.
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM Copyright notice field
See Also:
Constant Field Values

PLUS_STRING_CONSTANT

public static final java.lang.String PLUS_STRING_CONSTANT
value of '+' as a string
See Also:
Constant Field Values
Method Detail

get

public BuyerRequestInfo get(java.lang.String e_supplierCookie)
                     throws java.lang.Exception
Retrieves the buyer info from the cookie table using the cookie

Note : this method is thread safe as it is synchronized

Returns:
the information of the request from the buyer.
Throws:
java.lang.Exception

getInstance

public static SupplierCookieTable getInstance()
Gets the singleton instance. Anybody who wants to get a handle of the supplier cookie table should call this method.

put

public java.lang.String put(BuyerRequestInfo reqestInfo)
Creates a new supplier cookie and add the buyer info into the cookie table.

Note : this method is thread safe as it is synchronized

Returns:
the newly generated cookie for the supplier used as a key the buyer request information is store

setMerchantKey

public static void setMerchantKey(java.lang.String newMerchantKey)
Sets the merchant key with which you can encrypt and decrypt the supplier cookie generated. This method has to be invoked typically from the init method of request servle or any other servlet which is loaded at the start of the server.
Parameters:
newMerchantKey - the new merchant key used for encryption and decryption.

Feedback