ariba.ui.aribaweb.core
Class AWSession

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.core.AWSession
All Implemented Interfaces:
AWDisposable, AWObject, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener

public class AWSession
extends AWBaseObject
implements javax.servlet.http.HttpSessionBindingListener, AWDisposable


Nested Class Summary
static interface AWSession.LifecycleListener
           
 
Field Summary
 java.lang.String _backTrackURL
           
 java.lang.String _forwardTrackURL
           
 java.lang.String _refreshURL
           
static int BacktrackRequest
           
static int ForwardTrackRequest
           
static int InterruptedNewRequest
           
static int NewRequest
           
static int NoOpRequest
           
static int RefreshRequest
           
static java.lang.String ResourceManagerKey
           
 
Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber
 
Constructor Summary
AWSession()
           
 
Method Summary
 void _forceLocale(java.util.Locale locale)
           
 void _updatePageResourceManager(AWResourceManager resourceManager)
           
 void addNotification(AWNotification notification)
          We are assuming many writers, but only one reader
 boolean allowParentFrame()
           
 AWApplication application()
           
 java.lang.String brandName()
           
 java.lang.String brandVersion()
           
 AWCharacterEncoding characterEncoding()
           
static void cleanupThreadState()
          For AW processing by long running threads that do not execute the usual UI request / response code path.
 void clearAllPageCaches()
           
 void clearPageCache()
           
 java.util.TimeZone clientTimeZone()
           
 java.lang.String debugDisconnectString()
          Note: this method can be called from an asynchronous non-UI thread
 java.util.Map dict()
           
 long disconnectTime()
          Returns the time (in millis) at which point this session is considered to be disconnected.
 void dispose()
           
 void dontReplaceLastPerformanceStats()
          This call prevents that the last perf stats will be replaced by the current one in the sleep phase.
 AWEnvironmentStack environmentStack()
           
 java.lang.String getBackTrackURL()
           
 java.lang.String getForwardTrackURL()
           
 long getLastAccessedTime()
           
 java.util.List getNotifications()
           
 java.lang.String getRefreshURL()
           
 void getShutdownWarning()
           
 int getTimeout()
          session timeout in seconds Note: this method can be called from an asynchronous non-UI thread
 boolean hasChanged()
           
 boolean hasNotification()
          No need to synchronize, since this will become false only after the one reader consumes the list
 boolean hasShutdownWarning()
           
 int historyLength()
           
 int historyPosition()
           
 javax.servlet.http.HttpSession httpSession()
           
 void init(AWApplication application, AWRequestContext requestContext)
           
static void initializeThreadState()
          For AW processing by long running threads that do not execute the usual UI request / response code path.
 boolean isAccessibilityEnabled()
           
 boolean isBrandTestMode()
           
 boolean isConnected()
           
 boolean isMarkedForTermination()
           
 boolean isTerminated()
           
 PerformanceState.Stats lastRequestPerfStats()
           
 void markAppBoundary()
           
 void markForTermination()
           
 AWPageCacheMark markPageCache()
           
 boolean omitWrapperFrame()
           
 AWComponent pageWithName(java.lang.String pageName)
           
 java.util.Locale preferredLocale()
           
 AWPage previousPage(AWPage page)
          Use this to get the previously cached page -- do not use session.previousPage() as that is only for refreshRegions support, especially since previousPage() has been removed.
 boolean registerActiveSession()
          Registers the session with monitor stats object.
static void registerLifecycleListener(AWSession.LifecycleListener listener)
           
 java.lang.String remoteHostAddress()
           
 java.net.InetAddress remoteIPAddress()
           
 void removeFromPageCache(AWPage page)
           
 void removePageCache(AWEncodedString frameName)
           
 AWRequest request()
           
 AWRequestContext requestContext()
           
 int requestType(AWRequest request)
           
 AWResourceManager resourceManager()
           
 AWPage restoreCurrentPage()
           
 AWPage restoreNextPage(AWPage page)
           
 AWPage restorePreviousPage(AWPage page)
           
 void savePage(AWPage page)
           
 void savePage(AWPage page, boolean isExceptionPage)
           
