com.esri.adf.web.data
Class WebSession

java.lang.Object
  extended by com.esri.adf.web.data.WebSession
All Implemented Interfaces:
Serializable

public class WebSession
extends Object
implements Serializable

Stores the information pertinent to a web session.

See Also:
Serialized Form

Field Summary
static String SESSION_ATTRIBUTE_NAME
          The name by which this object is typically referenced in the HttpSession.
 
Constructor Summary
WebSession()
          Creates a new WebSession.
WebSession(String id)
           
 
Method Summary
 void destroy()
          Destroys the WebSession.
 Object getAttribute(String attrName)
          Returns a WebSession attribute by name.
 String getCharacterEncoding()
           
 String getId()
          The ID of this session.
 byte[] getMimeData(String mimeid)
          Return the MIME data from a Hashtable based the unique identifier.
 String getName()
          Returns the name under which this object is stored in session.
 WebApplication getWebApplication()
          Deprecated. no replacement
 List<WebContext> getWebContexts()
          Returns a {Map} of all the WebContexts associated with this WebSession.
 boolean hasMimeData(String mimeid)
           
 boolean removeMimeData(String mimeid)
          Remove the MIME data from a Hashtable based on the unique identifier.
 void setAttribute(String name, Object value)
          Sets an attribute stored on the WebSession.
 void setCharacterEncoding(String characterEncoding)
           
 void setId(String id)
           
 void setMimeData(String id, byte[] mimeData)
          Adds the MIME data to a Hashtable.
 void setName(String name)
          Sets the name under which this object is stored in session.
 void setWebApplication(WebApplication application)
          Deprecated. no replacement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_ATTRIBUTE_NAME

public static final String SESSION_ATTRIBUTE_NAME
The name by which this object is typically referenced in the HttpSession.

See Also:
Constant Field Values
Constructor Detail

WebSession

public WebSession()
Creates a new WebSession.


WebSession

public WebSession(String id)
Method Detail

getId

public String getId()
The ID of this session.

Returns:
String- the ID

setId

public void setId(String id)

getWebContexts

public List<WebContext> getWebContexts()
Returns a {Map} of all the WebContexts associated with this WebSession.

Returns:
List- the WebContexts

setAttribute

public void setAttribute(String name,
                         Object value)
Sets an attribute stored on the WebSession.

Parameters:
name - the name of the attribute
value - the object to store

getAttribute

public Object getAttribute(String attrName)
Returns a WebSession attribute by name.

Parameters:
attrName - the name of the attribute
Returns:
Object- the object stored in the attribute

getName

public String getName()
Returns the name under which this object is stored in session. The default value is SESSION_ATTRIBUTE_NAME. But in some cases, for example in portlets, it may be stored under a different name.

Returns:
String- the name

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
Parameters:
characterEncoding - the characterEncoding to set

getCharacterEncoding

public String getCharacterEncoding()
Returns:
the characterEncoding

setName

public void setName(String name)
Sets the name under which this object is stored in session. The default value is SESSION_ATTRIBUTE_NAME. But in some cases, for example in portlets, it may be stored under a different name. NOTE: Do not call this method if not required. The name of the object is automatically set in the valueBound method when this object is set in session.

Parameters:
name - the name

destroy

public void destroy()
Destroys the WebSession. All objects associated with this session are destroyed and the WebSession is removed from the associated WebApplication.


setMimeData

public void setMimeData(String id,
                        byte[] mimeData)
Adds the MIME data to a Hashtable.

Parameters:
id - the MIME identifier
mimeData - the MIME data bytes

getMimeData

public byte[] getMimeData(String mimeid)
Return the MIME data from a Hashtable based the unique identifier.

Parameters:
mimeid - the MIME identifier
Returns:
byte[]- the MIME data bytes

removeMimeData

public boolean removeMimeData(String mimeid)
Remove the MIME data from a Hashtable based on the unique identifier.

Parameters:
mimeid - the MIME identifier
Returns:
boolean - true if data is removed

hasMimeData

public boolean hasMimeData(String mimeid)

setWebApplication

@Deprecated
public void setWebApplication(WebApplication application)
Deprecated. no replacement

Sets the WebApplication object associated with this session.

Parameters:
application - the WebApplication object associated with this session

getWebApplication

@Deprecated
public WebApplication getWebApplication()
Deprecated. no replacement

Returns the WebApplication object associated with this session.

Returns:
WebApplication- the WebApplication object associated with this session