|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.agmodel.utilBean.RequestBean
An invisible generic bean to handle the process of getting data from a broker.
Prompts the user to log in to datasources if necessary.
As getting data may be time-consuming, the broker is called in a separate thread.
Sends out IndeterminateEvents to registered listeners at the beginning and end of the process.
The results of the call are sent to registered listeners (this part handled by descendant classes).
| Field Summary | |
protected GenericBrokerHTTP |
brokerHTTP
|
protected GenericBrokerRMI |
brokerRMI
|
protected ArrayList |
dataListeners
|
protected ArrayList |
indeterminateListeners
|
protected LogInDialog |
loginDialog
|
protected Frame |
parent
|
protected static ResourceBundle |
rb
|
protected Thread |
retrieveDataThread
|
protected String |
sessionID
|
protected static ResourceBundle |
ub
|
| Constructor Summary | |
RequestBean(Frame dialogParent)
Creates a new RequestBean. |
|
| Method Summary | |
void |
addDataListener(RequestBeanListener x)
|
void |
addIndeterminateListener(IndeterminateListener x)
|
protected boolean |
alreadyLoggedIn(String sessionID,
String candidateDBID)
|
protected void |
clearListeners()
|
protected void |
fireDataArrivedEvent(ServerResult result)
|
protected void |
fireDataRequestedEvent()
|
protected void |
fireIndeterminateEvent(IndeterminateEvent evt)
Notifies listeners that a task of unknown duration has started and enables or disables the button as appropriate |
protected abstract void |
fireSpecificEvent(RequestBeanListener listener,
ServerResult result)
|
protected abstract ServerResult |
getData(ServerRequest request)
Implemented by descendant requestBeans to call the broker to get the data. |
protected DataSourceDetail[] |
listSourceDetails(String sessionID,
GeographicalArea box)
|
protected boolean |
login(DataSourceDetail sourceDetail)
Prompt the user to log in to a database if necessary. |
protected boolean |
login(GeographicalArea area)
Prompt the user to log in to any or all of the databases in the region |
protected boolean |
loginToDataSource(String sessionID,
String databaseID,
String username,
String password)
|
protected abstract ServerRequest |
makeRequest()
Implemented by descendant requestBeans to create an appropriate request object for this kind of broker. |
protected boolean |
readyToRequest()
|
void |
removeDataListener(RequestBeanListener x)
|
void |
removeIndeterminateListener(IndeterminateListener x)
|
void |
run()
This method is public, but should not be called directly. |
protected void |
runRetrieveThread()
|
protected void |
setUpBean()
|
protected abstract boolean |
suitableLogin(ServerRequest request)
Implemented by descendant requestBeans to select which login mechanism to use. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static ResourceBundle rb
protected static ResourceBundle ub
protected transient volatile GenericBrokerRMI brokerRMI
protected transient volatile GenericBrokerHTTP brokerHTTP
protected transient volatile String sessionID
protected transient volatile Thread retrieveDataThread
protected transient ArrayList indeterminateListeners
protected transient ArrayList dataListeners
protected transient LogInDialog loginDialog
protected Frame parent
| Constructor Detail |
public RequestBean(Frame dialogParent)
dialogParent - a frame to own the login dialogs (use JOptionPane.getFrameForComponent() within applets)| Method Detail |
protected void setUpBean()
protected void clearListeners()
protected void runRetrieveThread()
protected void fireIndeterminateEvent(IndeterminateEvent evt)
public void addIndeterminateListener(IndeterminateListener x)
public void removeIndeterminateListener(IndeterminateListener x)
protected void fireDataRequestedEvent()
protected void fireDataArrivedEvent(ServerResult result)
protected abstract void fireSpecificEvent(RequestBeanListener listener,
ServerResult result)
public void addDataListener(RequestBeanListener x)
public void removeDataListener(RequestBeanListener x)
protected boolean readyToRequest()
protected boolean loginToDataSource(String sessionID,
String databaseID,
String username,
String password)
throws RemoteException,
GeneralException
RemoteException
GeneralException
protected boolean alreadyLoggedIn(String sessionID,
String candidateDBID)
throws RemoteException,
GeneralException
RemoteException
GeneralException
protected DataSourceDetail[] listSourceDetails(String sessionID,
GeographicalArea box)
throws RemoteException,
GeneralException
RemoteException
GeneralException
protected boolean login(DataSourceDetail sourceDetail)
throws RemoteException,
GeneralException
sourceDetail -
RemoteException
GeneralException
protected boolean login(GeographicalArea area)
throws RemoteException,
GeneralException
area - the area of interest
RemoteException
GeneralExceptionprotected abstract ServerRequest makeRequest()
protected abstract ServerResult getData(ServerRequest request)
throws RemoteException,
GeneralException
RemoteException
GeneralException
protected abstract boolean suitableLogin(ServerRequest request)
throws RemoteException,
GeneralException
RemoteException
GeneralExceptionpublic void run()
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||