org.figure8.join.control.action
Class ConsumerActions

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.figure8.join.control.JoinAction
          extended by org.figure8.join.control.action.ConsumerActions

public class ConsumerActions
extends JoinAction

This is a Struts action for managing the event consumers in Join application.

Version:
$Revision: 1.4 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String CONSUMER_KEY
          The session scope attribute under which the consumer object currently selected by our logged-in User is stored.
static java.lang.String CONSUMERS_KEY
          The session scope attribute under which the retrieved consumers list is stored.
static java.lang.String DETAILS_OP
          Operation code for getting details on a message consumer infos
static java.lang.String DUPLICATE_CONSUMER_KEY
          The request scope attribute under which is stored the Consumer that has raised a DuplicateEntityException during save of another one.
static java.lang.String LOAD_OP
          Operation code for loading a message consumer infos
protected  JMSConsumerBeanManager manager
          The local consumers manager to use if setup is simple
static java.lang.String SAVE_OP
          Operation code for saving a message consumer infos
static java.lang.String SAVE_PARAM_OP
          Operation code for saving a message consumer parameters infos
protected  MessagingService service
          The remote messaging service to use if setup is dissociated
 
Fields inherited from class org.figure8.join.control.JoinAction
BODY_ATTRIBUTE, BODY_PARAMETER, EXCEPTION_KEY, GUI_KEY, OP_PARAMETER, REND_MAIN, REND_NONE, REND_PARAMETER, REND_POPUP, XHR_PARAMETER
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ConsumerActions()
          Creates a new instance of ConsumerActions.
 
Method Summary
 org.apache.struts.action.ActionForward doExecute(java.lang.String operation, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Abstract method that subclasses must implement.
protected  org.apache.struts.action.ActionForward getConsumerDetails(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get all the details from registered consumer, including its parameters and execution log files
protected  void initializeManagerOrService()
          Initialize the local consumer manager or the remote service depending on the application setup and the application side we are on.
protected  org.apache.struts.action.ActionForward loadConsumer(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Load a specified consumer info from datastore and fill form with it.
protected  org.apache.struts.action.ActionForward saveConsumer(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Save a consumer into datastore.
protected  org.apache.struts.action.ActionForward saveConsumerParameters(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Save a consumer parameters into datastore.
protected  void updateConsumersInRequest(javax.servlet.http.HttpServletRequest request)
          Update the consumers definitions collection within request.
 
Methods inherited from class org.figure8.join.control.JoinAction
execute, getUserContainer, isLoggedIn, isXhrRequest, removeObsoleteForm
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, 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
 

Field Detail

LOAD_OP

public static final java.lang.String LOAD_OP
Operation code for loading a message consumer infos

See Also:
Constant Field Values

SAVE_OP

public static final java.lang.String SAVE_OP
Operation code for saving a message consumer infos

See Also:
Constant Field Values

SAVE_PARAM_OP

public static final java.lang.String SAVE_PARAM_OP
Operation code for saving a message consumer parameters infos

See Also:
Constant Field Values

DETAILS_OP

public static final java.lang.String DETAILS_OP
Operation code for getting details on a message consumer infos

See Also:
Constant Field Values

CONSUMER_KEY

public static final java.lang.String CONSUMER_KEY
The session scope attribute under which the consumer object currently selected by our logged-in User is stored.

See Also:
Constant Field Values

CONSUMERS_KEY

public static final java.lang.String CONSUMERS_KEY
The session scope attribute under which the retrieved consumers list is stored.

See Also:
Constant Field Values

DUPLICATE_CONSUMER_KEY

public static final java.lang.String DUPLICATE_CONSUMER_KEY
The request scope attribute under which is stored the Consumer that has raised a DuplicateEntityException during save of another one.

See Also:
Constant Field Values

service

protected MessagingService service
The remote messaging service to use if setup is dissociated


manager

protected JMSConsumerBeanManager manager
The local consumers manager to use if setup is simple

Constructor Detail

ConsumerActions

public ConsumerActions()
Creates a new instance of ConsumerActions.

Method Detail

doExecute

public org.apache.struts.action.ActionForward doExecute(java.lang.String operation,
                                                        org.apache.struts.action.ActionMapping mapping,
                                                        org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response)
                                                 throws java.lang.Exception
Description copied from class: JoinAction
Abstract method that subclasses must implement. The real execution must be done here according to the specified operation. ActionForward returned by execution should only point on page fragment : this superclass is responsible of including them within a whole page.

Specified by:
doExecute in class JoinAction
Parameters:
operation - String representing the operation to invoke on Action
mapping - Mapping between forwards name and path for this action
form - The form object containing request parameters
request - The servlet container request wrapper
response - The servlet container response wrapper
Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception - such as InfraStructureExceptions ...

loadConsumer

protected org.apache.struts.action.ActionForward loadConsumer(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws java.lang.Exception
Load a specified consumer info from datastore and fill form with it.

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

saveConsumer

protected org.apache.struts.action.ActionForward saveConsumer(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws java.lang.Exception
Save a consumer into datastore. The consumer may be an already existing one or a new one (this is indeed a create or update method).

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

saveConsumerParameters

protected org.apache.struts.action.ActionForward saveConsumerParameters(org.apache.struts.action.ActionMapping mapping,
                                                                        org.apache.struts.action.ActionForm form,
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        javax.servlet.http.HttpServletResponse response)
                                                                 throws java.lang.Exception
Save a consumer parameters into datastore. The consumer is an already existing one.

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

getConsumerDetails

protected org.apache.struts.action.ActionForward getConsumerDetails(org.apache.struts.action.ActionMapping mapping,
                                                                    org.apache.struts.action.ActionForm form,
                                                                    javax.servlet.http.HttpServletRequest request,
                                                                    javax.servlet.http.HttpServletResponse response)
                                                             throws java.lang.Exception
Get all the details from registered consumer, including its parameters and execution log files

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

updateConsumersInRequest

protected void updateConsumersInRequest(javax.servlet.http.HttpServletRequest request)
                                 throws java.lang.Exception
Update the consumers definitions collection within request.

Parameters:
request - The servlet container request wrapper
Throws:
java.lang.Exception - if consumers cannot be refreshed

initializeManagerOrService

protected void initializeManagerOrService()
                                   throws java.lang.Exception
Initialize the local consumer manager or the remote service depending on the application setup and the application side we are on.

Throws:
java.lang.Exception - if manager cannot be found or remote service is not available


Copyright © 2005-2008 Join. All Rights Reserved.