org.gridbus.broker.common
Class GridbusFarmingEngine

java.lang.Object
  extended by org.gridbus.broker.common.GridbusFarmingEngine

public final class GridbusFarmingEngine
extends java.lang.Object

This class is a place holder for the broker objects and is the main interface to applications that talk to the Broker.


Constructor Summary
GridbusFarmingEngine()
          Initializes the broker using default properties, defined in the BrokerProperties class.
GridbusFarmingEngine(BrokerProperties config)
          Initialises the broker with the given BrokerProperties object
GridbusFarmingEngine(BrokerProperties props, java.lang.String applicationId)
          Initialises the broker with the given BrokerProperties object, Loads an application with the given id.
GridbusFarmingEngine(java.lang.String applicationID)
          Initializes the broker using default properties, defined in the BrokerProperties class.
 
Method Summary
 void addJob(Job job)
          Adds a job to the broker application
 void addSCSJob(org.gridbus.scs.common.SCSJob job)
           
 void addService(Service s)
           
 java.lang.String createApplication(ApplicationContext app)
          Save the application context to the broker storage
 ApplicationContext getApplication()
          Get the application context
 Job getJob(java.lang.String jobname)
           
 long getJobCount(int status, java.lang.String serverName)
           
 java.util.Collection getJobs()
          Gets all the jobs
 java.util.Collection getJobs(int status)
          Gets all the jobs with the given status
 JobStatistics getJobStatistics(java.lang.String name)
           
 Qos getQos()
           
 java.util.Collection getServers()
           
 java.util.Collection getServices(int serviceType)
           
 java.lang.String getSummaryStatistics()
          Returns a formatted string that presents the application performance statistics.
 boolean isSchedulingFinished()
           
 void parse(java.lang.String applicationFile, java.lang.String servicesFile, java.lang.String credentialsFile)
           
 ApplicationParser parseApplication(java.lang.String applicationFile)
           
 CredentialParser parseCredentials(java.lang.String credentialsFile)
           
 ServiceParser parseServices(java.lang.String servicesFile)
           
 void removeJob(Job job)
          Removes a job from the broker application
 void schedule()
          Initialises the appropriate scheduler based on the broker properties, and starts the scheduler on a seperate thread
 void setQos(Qos qos)
           
 void terminate()
          Terminates the execution by stopping all the running jobs
 void terminateJob(java.lang.String jobName)
          Terminates the job, whose identifier has been passed, if it is running
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridbusFarmingEngine

public GridbusFarmingEngine()
                     throws GridBrokerException
Initializes the broker using default properties, defined in the BrokerProperties class.

Throws:
GridBrokerException

GridbusFarmingEngine

public GridbusFarmingEngine(BrokerProperties config)
                     throws GridBrokerException
Initialises the broker with the given BrokerProperties object

Parameters:
config -
Throws:
GridBrokerException

GridbusFarmingEngine

public GridbusFarmingEngine(java.lang.String applicationID)
                     throws GridBrokerException
Initializes the broker using default properties, defined in the BrokerProperties class. Loads an application with the given id, from the persistent store. Throws an exception if the applicationID is not found in the persistent store (database).

Parameters:
applicationID -
Throws:
GridBrokerException

GridbusFarmingEngine

public GridbusFarmingEngine(BrokerProperties props,
                            java.lang.String applicationId)
                     throws GridBrokerException
Initialises the broker with the given BrokerProperties object, Loads an application with the given id. Throws an exception if the applicationID is not found in the persistent store (database).

Parameters:
props -
applicationId -
Throws:
GridBrokerException
Method Detail

schedule

public void schedule()
              throws java.lang.Exception
Initialises the appropriate scheduler based on the broker properties, and starts the scheduler on a seperate thread

Throws:
java.lang.Exception

setQos

public void setQos(Qos qos)
            throws GridBrokerException
Parameters:
qos -
Throws:
GridBrokerException

getQos

