com.scooterframework.web.controller
Class AppActionContext

java.lang.Object
  extended by com.scooterframework.web.controller.ActionContext
      extended by com.scooterframework.web.controller.AppActionContext

public class AppActionContext
extends ActionContext

AppActionContext class holds context data for current non-web request. In the non-web environment, the context data is the global data.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> sessionData
          Session data map.
 
Fields inherited from class com.scooterframework.web.controller.ActionContext
errors, KEY_FLASH_MESSAGE, SCOPE_CONTEXT, SCOPE_GLOBAL, SCOPE_PARAMETER, SCOPE_REQUEST, SCOPE_SESSION, SCOPE_THREAD
 
Constructor Summary
AppActionContext()
           
 
Method Summary
protected  void clearCachedRequestData()
          Cleans up all local cached data to prepare for the next request.
 void endSession()
          Ends session.
 java.util.Map<java.lang.String,java.lang.Object> getContextDataAsMap()
          Gets data in context scope as a map.
protected  java.lang.Object getCycleFromCycleMap(java.lang.String name)
          Returns a named cycle from cycle map.
 java.lang.Object getFromContextData(java.lang.String key)
          Gets data represented by the key from the context scope.
 java.lang.Object getFromParameterData(java.lang.String key)
          Gets data represented by the key from the parameter scope.
 java.lang.Object getFromRequestData(java.lang.String key)
          Gets data represented by the key from the request scope.
 java.lang.Object getFromSessionData(java.lang.String key)
          Gets data represented by the key from the session scope.
 java.util.Map<java.lang.String,java.lang.Object> getParameterDataAsMap()
          Gets data in parameter scope as a map.
 java.util.Map<java.lang.String,java.lang.Object> getRequestDataAsMap()
          Gets data in request scope as a map.
 java.util.Map<java.lang.String,java.lang.Object> getSessionDataAsMap()
          Gets data in session scope as a map.
 void remove(java.lang.String key)
          Removes data represented by the key from all scopes.
 void removeAllSessionData()
          Removes all data represented by the key from session scope.
 void removeFromContextData(java.lang.String key)
          Removes data represented by the key from context scope.
 void removeFromParameterData(java.lang.String key)
          Removes data represented by the key from parameter scope.
 void removeFromRequestData(java.lang.String key)
          Removes data represented by the key from request scope.
 void removeFromSessionData(java.lang.String key)
          Removes data represented by the key from session scope.
