net.wotonomy.web
Class WOSession

java.lang.Object
  extended by net.wotonomy.web.WOSession
All Implemented Interfaces:
java.io.Serializable, net.wotonomy.foundation.NSKeyValueCoding, net.wotonomy.foundation.NSKeyValueCodingAdditions

public class WOSession
extends java.lang.Object
implements java.io.Serializable, net.wotonomy.foundation.NSKeyValueCodingAdditions

A pure java implementation of WOSession.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.wotonomy.foundation.NSKeyValueCodingAdditions
net.wotonomy.foundation.NSKeyValueCodingAdditions.DefaultImplementation, net.wotonomy.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface net.wotonomy.foundation.NSKeyValueCoding
net.wotonomy.foundation.NSKeyValueCoding.Null
 
Field Summary
static java.lang.String WOSessionDidCreateNotification
           
static java.lang.String WOSessionDidRestoreNotification
           
static java.lang.String WOSessionDidTimeOutNotification
           
 
Fields inherited from interface net.wotonomy.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
WOSession()
          Default constructor.
 
Method Summary
 void appendToResponse(WOResponse aResponse, WOContext aContext)
          Invoked by the Application to generate the content of the response.
 void awake()
          Invoked at the beginning of the request-response cycle.
 WOContext context()
          Returns the context for the current request.
static void debugString(java.lang.String aString)
          Writes a message to the standard error stream if debugging is activated.
 net.wotonomy.control.EOEditingContext defaultEditingContext()
          Returns the default editing context used by this session.
 java.lang.String domainForIDCookies()
          Returns the current domain for cookies containing session ids.
 net.wotonomy.foundation.NSDate expirationDateForIDCookies()
          Returns the current expiration date for cookies that store session ids.
 java.lang.Object handleQueryWithUnboundKey(java.lang.String aKey)
           
 void handleTakeValueForUnboundKey(java.lang.Object aValue, java.lang.String aKey)
           
 WOActionResults invokeAction(WORequest aRequest, WOContext aContext)
          Invoked by the Application to determine which component is the intended recipient of the user's action.
 boolean isDistributionEnabled()
          Returns whether the session is part of a distributed application.
 boolean isTerminating()
          Returns whether the current session will terminate at the completion of the current response.
 net.wotonomy.foundation.NSArray languages()
          Returns the languages for which this session has been localized, in order of preference.
