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(State s)
          Saves the entire broker state to persistent storage.
 void saveBrokerInstance(State s)
          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(State s, 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
 void saveTask(Task t, java.lang.Object brokerID)
          Saves a task to persistent storage
 void saveVariable(Variable v, java.lang.Object brokerID)
          Saves a variable to persistent storage
 void saveVariables(java.util.Collection v, java.lang.Object brokerID)
          Saves a collection of variables to persistent storage
 

Method Detail

saveDataHost

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

saveTask

public void saveTask(Task t,
                     java.lang.Object brokerID)
              throws java.lang.Exception
Saves a task to persistent storage

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

saveVariable

public void saveVariable(Variable v,
                         java.lang.Object brokerID)
                  throws java.lang.Exception
Saves a variable to persistent storage

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

saveVariables

public void saveVariables(java.util.Collection v,
                          java.lang.Object brokerID)
                   throws java.lang.Exception
Saves a collection of variables to persistent storage

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

saveBrokerInstance

public void saveBrokerInstance(State s)
                        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:
s -
Throws:
java.lang.Exception

saveEvent

public void saveEvent(State s,
                      java.lang.Object event,
                      java.lang.Object source,
                      java.lang.Object brokerID)
               throws java.lang.Exception
Saves the

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

save

public void save(State s)
          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:
s -
Throws:
java.lang.Exception

connect

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

disconnect

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