apollo
Class PageBroker

java.lang.Object
  |
  +--apollo.PageBroker
All Implemented Interfaces:
PageHandler, java.io.Serializable

public abstract class PageBroker
extends java.lang.Object
implements java.io.Serializable, PageHandler

This is the PageBroker. When a PageBroker is given a request, it will determine if there is a registered handler for that UID. It will pass the request to the appropriatly registered handler for that UID. If the UID is blank, then the PageBroker must handle the request itself, since it is itself a PageHandler. Copyright Joe Kislo, All Rights Reserved.

See Also:
Serialized Form

Field Summary
protected  java.lang.String FQUID
           
protected  ManagerTracker MT
           
protected  PageBroker parentPageBroker
           
 
Constructor Summary
PageBroker(ManagerTracker MT, java.lang.String fquid, PageBroker PB)
          Creates a new PageBroker.
 
Method Summary
 java.lang.String getFQUID()
          Returns the FQUID of this PageBroker
 PageBroker getParentPageBroker()
          Returns the parent to this PageBroker
 HTTPResponse handleRequest(TransactionTracker TT, java.lang.String UID, HTTPRequest req, WebSession thisSession)
          Handles a request for UID.
 void registerPageHandler(java.lang.String UID, PageHandler PH)
          Registers a PageHandler with the UID it will respond to.
abstract  HTTPResponse render(TransactionTracker TT, HTTPRequest req, WebSession thisSession)
          If a request comes in on the handleRequest line, and it's destined to be by this broker, this is the method called.
 void unregisterPageHandler(java.lang.String UID)
          Unregisters a PageHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FQUID

protected java.lang.String FQUID

parentPageBroker

protected PageBroker parentPageBroker

MT

protected ManagerTracker MT
Constructor Detail

PageBroker

public PageBroker(ManagerTracker MT,
                  java.lang.String fquid,
                  PageBroker PB)
           throws TemplatePageException
Creates a new PageBroker.
Parameters:
fquid - The Fully Qualified Unique ID for this Broker
PB - The Parent PageBroker
Method Detail

getFQUID

public java.lang.String getFQUID()
Returns the FQUID of this PageBroker
Specified by:
getFQUID in interface PageHandler

registerPageHandler

public void registerPageHandler(java.lang.String UID,
                                PageHandler PH)
Registers a PageHandler with the UID it will respond to.
Parameters:
UID - The Unique ID the PageHandler will respond to
PH - The PageHandler to be registered

unregisterPageHandler

public void unregisterPageHandler(java.lang.String UID)
Unregisters a PageHandler.
Parameters:
UID - The Unique ID to be unregistered.

render

public abstract HTTPResponse render(TransactionTracker TT,
                                    HTTPRequest req,
                                    WebSession thisSession)
                             throws ApolloException
If a request comes in on the handleRequest line, and it's destined to be by this broker, this is the method called. Must be overridden. Not all brokers HAVE to be renderable, you can have all leaf nodes do that. However Brokers CAN serve as PageHandlers aswell.
Parameters:
req - The HTTPRequest

handleRequest

public HTTPResponse handleRequest(TransactionTracker TT,
                                  java.lang.String UID,
                                  HTTPRequest req,
                                  WebSession thisSession)
                           throws ApolloException
Handles a request for UID. Will return special output object soon. Deligates the request to subordinate Brokers/Handlers as it decodes the UID.
Specified by:
handleRequest in interface PageHandler
Parameters:
UID - The Unique ID for this request
req - The HTTPRequest
thisSession - The session object for this request (optional)

getParentPageBroker

public PageBroker getParentPageBroker()
Returns the parent to this PageBroker