public Qos getQos()
           throws GridBrokerException
Returns:
Qos instance
Throws:
GridBrokerException

terminateJob

public void terminateJob(java.lang.String jobName)
                  throws java.lang.Exception
Terminates the job, whose identifier has been passed, if it is running

Parameters:
jobName -
Throws:
java.lang.Exception

terminate

public void terminate()
Terminates the execution by stopping all the running jobs


getJobs

public java.util.Collection getJobs(int status)
                             throws GridBrokerException
Gets all the jobs with the given status

Parameters:
status -
Returns:
active set
Throws:
GridBrokerException

getJobs

public java.util.Collection getJobs()
                             throws GridBrokerException
Gets all the jobs

Returns:
jobs
Throws:
GridBrokerException

getJob

public Job getJob(java.lang.String jobname)
           throws GridBrokerException
Parameters:
jobname -
Returns:
Throws:
GridBrokerException

getJobCount

public long getJobCount(int status,
                        java.lang.String serverName)
                 throws GridBrokerException
Parameters:
status -
serverName -
Returns:
job count for given status and server
Throws:
GridBrokerException

addJob

public void addJob(Job job)
            throws GridBrokerException
Adds a job to the broker application

Parameters:
job -
Throws:
GridBrokerException

addSCSJob

public void addSCSJob(org.gridbus.scs.common.SCSJob job)
               throws GridBrokerException
Throws:
GridBrokerException

removeJob

public void removeJob(Job job)
               throws GridBrokerException
Removes a job from the broker application

Parameters:
job -
Throws:
GridBrokerException

addService

public void addService(Service s)
                throws GridBrokerException
Parameters:
s -
Throws:
GridBrokerException

getServers

public java.util.Collection getServers()
                                throws GridBrokerException
Returns:
collection of services
Throws:
GridBrokerException

getApplication

public ApplicationContext getApplication()
                                  throws GridBrokerException
Get the application context

Returns:
application context object
Throws:
GridBrokerException

createApplication

public java.lang.String createApplication(ApplicationContext app)
                                   throws GridBrokerException
Save the application context to the broker storage

Parameters:
app -
Returns:
the application id
Throws:
GridBrokerException

isSchedulingFinished

public boolean isSchedulingFinished()
                             throws GridBrokerException
Returns:
true if scheduling was successful, false otherwise
Throws:
GridBrokerException

parse

public void parse(java.lang.String applicationFile,
                  java.lang.String servicesFile,
                  java.lang.String credentialsFile)
           throws GridBrokerException,
                  java.io.IOException,
                  java.lang.Exception
Parameters:
applicationFile -
servicesFile -
credentialsFile -
Throws:
GridBrokerException
java.io.IOException
java.lang.Exception

parseServices

public ServiceParser parseServices(java.lang.String servicesFile)
                            throws java.lang.Exception
Parameters:
servicesFile -
Returns:
ServiceParser
Throws:
java.lang.Exception

parseCredentials

public CredentialParser parseCredentials(java.lang.String credentialsFile)
                                  throws java.lang.Exception
Parameters:
credentialsFile -
Returns:
credential parser
Throws:
java.lang.Exception

parseApplication

public ApplicationParser parseApplication(java.lang.String applicationFile)
                                   throws java.lang.Exception
Parameters:
applicationFile -
Returns:
application parser object
Throws:
java.lang.Exception

getServices

public java.util.Collection getServices(int serviceType)
                                 throws GridBrokerException
Parameters:
serviceType -
Returns:
list of services
Throws:
GridBrokerException

getJobStatistics

public JobStatistics getJobStatistics(java.lang.String name)
                               throws GridBrokerException
Parameters:
name -
Returns:
Throws:
GridBrokerException

getSummaryStatistics

public java.lang.String getSummaryStatistics()
                                      throws GridBrokerException
Returns a formatted string that presents the application performance statistics.

Returns:
Throws:
GridBrokerException

Copyright © The University of Melbourne. 2006