org.apache.turbine.services.pull.util
Class SessionData

java.lang.Object
  extended byorg.apache.turbine.services.pull.util.SessionData
All Implemented Interfaces:
ApplicationTool

public class SessionData
extends java.lang.Object
implements ApplicationTool

Pull tool designed to be used in the session scope for storage of temporary data. This tool should eliminate the need for the User.setTemp(java.lang.String, java.lang.Object) and User.getTemp(java.lang.String) methods.

Version:
$Id: SessionData.java 534527 2007-05-02 16:10:59Z tv $
Author:
Quinton McCombs

Constructor Summary
SessionData()
           
 
Method Summary
 void clear()
          Clears all data
 boolean containsKey(java.lang.String key)
          Determines is a given key is stored.
 java.lang.Object get(java.lang.String key)
          Gets the data stored under the key.
 void init(java.lang.Object data)
          Initialize the application tool.
 java.util.Iterator iterator()
          Gets a iterator for the keys.
 void put(java.lang.String key, java.lang.Object value)
          Stores the data.
 void refresh()
          Refresh the application tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionData

public SessionData()
Method Detail

init

public void init(java.lang.Object data)
Initialize the application tool.

Specified by:
init in interface ApplicationTool
Parameters:
data - initialization data

refresh

public void refresh()
Refresh the application tool.

Specified by:
refresh in interface ApplicationTool

get

public java.lang.Object get(java.lang.String key)
Gets the data stored under the key. Null will be returned if the key does not exist or if null was stored under the key.

To check for a key with a null value use containsKey(java.lang.String).

Parameters:
key - key under which the data is stored.
Returns:
Object stored under the key.

containsKey

public boolean containsKey(java.lang.String key)
Determines is a given key is stored.

Parameters:
key - the key to check for
Returns:
true if the key was found

put

public void put(java.lang.String key,
                java.lang.Object value)
Stores the data. If the key already exists, the value will be overwritten.

Parameters:
key - key under which the data will be stored.
value - data to store under the key. Null values are allowed.

clear

public void clear()
Clears all data


iterator

public java.util.Iterator iterator()
Gets a iterator for the keys.

Returns:
Iterator for the keys


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.