com.jfw.status.struts2
Class AdministrationAction

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by com.jfw.web.struts2.JFWAction
          extended by com.jfw.status.struts2.AdministrationAction
All Implemented Interfaces:
JFWCommonAction, com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.ModelDriven, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, java.io.Serializable, org.apache.struts2.interceptor.ServletRequestAware, org.apache.struts2.interceptor.ServletResponseAware
Direct Known Subclasses:
ExecuteSQLCommandAction, GetLogLevelAction, LogViewerDispatcherAction, MenuAction, ProbeMonitorAction, SetLogLevelAction, ShowConnectionPoolsAction, ShowDBMetadataAction, ShowDirAction, ShowFileAction, ShowLogAction, ShowSchedulerAction, UpdateAction, UpdateListAction

public abstract class AdministrationAction
extends JFWAction

The main action class for package com.jfw.status.struts2. All the other action classes of the package extends this one.
The subclasses must implement the method myStatusExecute(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.HashMap).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jfw.web.struts2.JFWAction
className, LOCALE_KEY, LOCALE_STRUTS2_SESSION_KEY
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.jfw.web.JFWCommonAction
AUTH_MSG_KEY, AUTH_USER_NOT_IN_DB, ERROR_KEY, excludeParams, LOCALE_LANGUAGE_KEY, logger, OPERATION_RESULT_KEY, OPERATION_RESULT_KO_KEY, OPERATION_RESULT_OK_KEY, OPERATION_TYPE_ADD_KEY, OPERATION_TYPE_DELETE_KEY, OPERATION_TYPE_KEY, OPERATION_TYPE_UPDATE_KEY, OUTPUT_DATA_KEY, properties, REQUEST_KEY, RESPONSE_KEY, SERVICE_NAME_KEY, USER_DATA_IN_REQUEST_KEY, USER_PROFILE_IN_REQUEST_KEY
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
AdministrationAction()
           
 
Method Summary
protected  java.lang.String afterMyExecute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.HashMap outputData)
          Set actions suffix.
protected  boolean isAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.HashMap outputData)
          Return always true.
protected  int isAuthorized(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, UserData userData)
          Return always AUTHORIZE_ALL.
 java.lang.String myExecute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.HashMap outputData)
          Check the login credentials for the adminstration console.
abstract  java.lang.String myStatusExecute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.HashMap outputData)
          Must be implement by subclasses.
 
Methods inherited from class com.jfw.web.struts2.JFWAction
beforeMyExecute, execute, getLocale, getLocaleLanguage, getModel, getServletRequest, getServletResponse, getUser, initLocale, isSimulateAuthentication, isSimulateAuthorization, security, setLocale, setLocale, setServletRequest, setServletResponse, setUserDataInOutputData
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, input, pause, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdministrationAction

public AdministrationAction()
Method Detail

myExecute

public final java.lang.String myExecute(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        java.util.HashMap outputData)
                                 throws java.lang.Exception
Check the login credentials for the adminstration console. If the authentication failure the authentication page of the administration console will be showed.

Specified by:
myExecute in class JFWAction
Parameters:
request - an HttpServletRequest object.
response - an HttpServletResponse object.
outputData - the HashMap container of data to view in jsp. To show the values added in this object a code like this can be used:
<bean:write name="OUTPUT_DATA_KEY" property="my_key" scope="request"/>
Returns:
a String with the name of the forward page.
Throws:
java.lang.Exception

isAuthenticated

protected boolean isAuthenticated(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  java.util.HashMap outputData)
Return always true. The authentication is done by class StatusAuthentication, called in method myExecute(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.HashMap).

Specified by:
isAuthenticated in class JFWAction
Parameters:
request - an HttpServletRequest object.
response - an HttpServletResponse object.
outputData - the HashMap container of data to view in jsp.
Returns:
always true.

isAuthorized

protected int isAuthorized(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           UserData userData)
Return always AUTHORIZE_ALL. No authorization check is done for the administration console actions.

Specified by:
isAuthorized in class JFWAction
Parameters:
request - an HttpServletRequest object.
response - an HttpServletResponse object.
userData - a UserData object.
Returns:
always AUTHORIZE_ALL

afterMyExecute

protected java.lang.String afterMyExecute(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          java.util.HashMap outputData)
                                   throws java.lang.Exception
Set actions suffix. Set key action_suffix in outputData with value .action.

Overrides:
afterMyExecute in class JFWAction
Parameters:
request - an HttpServletRequest object.
response - an HttpServletResponse object.
outputData - the HashMap container of data to view in jsp.
Returns:
a String with the name of the forward page. If an object different from null is returned then this forward will be used.
Throws:
java.lang.Exception

myStatusExecute

public abstract java.lang.String myStatusExecute(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 java.util.HashMap outputData)
                                          throws java.lang.Exception
Must be implement by subclasses.

Throws:
java.lang.Exception