net.agmodel.chizuBean
Class ChizuRequestBean

java.lang.Object
  |
  +--net.agmodel.utilBean.RequestBean
        |
        +--net.agmodel.chizuBean.ChizuRequestBean
All Implemented Interfaces:
ChizuSourceListener, DataSourceListener, EventListener, MapDisplayListener, Runnable, ServiceBeanListener

public class ChizuRequestBean
extends RequestBean
implements MapDisplayListener, ChizuSourceListener, ServiceBeanListener


Field Summary
protected  ChizuSourceDetail currentSource
           
protected  int height
           
protected  String language
           
protected  ArrayList sourceListeners
           
protected  GeographicalArea targetRegion
           
protected  int width
           
 
Fields inherited from class net.agmodel.utilBean.RequestBean
brokerHTTP, brokerRMI, dataListeners, indeterminateListeners, loginDialog, parent, rb, retrieveDataThread, sessionID, ub
 
Constructor Summary
ChizuRequestBean(Frame parent)
           
 
Method Summary
 void addChizuListener(ChizuListener x)
           
 void addChizuSourceListener(ChizuSourceListener x)
           
protected  void clearListeners()
           
protected  void fireSpecificEvent(RequestBeanListener listener, ServerResult result)
           
protected  ServerResult getData(ServerRequest request)
          Implemented by descendant requestBeans to call the broker to get the data.
protected  ServerRequest makeRequest()
          Implemented by descendant requestBeans to create an appropriate request object for this kind of broker.
 void newChizuSource(ChizuSourceEvent evt)
          If a new source is selected, and the new source covers a different area to the request bean's current request area then tell GeographicalArea listeners to move to the default display area of the new source.
 void newConnection(ServiceBeanEvent evt)
          Called when a ServerBean establishes a connection to a server
 void newMapDisplay(MapDisplayEvent evt)
           
protected  boolean readyToRequest()
           
protected  void relayChizuSourceEvent(ChizuSourceEvent evt)
           
 void removeChizuListener(ChizuListener x)
           
 void removeChizuSourceListener(ChizuSourceListener x)
           
protected  void setUpBean()
           
protected  boolean suitableLogin(ServerRequest request)
          Implemented by descendant requestBeans to select which login mechanism to use.
 
Methods inherited from class net.agmodel.utilBean.RequestBean
addDataListener, addIndeterminateListener, alreadyLoggedIn, fireDataArrivedEvent, fireDataRequestedEvent, fireIndeterminateEvent, listSourceDetails, login, login, loginToDataSource, removeDataListener, removeIndeterminateListener, run, runRetrieveThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetRegion

protected transient GeographicalArea targetRegion

height

protected transient int height

width

protected transient int width

language

protected transient String language

sourceListeners

protected transient ArrayList sourceListeners

currentSource

protected transient ChizuSourceDetail currentSource
Constructor Detail

ChizuRequestBean

public ChizuRequestBean(Frame parent)
Method Detail

clearListeners

protected void clearListeners()
Overrides:
clearListeners in class RequestBean

setUpBean

protected void setUpBean()
Overrides:
setUpBean in class RequestBean

relayChizuSourceEvent

protected void relayChizuSourceEvent(ChizuSourceEvent evt)

addChizuSourceListener

public void addChizuSourceListener(ChizuSourceListener x)

removeChizuSourceListener

public void removeChizuSourceListener(ChizuSourceListener x)

newChizuSource

public void newChizuSource(ChizuSourceEvent evt)
If a new source is selected, and the new source covers a different area to the request bean's current request area then tell GeographicalArea listeners to move to the default display area of the new source. Otherwise, send a GeographicalAreaEvent for the current request area to signal listeners to reload from the new source.

Specified by:
newChizuSource in interface ChizuSourceListener
Parameters:
evt -

newConnection

public void newConnection(ServiceBeanEvent evt)
Description copied from interface: ServiceBeanListener
Called when a ServerBean establishes a connection to a server

Specified by:
newConnection in interface ServiceBeanListener
Parameters:
evt - contact details for the server.

newMapDisplay

public void newMapDisplay(MapDisplayEvent evt)
Specified by:
newMapDisplay in interface MapDisplayListener

readyToRequest

protected boolean readyToRequest()
Overrides:
readyToRequest in class RequestBean

makeRequest

protected ServerRequest makeRequest()
Description copied from class: RequestBean
Implemented by descendant requestBeans to create an appropriate request object for this kind of broker.

Specified by:
makeRequest in class RequestBean
Returns:
a request to be sent to the broker.

fireSpecificEvent

protected void fireSpecificEvent(RequestBeanListener listener,
                                 ServerResult result)
Specified by:
fireSpecificEvent in class RequestBean

addChizuListener

public void addChizuListener(ChizuListener x)

removeChizuListener

public void removeChizuListener(ChizuListener x)

suitableLogin

protected boolean suitableLogin(ServerRequest request)
                         throws RemoteException,
                                GeneralException
Description copied from class: RequestBean
Implemented by descendant requestBeans to select which login mechanism to use.
Should either called login(GeographicalArea) or login(String), depending on whether spatial request bean or data source request bean

Specified by:
suitableLogin in class RequestBean
Returns:
true if at least one database is accessible after the logging in process.
RemoteException
GeneralException

getData

protected ServerResult getData(ServerRequest request)
                        throws RemoteException,
                               GeneralException
Description copied from class: RequestBean
Implemented by descendant requestBeans to call the broker to get the data.
These beans can use brokerRMI if the connection is RMI, or brokerHTTP if the connection is via HTTP.

Specified by:
getData in class RequestBean
Returns:
a request to be sent to the broker.
RemoteException
GeneralException