static void logString(java.lang.String aString)
          Writes a message to the standard error stream.
 java.lang.Object objectForKey(java.lang.String aKey)
          Returns the session value associated with the specified key.
 void removeObjectForKey(java.lang.String aKey)
          Removes the session value associated with the specified key.
 WOComponent restorePageForContextID(java.lang.String anID)
          Returns the page in the session's page cache corresponding to the specified context id.
 void savePage(WOComponent aComponent)
          Puts this page in the session's page cache using the current context id as the key.
 void savePageInPermanentCache(WOComponent aComponent)
          Puts this page in the special cache is will not get automatically flushed like the session page cache.
 java.lang.String sessionID()
          Returns the id of the current session.
 void setDefaultEditingContext(net.wotonomy.control.EOEditingContext aContext)
          Sets the default editing context used by this session.
 void setDistributionEnabled(boolean enabled)
          Sets whether distribution is currently enabled.
 void setLanguages(net.wotonomy.foundation.NSArray anArray)
          Sets the languages for which this session has been localized, in order of preference.
 void setObjectForKey(java.lang.Object anObject, java.lang.String aKey)
          Stores the specified key-value pair in the session.
 void setStoresIDsInCookies(boolean cookies)
          Sets whether session ids should be stored in cookies.
 void setStoresIDsInURLs(boolean urls)
          Sets whether session ids should be stored in urls.
 void setTimeOut(double timeout)
          Sets the number of seconds after the last request before the session should be terminated.
 void sleep()
          Invoked at the end of the request-response cycle.
 net.wotonomy.foundation.NSArray statistics()
          Returns a list of pages accessed by this session in order of their access and named by calling WOComponent.descriptionForResponse.
 java.lang.Object storedValueForKey(java.lang.String aKey)
           
 boolean storesIDsInCookies()
          Returns whether session ids are currently stored in cookies.
 boolean storesIDsInURLs()
          Returns whether session ids are currently stored in urls.
 void takeStoredValueForKey(java.lang.Object aValue, java.lang.String aKey)
           
 void takeValueForKey(java.lang.Object aValue, java.lang.String aKey)
           
 void takeValueForKeyPath(java.lang.Object aValue, java.lang.String aPath)
           
 void takeValuesFromDictionary(java.util.Map aValueMap)
           
 void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
          Invoked by the Application to extract user-assigned balues and assign them to attributes.
 void terminate()
          Terminates this session after the completion of the current response.
 double timeOut()
          Returns the number of seconds after the last request before the session should be terminated.
 void unableToSetNullForKey(java.lang.String aKey)
           
 java.lang.Object validateTakeValueForKeyPath(java.lang.Object aValue, java.lang.String aKey)
           
 java.lang.Object valueForKey(java.lang.String aKey)
           
 java.lang.Object valueForKeyPath(java.lang.String aPath)
           
 net.wotonomy.foundation.NSDictionary valuesForKeys(java.util.List aKeyList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WOSessionDidTimeOutNotification

public static final java.lang.String WOSessionDidTimeOutNotification
See Also:
Constant Field Values

WOSessionDidRestoreNotification

public static final java.lang.String WOSessionDidRestoreNotification
See Also:
Constant Field Values

WOSessionDidCreateNotification

public static final java.lang.String WOSessionDidCreateNotification
See Also:
Constant Field Values
Constructor Detail

WOSession

public WOSession()
Default constructor. This is called implicitly by subclasses in all cases.

Method Detail

sessionID

public java.lang.String sessionID()
Returns the id of the current session. If no session currently exists, return null.


setDistributionEnabled

public void setDistributionEnabled(boolean enabled)
Sets whether distribution is currently enabled. This method is not implemented by this implementation as the servlet container manages distribution.


isDistributionEnabled

public boolean isDistributionEnabled()
Returns whether the session is part of a distributed application. This implementation always returns false.


setStoresIDsInCookies

public void setStoresIDsInCookies(boolean cookies)
Sets whether session ids should be stored in cookies. This method is not implemented in this implementation as the servlet container manages sessions with cookies.


storesIDsInCookies

public boolean storesIDsInCookies()
Returns whether session ids are currently stored in cookies. This implementation always returns true.


expirationDateForIDCookies

public net.wotonomy.foundation.NSDate expirationDateForIDCookies()
Returns the current expiration date for cookies that store session ids.


setStoresIDsInURLs

public void setStoresIDsInURLs(boolean urls)
Sets whether session ids should be stored in urls. This method is not implemented in this implementation as the servlet container manages sessions with cookies.


storesIDsInURLs

public boolean storesIDsInURLs()
Returns whether session ids are currently stored in urls. This implementation always returns false.


domainForIDCookies

public java.lang.String domainForIDCookies()
Returns the current domain for cookies containing session ids.


terminate

public void terminate()
Terminates this session after the completion of the current response.


isTerminating

public boolean isTerminating()
Returns whether the current session will terminate at the completion of the current response.


setTimeOut

public void setTimeOut(double timeout)
Sets the number of seconds after the last request before the session should be terminated.


timeOut

public double timeOut()
Returns the number of seconds after the last request before the session should be terminated.


setLanguages

public void setLanguages(net.wotonomy.foundation.NSArray anArray)
Sets the languages for which this session has been localized, in order of preference. The application will be responsible for localizing the content based on the languages found in this array.


languages

public net.wotonomy.foundation.NSArray languages()
Returns the languages for which this session has been localized, in order of preference. The application will be responsible for localizing the content based on the languages found in this array.


setObjectForKey

public void setObjectForKey(java.lang.Object anObject,
                            java.lang.String aKey)
Stores the specified key-value pair in the session.


objectForKey

public java.lang.Object objectForKey(java.lang.String aKey)
Returns the session value associated with the specified key.


removeObjectForKey

public void removeObjectForKey(java.lang.String aKey)
Removes the session value associated with the specified key.


context

public WOContext context()
Returns the context for the current request.


awake

public void awake()
Invoked at the beginning of the request-response cycle. Override to perform any kind of initialization at the start of a request. This implementation does nothing.


takeValuesFromRequest

public void takeValuesFromRequest(WORequest aRequest,
                                  WOContext aContext)
Invoked by the Application to extract user-assigned balues and assign them to attributes. This implementation calls takeValuesFromRequest on the top-level component.


invokeAction

public WOActionResults invokeAction(WORequest aRequest,
                                    WOContext aContext)
Invoked by the Application to determine which component is the intended recipient of the user's action. This implementation calls invokeAction on the top-level component.


appendToResponse

public void appendToResponse(WOResponse aResponse,
                             WOContext aContext)
Invoked by the Application to generate the content of the response. This implementation calls appendToResponse on the top-level component.


sleep

public void sleep()
Invoked at the end of the request-response cycle. Override to perform any kind of clean-up at the end of a request. This implementation does nothing.


statistics

public net.wotonomy.foundation.NSArray statistics()
Returns a list of pages accessed by this session in order of their access and named by calling WOComponent.descriptionForResponse.


savePage

public void savePage(WOComponent aComponent)
Puts this page in the session's page cache using the current context id as the key.


restorePageForContextID

public WOComponent restorePageForContextID(java.lang.String anID)
Returns the page in the session's page cache corresponding to the specified context id. Any special permanent caches are searched before the standard page cache.


savePageInPermanentCache

public void savePageInPermanentCache(WOComponent aComponent)
Puts this page in the special cache is will not get automatically flushed like the session page cache. Use this if the page is likely to be around for a while, specifically pages within frames.


logString

public static void logString(java.lang.String aString)
Writes a message to the standard error stream.


debugString

public static void debugString(java.lang.String aString)
Writes a message to the standard error stream if debugging is activated.


defaultEditingContext

public net.wotonomy.control.EOEditingContext defaultEditingContext()
Returns the default editing context used by this session. Defaults to null.


setDefaultEditingContext

public void setDefaultEditingContext(net.wotonomy.control.EOEditingContext aContext)
Sets the default editing context used by this session.


valueForKeyPath

public java.lang.Object valueForKeyPath(java.lang.String aPath)
Specified by:
valueForKeyPath in interface net.wotonomy.foundation.NSKeyValueCodingAdditions

takeValueForKeyPath

public void takeValueForKeyPath(java.lang.Object aValue,
                                java.lang.String aPath)
Specified by:
takeValueForKeyPath in interface net.wotonomy.foundation.NSKeyValueCodingAdditions

valuesForKeys

public net.wotonomy.foundation.NSDictionary valuesForKeys(java.util.List aKeyList)
Specified by:
valuesForKeys in interface net.wotonomy.foundation.NSKeyValueCodingAdditions

takeValuesFromDictionary

public void takeValuesFromDictionary(java.util.Map aValueMap)
Specified by:
takeValuesFromDictionary in interface net.wotonomy.foundation.NSKeyValueCodingAdditions

valueForKey

public java.lang.Object valueForKey(java.lang.String aKey)
Specified by:
valueForKey in interface net.wotonomy.foundation.NSKeyValueCoding

takeValueForKey

public void takeValueForKey(java.lang.Object aValue,
                            java.lang.String aKey)
Specified by:
takeValueForKey in interface net.wotonomy.foundation.NSKeyValueCoding

storedValueForKey

public java.lang.Object storedValueForKey(java.lang.String aKey)
Specified by:
storedValueForKey in interface net.wotonomy.foundation.NSKeyValueCoding

takeStoredValueForKey

public void takeStoredValueForKey(java.lang.Object aValue,
                                  java.lang.String aKey)
Specified by:
takeStoredValueForKey in interface net.wotonomy.foundation.NSKeyValueCoding

handleQueryWithUnboundKey

public java.lang.Object handleQueryWithUnboundKey(java.lang.String aKey)
Specified by:
handleQueryWithUnboundKey in interface net.wotonomy.foundation.NSKeyValueCoding

handleTakeValueForUnboundKey

public void handleTakeValueForUnboundKey(java.lang.Object aValue,
                                         java.lang.String aKey)
Specified by:
handleTakeValueForUnboundKey in interface net.wotonomy.foundation.NSKeyValueCoding

unableToSetNullForKey

public void unableToSetNullForKey(java.lang.String aKey)
Specified by:
unableToSetNullForKey in interface net.wotonomy.foundation.NSKeyValueCoding

validateTakeValueForKeyPath

public java.lang.Object validateTakeValueForKeyPath(java.lang.Object aValue,
                                                    java.lang.String aKey)


Copyright © 2006 null. All Rights Reserved.