com.esri.adf.web.data
Class WebSession

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

public class WebSession
extends java.lang.Object
implements java.io.Serializable

Stores the information pertinent to a web session.

See Also:
Serialized Form

Field Summary
static java.lang.String SESSION_ATTRIBUTE_NAME
          The name by which this object is typically referenced in the HttpSession.
 
Constructor Summary
WebSession()
          Creates a new WebSession.
WebSession(java.lang.String id)
           
 
Method Summary
 void destroy()
          Destroys the WebSession.
 java.lang.Object getAttribute(java.lang.String name)
          Returns a WebSession attribute by name.
 java.lang.String getId()
          The ID of this session.
 byte[] getMimeData(java.lang.String id)
          Return the MIME data from a Hashtable based the unique identifier.
 java.lang.String getName()
          Returns the name under which this object is stored in session.
 WebApplication getWebApplication()
          Deprecated. no replacement
 java.util.List<WebContext> getWebContexts()
          Returns a {Map} of all the WebContexts associated with this WebSession.
 boolean hasMimeData(java.lang.String id)
           
 boolean removeMimeData(java.lang.String id)
          Remove the MIME data from a Hashtable based on the unique identifier.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets an attribute stored on the WebSession.
 void setId(java.lang.String id)
           
 void setMimeData(java.lang.String id, byte[] mimeData)
          Adds the MIME data to a Hashtable.
 void setName(java.lang.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 java.lang.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(java.lang.String id)
Method Detail

getId

public java.lang.String getId()
The ID of this session.

Returns:
String- the ID

setId

public void setId(java.lang.String id)

getWebContexts

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

Returns:
List- the WebContexts

setAttribute

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

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

getAttribute

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

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

getName

public java.lang.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

setName

public void setName(java.lang.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(java.lang.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(java.lang.String id)
Return the MIME data from a Hashtable based the unique identifier.

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

removeMimeData

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

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

hasMimeData

public boolean hasMimeData(java.lang.String id)

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