static AWSession session(javax.servlet.http.HttpSession httpSession)
           
 java.lang.String sessionId()
           
 java.lang.String sessionIdentifier()
           
 java.lang.String sessionSecureId()
           
 void setAccessibilityEnabled(boolean flag)
           
 void setAllowParentFrame(boolean allowParentFrame)
           
 void setBackTrackURL(java.lang.String url)
           
 void setBrandName(java.lang.String brandName)
           
 void setBrandTestMode(boolean flag)
           
 void setBrandVersion(java.lang.String brandVersion)
           
 void setCharacterEncoding(AWCharacterEncoding characterEncoding)
           
 void setClientTimeZone(java.util.TimeZone timeZone)
           
 void setConnected(boolean flag)
           
 void setForwardTrackURL(java.lang.String url)
           
 void setOmitWrapperFrame(boolean omit)
           
 void setPreferredLocale(java.util.Locale locale)
           
 void setRefreshURL(java.lang.String url)
           
 void setRemoteHostAddress(java.lang.String remoteHostAddress)
           
 void setRequestInterval(int requestInterval)
          Sets the expected amount of time between requests for this session in seconds.
static void setSession(javax.servlet.http.HttpSession httpSession, AWSession awsession)
           
 void setSessionId(java.lang.String newSessionId)
          The AWSession id should have been assigned during initialization.
 void setSessionIdentifier(java.lang.String sessionIdentifier)
           
 void setTimeout(int timeoutSeconds)
           
 void terminate()
           
 void truncatePageCache(AWPageCacheMark pageCacheMark)
           
 void truncatePageCache(AWPageCacheMark pageCacheMark, boolean inclusive)
           
 boolean unregisterActiveSession()
          UnRegisters the session with monitor stats object.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
           
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
           
 
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject
debugString, ensureFieldValuesClear, getFieldValue, init, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ResourceManagerKey

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

NewRequest

public static final int NewRequest
See Also:
Constant Field Values

BacktrackRequest

public static final int BacktrackRequest
See Also:
Constant Field Values

ForwardTrackRequest

public static final int ForwardTrackRequest
See Also:
Constant Field Values

RefreshRequest

public static final int RefreshRequest
See Also:
Constant Field Values

InterruptedNewRequest

public static final int InterruptedNewRequest
See Also:
Constant Field Values

NoOpRequest

public static final int NoOpRequest
See Also:
Constant Field Values

_refreshURL

public java.lang.String _refreshURL

_backTrackURL

public java.lang.String _backTrackURL

_forwardTrackURL

public java.lang.String _forwardTrackURL
Constructor Detail

AWSession

public AWSession()
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface AWDisposable

setSession

public static void setSession(javax.servlet.http.HttpSession httpSession,
                              AWSession awsession)

session

public static AWSession session(javax.servlet.http.HttpSession httpSession)

initializeThreadState

public static void initializeThreadState()
For AW processing by long running threads that do not execute the usual UI request / response code path. Performs any initialization required on the AW thread state.


cleanupThreadState

public static void cleanupThreadState()
For AW processing by long running threads that do not execute the usual UI request / response code path. For instance, the use of AW by worker threads to generate email. Performs any cleanup of the AW thread state. Called after AW processing has completed.


registerActiveSession

public boolean registerActiveSession()
Registers the session with monitor stats object. The session registration is used with gracefull shutdown.


unregisterActiveSession

public boolean unregisterActiveSession()
UnRegisters the session with monitor stats object.


httpSession

public javax.servlet.http.HttpSession httpSession()

sessionId

public java.lang.String sessionId()

setSessionId

public void setSessionId(java.lang.String newSessionId)
The AWSession id should have been assigned during initialization. For cases where a new httpSession Id is created for the same httpSession, we want to be able to sync that new id for AWSession. Currently this httpSessionId reset is only supported in WO Framework.


sessionSecureId

public java.lang.String sessionSecureId()

init

public void init(AWApplication application,
                 AWRequestContext requestContext)

dict

public java.util.Map dict()

application

public AWApplication application()

request

public AWRequest request()

requestContext

public AWRequestContext requestContext()

resourceManager

public AWResourceManager resourceManager()

setPreferredLocale

public void setPreferredLocale(java.util.Locale locale)

_forceLocale

public void _forceLocale(java.util.Locale locale)

preferredLocale

public java.util.Locale preferredLocale()

setCharacterEncoding

public void setCharacterEncoding(AWCharacterEncoding characterEncoding)

characterEncoding

public AWCharacterEncoding characterEncoding()

setClientTimeZone

public void setClientTimeZone(java.util.TimeZone timeZone)

clientTimeZone

public java.util.TimeZone clientTimeZone()

setAccessibilityEnabled

public void setAccessibilityEnabled(boolean flag)

isAccessibilityEnabled

public boolean isAccessibilityEnabled()

environmentStack

public AWEnvironmentStack environmentStack()

setRemoteHostAddress

public void setRemoteHostAddress(java.lang.String remoteHostAddress)

remoteHostAddress

public java.lang.String remoteHostAddress()

remoteIPAddress

public java.net.InetAddress remoteIPAddress()

setTimeout

public void setTimeout(int timeoutSeconds)

