ariba.util.core
Class TokenTable

java.lang.Object
  extended by ariba.util.core.TokenTable

public class TokenTable
extends java.lang.Object

A table of tokens that map to objects. Objects can be stored in the TokenTable. A token is returned that can be used to remove the object. The object is invalidated after the expireTime milliseconds.


Constructor Summary
TokenTable()
          Creates a new TokenTable with the default expiration time.
TokenTable(long expireTime)
          Creates a new TokenTable.
 
Method Summary
 java.lang.String insert(java.lang.Object object)
          This method inserts the given object into the token table and assigns it a unique random string for lookup.
 java.lang.Object lookup(java.lang.String token)
          This method looks up the object stored in our table for the given token string.
 java.lang.Object remove(java.lang.String token)
          This method removes and returns the object stored in our table for the given token string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenTable

public TokenTable()
Creates a new TokenTable with the default expiration time.


TokenTable

public TokenTable(long expireTime)
Creates a new TokenTable. The expiration time is set to expireTime, which should be expressed in milliseconds.

Method Detail

insert

public java.lang.String insert(java.lang.Object object)
This method inserts the given object into the token table and assigns it a unique random string for lookup. If we are unable to generate a unique token (which is extremely unlikely), return null. Otherwise, return the unique string which can be used to retrieve the object.


lookup

public java.lang.Object lookup(java.lang.String token)
This method looks up the object stored in our table for the given token string. It also removes any objects in the table that have expired.


remove

public java.lang.Object remove(java.lang.String token)
This method removes and returns the object stored in our table for the given token string. It also removes any objects that have expired.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.