org.gridbus.broker.persistence
Interface Writer

All Known Implementing Classes:
DBWriter

public interface Writer

Author:
krishna The Writer class provides the skeleton methods for enabling broker persistence. It does not specify where the actual storage is, and how the save operations are implemented. It is upto the sub-classes to do that job. A default sub-class, is provided with the broker: the DBWriter.

Method Summary
 boolean connect()
           
 boolean disconnect()
           
 void save(GridbusFarmingEngine gfe)
          Saves the entire broker state to persistent storage.
 void saveBrokerInstance(GridbusFarmingEngine gfe)
          Saves the global broker properties and broker instance state to persistent storage.
 void saveDataFile(DataFile df, java.lang.Object brokerID)
          Saves a datafile to persistent storage.
 void saveDataFiles(java.util.Collection df, java.lang.Object brokerID)
          Saves a collection of datafile to persistent storage.
 void saveDataHost(DataHost dh, java.lang.Object brokerID)
          Saves a datahost to persistent storage
 void saveDataHosts(java.util.Collection dh, java.lang.Object brokerID)
          Saves a collection of datahosts to persistent storage
 void saveEvent(GridbusFarmingEngine gfe, java.lang.Object event, java.lang.Object source, java.lang.Object brokerID)
          Saves the
 void saveJob(Job j, java.lang.Object brokerID)
          Saves a job to persistent storage
 void saveJobs(java.util.Collection j, java.lang.Object brokerID)
          Saves a collection of jobs to persistent storage
 void saveServer(ComputeServer cs, java.lang.Object brokerID)
          Saves a compute server to persistent storage
 void saveServers(java.util.Collection cs, java.lang.Object brokerID)
          Saves a collection of computeServers to persistent storage
 

Method Detail

saveDataHost

void saveDataHost(DataHost dh,
                  java.lang.Object brokerID)
                  throws java.lang.Exception
Saves a datahost to persistent storage

Parameters:
dh -
brokerID -
Throws:
java.lang.Exception

saveDataHosts

void saveDataHosts(java.util.Collection dh,
                   java.lang.Object brokerID)
                   throws java.lang.Exception
Saves a collection of datahosts to persistent storage

Parameters:
dh -
brokerID -
Throws:
java.lang.Exception

saveDataFile

void saveDataFile(DataFile df,
                  java.lang.Object brokerID)
                  throws java.lang.Exception
Saves a datafile to persistent storage.

Parameters:
df -
brokerID -
Throws:
java.lang.Exception

saveDataFiles

void saveDataFiles(java.util.Collection df,
                   java.lang.Object brokerID)
                   throws java.lang.Exception
Saves a collection of datafile to persistent storage.

Parameters:
df -
brokerID -
Throws:
java.lang.Exception

saveJob

void saveJob(Job j,
             java.lang.Object brokerID)
             throws java.lang.Exception
Saves a job to persistent storage

Parameters:
j -
brokerID -
Throws:
java.lang.Exception

saveJobs

void saveJobs(java.util.Collection j,
              java.lang.Object brokerID)
              throws java.lang.Exception
Saves a collection of jobs to persistent storage

Parameters:
j -
brokerID -
Throws:
java.lang.Exception

saveServer

void saveServer(ComputeServer cs,
                java.lang.Object brokerID)
                throws java.lang.Exception
Saves a compute server to persistent storage

Parameters:
cs -
brokerID -
Throws:
java.lang.Exception

saveServers

void saveServers(java.util.Collection cs,
                 java.lang.Object brokerID)
                 throws java.lang.Exception
Saves a collection of computeServers to persistent storage

Parameters:
cs -
brokerID -
Throws:
java.lang.Exception

saveBrokerInstance

void saveBrokerInstance(GridbusFarmingEngine gfe)
                        throws java.lang.Exception
Saves the global broker properties and broker instance state to persistent storage. This method just saves the broker instance itself, and not the objects contained in / linked with the broker. For saving the entire state, use the save(State) method.

Parameters:
gfe -
Throws:
java.lang.Exception

saveEvent

void saveEvent(GridbusFarmingEngine gfe,
               java.lang.Object event,
               java.lang.Object source,
               java.lang.Object brokerID)
               throws java.lang.Exception
Saves the

Parameters:
gfe -
event -
source -
brokerID -
Throws:
java.lang.Exception

save

void save(GridbusFarmingEngine gfe)
          throws java.lang.Exception
Saves the entire broker state to persistent storage. All the save methods assume there is an open connecction to persistent storage, whether it is a database, or the file system or a network socket etc..

Parameters:
gfe -
Throws:
java.lang.Exception

connect

boolean connect()
                throws java.lang.Exception
Returns:
true if the connection was successful
Throws:
java.lang.Exception

disconnect

boolean disconnect()
                   throws java.lang.Exception
Returns:
true if the connection was successful
Throws:
java.lang.Exception