getTimeout

public final int getTimeout()
session timeout in seconds Note: this method can be called from an asynchronous non-UI thread


getLastAccessedTime

public long getLastAccessedTime()

setRequestInterval

public void setRequestInterval(int requestInterval)
Sets the expected amount of time between requests for this session in seconds.

Parameters:
requestInterval - the amount of time (seconds) between expected requests. Set to -1 if the amount of time between requests is unknown.

disconnectTime

public long disconnectTime()
Returns the time (in millis) at which point this session is considered to be disconnected. If -1 is returned, then there is no defined disconnectTime and the appserver session timeout should be used as the disconnect time. DisconnectPad is used to specify how long past the actual expected request interval is allowed before the session enters the pending disconnect state.

Returns:
the time (in millis) at which point this session is considered to be disconnected

debugDisconnectString

public java.lang.String debugDisconnectString()
Note: this method can be called from an asynchronous non-UI thread


isConnected

public boolean isConnected()

setConnected

public void setConnected(boolean flag)

setSessionIdentifier

public void setSessionIdentifier(java.lang.String sessionIdentifier)

sessionIdentifier

public java.lang.String sessionIdentifier()

requestType

public int requestType(AWRequest request)

savePage

public void savePage(AWPage page,
                     boolean isExceptionPage)

savePage

public void savePage(AWPage page)

restoreCurrentPage

public AWPage restoreCurrentPage()

restoreNextPage

public AWPage restoreNextPage(AWPage page)

restorePreviousPage

public AWPage restorePreviousPage(AWPage page)

previousPage

public AWPage previousPage(AWPage page)
Use this to get the previously cached page -- do not use session.previousPage() as that is only for refreshRegions support, especially since previousPage() has been removed.


clearPageCache

public void clearPageCache()

removePageCache

public void removePageCache(AWEncodedString frameName)

clearAllPageCaches

public void clearAllPageCaches()

_updatePageResourceManager

public void _updatePageResourceManager(AWResourceManager resourceManager)

removeFromPageCache

public void removeFromPageCache(AWPage page)

markPageCache

public AWPageCacheMark markPageCache()

truncatePageCache

public void truncatePageCache(AWPageCacheMark pageCacheMark,
                              boolean inclusive)

truncatePageCache

public void truncatePageCache(AWPageCacheMark pageCacheMark)

markAppBoundary

public void markAppBoundary()

setRefreshURL

public void setRefreshURL(java.lang.String url)

getRefreshURL

public java.lang.String getRefreshURL()

setBackTrackURL

public void setBackTrackURL(java.lang.String url)

getBackTrackURL

public java.lang.String getBackTrackURL()

setForwardTrackURL

public void setForwardTrackURL(java.lang.String url)

getForwardTrackURL

public java.lang.String getForwardTrackURL()

isTerminated

public boolean isTerminated()

terminate

public void terminate()

markForTermination

public void markForTermination()

isMarkedForTermination

public boolean isMarkedForTermination()

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

registerLifecycleListener

public static void registerLifecycleListener(AWSession.LifecycleListener listener)

lastRequestPerfStats

public PerformanceState.Stats lastRequestPerfStats()

dontReplaceLastPerformanceStats

public void dontReplaceLastPerformanceStats()
This call prevents that the last perf stats will be replaced by the current one in the sleep phase.


pageWithName

public AWComponent pageWithName(java.lang.String pageName)

historyPosition

public int historyPosition()

historyLength

public int historyLength()

brandName

public java.lang.String brandName()

setBrandName

public void setBrandName(java.lang.String brandName)

brandVersion

public java.lang.String brandVersion()

setBrandVersion

public void setBrandVersion(java.lang.String brandVersion)

isBrandTestMode

public boolean isBrandTestMode()

setBrandTestMode

public void setBrandTestMode(boolean flag)

hasChanged

public boolean hasChanged()

addNotification

public void addNotification(AWNotification notification)
We are assuming many writers, but only one reader


getNotifications

public java.util.List getNotifications()

hasNotification

public boolean hasNotification()
No need to synchronize, since this will become false only after the one reader consumes the list


hasShutdownWarning

public boolean hasShutdownWarning()

getShutdownWarning

public void getShutdownWarning()

setAllowParentFrame

public void setAllowParentFrame(boolean allowParentFrame)

allowParentFrame

public boolean allowParentFrame()

omitWrapperFrame

public boolean omitWrapperFrame()

setOmitWrapperFrame

public void setOmitWrapperFrame(boolean omit)
Parameters:
omit - when true, the wrapper frame is omitted on all pages rendered in this session. When false, the binding value on the page wrapper is used.


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