org.apache.beehive.netui.pageflow
Class FlowControllerFactory

Object
  extended by FlowControllerFactory

public class FlowControllerFactory
extends Object

Factory for creating FlowControllers - user PageFlowControllers and Global.app.


Constructor Summary
FlowControllerFactory()
           
 
Method Summary
static GlobalApp getGlobalApp(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Get or create the current user session's GlobalApp instance (from the Global.app file).
static PageFlowController getPageFlow(Class jpfClass, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Get the PageFlowController for the given type.
static PageFlowController getPageFlow(String jpfClassName, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Get the PageFlowController for the given type.
static PageFlowController getPageFlowForRelativeURI(HttpServletRequest request, HttpServletResponse response, String relativeURI, ServletContext servletContext)
          Get the PageFlowController instance that should be associated with the given URI.
static PageFlowController getPageFlowForRequest(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Get the PageFlowController instance that should be associated with the given request, based on the path of the request URI.
static PageFlowController getPageFlowForURI(HttpServletRequest request, HttpServletResponse response, String uri, ServletContext servletContext)
           
static SharedFlowController getSharedFlow(Class sfClass, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
static SharedFlowController getSharedFlow(String sharedFlowClassName, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
static SharedFlowController getSharedFlowForRelativeURI(HttpServletRequest request, HttpServletResponse response, String relativeURI, ServletContext servletContext)
           
static SharedFlowController getSharedFlowForRequest(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowControllerFactory

public FlowControllerFactory()
Method Detail

getPageFlowForRequest

public static PageFlowController getPageFlowForRequest(HttpServletRequest request,
                                                       HttpServletResponse response,
                                                       ServletContext servletContext)
Get the PageFlowController instance that should be associated with the given request, based on the path of the request URI. If it doesn't exist, create it. The PageFlowController stack (for nesting) will be cleared or pushed, and the new instance will be stored as the current PageFlowController.

Parameters:
request - the current HttpServletRequest.
servletContext - the current ServletContext.
Returns:
the PageFlowController for the request, or null if none was found and none could be created.

getPageFlowForURI

public static PageFlowController getPageFlowForURI(HttpServletRequest request,
                                                   HttpServletResponse response,
                                                   String uri,
                                                   ServletContext servletContext)

getPageFlowForRelativeURI

public static PageFlowController getPageFlowForRelativeURI(HttpServletRequest request,
                                                           HttpServletResponse response,
                                                           String relativeURI,
                                                           ServletContext servletContext)
Get the PageFlowController instance that should be associated with the given URI. If it doesn't exist, create it. The PageFlowController stack (for nesting) will be cleared or pushed, and the new instance will be stored as the current PageFlowController.

Parameters:
request - the current HttpServletRequest.
response - the current HttpServletResponse.
relativeURI - the webapp-relative URI for the page flow.
servletContext - the current ServletContext.
Returns:
the PageFlowController for the request, or null if none was found and none could be created.

getSharedFlowForRequest

public static SharedFlowController getSharedFlowForRequest(HttpServletRequest request,
                                                           HttpServletResponse response,
                                                           ServletContext servletContext)

getSharedFlowForRelativeURI

public static SharedFlowController getSharedFlowForRelativeURI(HttpServletRequest request,
                                                               HttpServletResponse response,
                                                               String relativeURI,
                                                               ServletContext servletContext)

getPageFlow

public static PageFlowController getPageFlow(String jpfClassName,
                                             HttpServletRequest request,
                                             HttpServletResponse response,
                                             ServletContext servletContext)
Get the PageFlowController for the given type. The PageFlowController stack (for nesting) will be cleared or pushed, and the new instance will be stored as the current PageFlowController.

Parameters:
jpfClassName - the name of the desired PageFlowController class.
request - the current HttpServletRequest.
Returns:
the current user session's PageFlowController if it is of the requested type, or a newly-created one, or null if none could be found or created.

getGlobalApp

public static GlobalApp getGlobalApp(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ServletContext servletContext)
Get or create the current user session's GlobalApp instance (from the Global.app file).

Parameters:
request - the current HttpServletRequest.
Returns:
the current session's GlobalApp instance, or a new one (based on Global.app) if none is found. If Global.app does not exist in the current webapp, null is returned.

getSharedFlow

public static SharedFlowController getSharedFlow(String sharedFlowClassName,
                                                 HttpServletRequest request,
                                                 HttpServletResponse response,
                                                 ServletContext servletContext)

getPageFlow

public static PageFlowController getPageFlow(Class jpfClass,
                                             HttpServletRequest request,
                                             HttpServletResponse response,
                                             ServletContext servletContext)
Get the PageFlowController for the given type. The PageFlowController stack (for nesting) will be cleared or pushed, and the new instance will be stored as the current PageFlowController.

Parameters:
jpfClass - the desired PageFlowController class.
request - the current HttpServletRequest.
Returns:
the current user session's PageFlowController if it is of the requested type, or a newly-created one, or null if none could be found or created.

getSharedFlow

public static SharedFlowController getSharedFlow(Class sfClass,
                                                 HttpServletRequest request,
                                                 HttpServletResponse response,
                                                 ServletContext servletContext)