protected  void setCycleToCycleMap(java.lang.String name, java.lang.Object cycle)
          Sets a named cycle in cycle map.
 void setParameterData(java.util.Map<java.lang.String,java.lang.Object> data)
          Sets data in parameter scope.
 void setRequestData(java.util.Map<java.lang.String,java.lang.Object> data)
          Sets data in request scope.
 void setSessionData(java.util.Map<java.lang.String,java.lang.Object> data)
          Sets data in session scope.
 void startSession()
          Starts session.
 void storeToContext(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to context scope.
 void storeToParameter(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to parameter scope.
 void storeToRequest(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to request scope.
 void storeToSession(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to session scope.
 
Methods inherited from class com.scooterframework.web.controller.ActionContext
currentCycle, cycle, cycle, get, get, getAllFlashMessages, getAllRequestDataAsMap, getAllRequestDataAsMap, getError, getErrorAsMap, getFirstFlashMessage, getFromAllRequestData, getFromGlobalData, getFromParameterDataIgnoreCase, getFromThreadData, getGlobalDataAsMap, getGlobalLocale, getLatestFlashMessage, getLocale, getLocale, getParameterDataAsMap, getRequestDataAsMap, isRequiredField, removeFromGlobalData, removeFromThreadData, resetCycle, resetFlashMessage, retrievePrimaryKeyDataMapFromRequest, retrievePrimaryKeyDataMapFromRequest, setError, setErrors, setFlashMessage, setFlashMessage, setGlobalLocale, setLocale, setRequestLocale, setSessionLocale, storeToGlobal, storeToThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionData

protected java.util.Map<java.lang.String,java.lang.Object> sessionData
Session data map.

Constructor Detail

AppActionContext

public AppActionContext()
Method Detail

getParameterDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getParameterDataAsMap()
Gets data in parameter scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getParameterDataAsMap in class ActionContext
Returns:
Map

setParameterData

public void setParameterData(java.util.Map<java.lang.String,java.lang.Object> data)
Sets data in parameter scope.


getRequestDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getRequestDataAsMap()
Gets data in request scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getRequestDataAsMap in class ActionContext
Returns:
Map

setRequestData

public void setRequestData(java.util.Map<java.lang.String,java.lang.Object> data)
Sets data in request scope.


getSessionDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getSessionDataAsMap()
Gets data in session scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getSessionDataAsMap in class ActionContext
Returns:
Map

setSessionData

public void setSessionData(java.util.Map<java.lang.String,java.lang.Object> data)
Sets data in session scope.


getContextDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getContextDataAsMap()
Gets data in context scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getContextDataAsMap in class ActionContext
Returns:
Map

getFromParameterData

public java.lang.Object getFromParameterData(java.lang.String key)
Gets data represented by the key from the parameter scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromParameterData in class ActionContext
Parameters:
key -
Returns:
Object

getFromRequestData

public java.lang.Object getFromRequestData(java.lang.String key)
Gets data represented by the key from the request scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromRequestData in class ActionContext
Parameters:
key -
Returns:
Object

getFromSessionData

public java.lang.Object getFromSessionData(java.lang.String key)
Gets data represented by the key from the session scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromSessionData in class ActionContext
Parameters:
key -
Returns:
Object

getFromContextData

public java.lang.Object getFromContextData(java.lang.String key)
Gets data represented by the key from the context scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromContextData in class ActionContext
Parameters:
key -
Returns:
Object

remove

public void remove(java.lang.String key)
Removes data represented by the key from all scopes. Note: The result of this method is sensitive to the case of key string.

Overrides:
remove in class ActionContext
Parameters:
key -

removeFromParameterData

public void removeFromParameterData(java.lang.String key)
Removes data represented by the key from parameter scope. Note: The result of this method is sensitive to the case of key string.

Parameters:
key -

removeFromRequestData

public void removeFromRequestData(java.lang.String key)
Removes data represented by the key from request scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromRequestData in class ActionContext
Parameters:
key -

removeFromSessionData

public void removeFromSessionData(java.lang.String key)
Removes data represented by the key from session scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromSessionData in class ActionContext
Parameters:
key -

removeAllSessionData

public void removeAllSessionData()
Removes all data represented by the key from session scope.

Specified by:
removeAllSessionData in class ActionContext

removeFromContextData

public void removeFromContextData(java.lang.String key)
Removes data represented by the key from context scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromContextData in class ActionContext
Parameters:
key -

storeToParameter

public void storeToParameter(java.lang.String key,
                             java.lang.Object object)
Stores the object represented by the key to parameter scope.

Parameters:
key - String
object - Object

storeToRequest

public void storeToRequest(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to request scope.

Specified by:
storeToRequest in class ActionContext
Parameters:
key - String
object - Object

storeToSession

public void storeToSession(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to session scope.

Specified by:
storeToSession in class ActionContext
Parameters:
key - String
object - Object

storeToContext

public void storeToContext(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to context scope.

Specified by:
storeToContext in class ActionContext
Parameters:
key - String
object - Object

startSession

public void startSession()
Starts session.


endSession

public void endSession()
Ends session.


clearCachedRequestData

protected void clearCachedRequestData()
Cleans up all local cached data to prepare for the next request.


getCycleFromCycleMap

protected java.lang.Object getCycleFromCycleMap(java.lang.String name)
Returns a named cycle from cycle map.

Specified by:
getCycleFromCycleMap in class ActionContext
Parameters:
name -
Returns:
cycle object

setCycleToCycleMap

protected void setCycleToCycleMap(java.lang.String name,
                                  java.lang.Object cycle)
Sets a named cycle in cycle map.

Specified by:
setCycleToCycleMap in class ActionContext
Parameters:
name -
cycle -