|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object context.arch.discoverer.DiscovererMediator
This mediator allows to handle the dialog between the discoverer and the DiscovererDataModel, the LeasesKeeper. It is able to store components into the database, to update and remove them. It handles queries and subscription queries. It asks the discoverer to check the components' liveliness
Field Summary | |
boolean |
useLogFile
Boolean to keep a logfile |
Constructor Summary | |
DiscovererMediator(Discoverer discoverer,
boolean keepLogFile)
Creates new DiscovererMediator |
Method Summary | |
Error |
add(ComponentDescription comp,
Lease lease)
This method allows to register a ComponentDescription object |
void |
addToLog(ComponentDescription comp)
Adds a component description to the log file |
boolean |
exists(java.lang.Object stringOrInteger)
Return true if the component is registered by the discoverer |
ComponentDescription |
getComponentDescription(java.lang.Object stringOrInteger)
Returns the ComponentDescription of a registered component |
void |
handleIndependentReply(IndependentCommunication independentCommunication)
Overrides the method that handle independent Reply. |
java.lang.Object |
rawSearch(AbstractQueryItem query)
Gets an AbstractQueryObject and returns a array with for each index of registered components a value yes/no to indicate if this component fits the query or not TO DO : complete the search to remove the widget included in server: USEFUL?? |
Error |
remove(java.lang.Object stringOrInteger)
Removes a component from the discoverer base |
void |
removeFromLog(ComponentDescription comp)
Adds the information that a component is removed from the database into the log file |
void |
removeFromLog(java.lang.String header,
ComponentDescription comp)
Adds the remove information into the log file |
DataObject |
search(AbstractQueryItem query)
Take a query and returns the corresponding components |
void |
sendLeaseEndNotificationTo(java.util.ArrayList listOfComponents)
This method allows to send a lease end notification to each component whose lease ends. |
java.lang.String |
toString()
Returns a printable version of this object: the database content, the leases. |
Error |
update(ComponentDescription component,
Lease lease)
Update the description of a component and its lease |
Error |
updateLease(java.lang.Object stringOrInteger,
Lease lease)
Update a registered component lease |
Error |
updateLease(java.lang.String compId,
Lease lease)
Updates a lease for a registered component |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean useLogFile
Constructor Detail |
public DiscovererMediator(Discoverer discoverer, boolean keepLogFile)
discoverer
- The discoverer objectMethod Detail |
public Error add(ComponentDescription comp, Lease lease)
comp
- the ComponentDescription objectlease
- The lease specified for this ComponentDescripion object
public Error updateLease(java.lang.String compId, Lease lease)
compId
- The id of the componentlease
- The new Lease object
public DataObject search(AbstractQueryItem query)
query
- The abstractquery object
public java.lang.Object rawSearch(AbstractQueryItem query)
query
- The abstract query object
public java.lang.String toString()
public Error remove(java.lang.Object stringOrInteger)
stringOrInteger
- The component's index or id
public Error update(ComponentDescription component, Lease lease)
component
- The component to updatelease
- The new Lease
public Error updateLease(java.lang.Object stringOrInteger, Lease lease)
stringOrInteger
- The component id or indexlease
- The new lease
public ComponentDescription getComponentDescription(java.lang.Object stringOrInteger)
public void sendLeaseEndNotificationTo(java.util.ArrayList listOfComponents)
public boolean exists(java.lang.Object stringOrInteger)
stringOrInteger
- The component index or id
public void addToLog(ComponentDescription comp)
comp
- The component descriptionpublic void removeFromLog(ComponentDescription comp)
comp
- The component description to removepublic void removeFromLog(java.lang.String header, ComponentDescription comp)
header
- The header informationcomp
- The component description removedpublic void handleIndependentReply(IndependentCommunication independentCommunication)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |