com.jfw.status.struts
Class AdministrationAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.jfw.web.struts.JFWAction
          extended by com.jfw.status.struts.AdministrationAction
All Implemented Interfaces:
JFWCommonAction, java.util.Observer
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.struts. All the other action classes of the package extends this one.
The subclasses must implement the method myStatusExecute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, java.util.HashMap).


Field Summary
 
Fields inherited from class com.jfw.web.struts.JFWAction
className, LOCALE_KEY
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
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
 
Constructor Summary
AdministrationAction()
           
 
Method Summary
protected  org.apache.struts.action.ActionForward afterMyExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMessages messages, 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.
 org.apache.struts.action.ActionForward myExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMessages messages, java.util.HashMap outputData)
          Check the login credentials for the adminstration console.
abstract  org.apache.struts.action.ActionForward myStatusExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMessages messages, java.util.HashMap outputData)
          Must be implement by subclasses.
 
Methods inherited from class com.jfw.web.struts.JFWAction
beforeMyExecute, execute, getLocale, getLocaleLanguage, getUser, initLocale, isSimulateAuthentication, isSimulateAuthorization, myInit, security, setLocale, setLocale, setUserDataInOutputData, update
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdministrationAction

public AdministrationAction()
Method Detail

myExecute

public final org.apache.struts.action.ActionForward myExecute(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response,
                                                              org.apache.struts.action.ActionMessages messages,
                                                              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:
mapping - an ActionMapping object.
form - an ActionForm object.
request - an HttpServletRequest object.
response - an HttpServletResponse object.
messages - an ActionMessages 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:
an ActionForward object.
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(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, 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 org.apache.struts.action.ActionForward afterMyExecute(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                org.apache.struts.action.ActionMessages messages,
                                                                java.util.HashMap outputData)
                                                         throws java.lang.Exception
Set actions suffix. Set key action_suffix in outputData with value .do.

Overrides:
afterMyExecute in class JFWAction
Parameters:
mapping - an ActionMapping object.
form - an ActionForm object.
request - an HttpServletRequest object.
response - an HttpServletResponse object.
messages - an ActionMessages object.
outputData - the HashMap container of data to view in jsp.
Returns:
an ActionForward object. If an object different from null is returned then this forward will be used.
Throws:
java.lang.Exception

myStatusExecute

public abstract org.apache.struts.action.ActionForward myStatusExecute(org.apache.struts.action.ActionMapping mapping,
                                                                       org.apache.struts.action.ActionForm form,
                                                                       javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response,
                                                                       org.apache.struts.action.ActionMessages messages,
                                                                       java.util.HashMap outputData)
                                                                throws java.lang.Exception
Must be implement by subclasses.

Throws:
java.lang.Exception