Version: 1.1.1

org.inb.biomoby.central.model
Class ServicesModel

java.lang.Object
  extended by org.inb.biomoby.central.model.AbstractModel<Service>
      extended by org.inb.biomoby.central.model.ServicesModel
All Implemented Interfaces:
Runnable, ModelListener<MobyCentral>

public class ServicesModel
extends AbstractModel<Service>
implements ModelListener<MobyCentral>, Runnable

BioMoby services model implementation class. The class provides "readonly" functionality providing at the same time a local cache support. The cache is automatically updated.

Author:
Dmitry Repchevsky

Method Summary
 boolean addElement(Service element)
          Method to register a service with a BioMoby Registry.
 List<Service> getElements()
          Method to get all services from the model
static ServicesModel instance()
           
 void modelCleared()
           
 void modelObjectChanged(MobyCentral mobyCentral1, MobyCentral mobyCentral2)
           
 void modelObjectInserted(MobyCentral mobyCentral)
           
 void modelObjectRemoved(MobyCentral mobyCentral)
           
 void reload()
          Method to reload the model from a BioMoby Registry (also updating a cache)
 boolean removeElement(Service element)
          Method to unregister a service from a BioMoby Registry.
 void run()
           
 void setCentral(MobyCentral central)
          Even the method declared public it is recommended to set BioMoby Registry globaly through a MobyCentralModel.
 boolean updateElement(Service element1, Service element2)
          A method that updates a service description referred by element1 with data provided by element2.
 
Methods inherited from class org.inb.biomoby.central.model.AbstractModel
addListener, getElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCentral

public void setCentral(MobyCentral central)
Even the method declared public it is recommended to set BioMoby Registry globaly through a MobyCentralModel.

Parameters:
central - - BioMoby Registry to get the services from

reload

public void reload()
Method to reload the model from a BioMoby Registry (also updating a cache)


getElements

public List<Service> getElements()
Method to get all services from the model

Specified by:
getElements in class AbstractModel<Service>
Returns:
- a list of BioMoby services

addElement

public boolean addElement(Service element)
Method to register a service with a BioMoby Registry. Method not implemented and throws an exeption

Specified by:
addElement in class AbstractModel<Service>
Parameters:
element - - a new service to be registered with BioMoby Registry
Returns:
- true if operation succeed

removeElement

public boolean removeElement(Service element)
Method to unregister a service from a BioMoby Registry. Method not implemented and throws an exeption.

Specified by:
removeElement in class AbstractModel<Service>
Parameters:
element - - service to be unregistered
Returns:
- true if operation succeed

updateElement

public boolean updateElement(Service element1,
                             Service element2)
A method that updates a service description referred by element1 with data provided by element2. Method is not implemented.

Specified by:
updateElement in class AbstractModel<Service>
Parameters:
element1 - - a service in the model to be updated
element2 - - a service that used as a data source for the updated object
Returns:
- true if operation succeed

modelCleared

public void modelCleared()
Specified by:
modelCleared in interface ModelListener<MobyCentral>

modelObjectInserted

public void modelObjectInserted(MobyCentral mobyCentral)
Specified by:
modelObjectInserted in interface ModelListener<MobyCentral>

modelObjectRemoved

public void modelObjectRemoved(MobyCentral mobyCentral)
Specified by:
modelObjectRemoved in interface ModelListener<MobyCentral>

modelObjectChanged

public void modelObjectChanged(MobyCentral mobyCentral1,
                               MobyCentral mobyCentral2)
Specified by:
modelObjectChanged in interface ModelListener<MobyCentral>

run

public void run()
Specified by:
run in interface Runnable

instance

public static ServicesModel instance()

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010