UNICORE Resource Broker NJS Plugin
1.5α1

org.eurogrid.broker.server
Class AbstractBroker

java.lang.Object
  |
  +--org.eurogrid.broker.server.AbstractBroker
All Implemented Interfaces:
NamedPlugin, ResourceBroker, ResourceChecker
Direct Known Subclasses:
BrokerNJSIfc, ResourceBroker

public abstract class AbstractBroker
extends Object
implements NamedPlugin, ResourceBroker

Abstract broker that handles the identity delegation parts of brokering.


Field Summary
protected  Map controlState
          Mapping from tasks to their control state.
protected  boolean isInitialised
          Whether the broker is initialised.
protected  String localVsiteName
          The local Vsite name, used for checking for brokering loops.
protected  Logger logger
          The master logger for the broker.
 
Constructor Summary
AbstractBroker()
           
 
Method Summary
 void apply(Control action, CheckResources cr)
          Apply the given action to the given check-resources operation.
protected abstract  void checkQoS(CheckQoS task, IncarnatedUser incedUser, User user, byte[] extraInformation, CheckQoS_Outcome outcome)
          Perform a CheckQoS, producing an outcome.
protected abstract  void checkResources(CheckResources task, IncarnatedUser incedUser, User user, byte[] extraInformation, CheckResources_Outcome outcome)
          Perform a CheckResources, producing an outcome.
 Logger getLogger()
          Get the master logger for the broker.
 Logger getLogger(NamedPlugin np)
          Create a logger instance that is specialised to running the given plugin module within this broker.
 QoSCheck getQoSCheckResource()
          Return a QoSCheck object for advertising by the NJS.
 ResourceCheck getResourceCheckResource()
          Return a ResourceCheck object for advertising by the NJS.
 Control getState(CheckResources cr)
          Discover the control state of the given CheckResources task.
 void incarnateCheckQoS(CheckQoS task, IncarnatedUser incedUser, User user, CheckQoS_Outcome outcome)
          Incarnate a CheckQoS, producing an outcome.
 void incarnateCheckResources(CheckResources task, IncarnatedUser incedUser, User user, CheckResources_Outcome outcome)
          Incarnate a CheckResources, producing an outcome.
protected abstract  String initialise(Vsite vsite, ResourceSet resources, ResourceChecker.NJS njs, Element configuration)
          Initialise the core of the broker.
 void initialise(Vsite vsite, ResourceSet resources, ResourceChecker.NJS njs, String initString)
          Initialise ourselves
protected  void initialiseLogger()
           
protected abstract  void logBannerMessage()
          Write the main banner message to the log.
 String nextJobID()
          Sequence value generator for use by brokers creating tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eurogrid.broker.server.NamedPlugin
getFormalName, getName
 
Methods inherited from interface com.fujitsu.arcon.njs.interfaces.ResourceChecker
claim
 

Field Detail

controlState

protected Map controlState
Mapping from tasks to their control state.


isInitialised

protected boolean isInitialised
Whether the broker is initialised.


localVsiteName

protected String localVsiteName
The local Vsite name, used for checking for brokering loops.


logger

protected Logger logger
The master logger for the broker.

Constructor Detail

AbstractBroker

public AbstractBroker()
Method Detail

apply

public void apply(Control action,
                  CheckResources cr)
           throws Exception
Apply the given action to the given check-resources operation.

Specified by:
apply in interface ResourceChecker
Exception

checkQoS

protected abstract void checkQoS(CheckQoS task,
                                 IncarnatedUser incedUser,
                                 User user,
                                 byte[] extraInformation,
                                 CheckQoS_Outcome outcome)
                          throws ResourceCheckerException
Perform a CheckQoS, producing an outcome.

Parameters:
task - the request to check resources that requires incarnation
incedUser - the incarnated user performing the check
user - the user performing the check
outcome - the incarnated user performing the check
ResourceCheckerException

checkResources

protected abstract void checkResources(CheckResources task,
                                       IncarnatedUser incedUser,
                                       User user,
                                       byte[] extraInformation,
                                       CheckResources_Outcome outcome)
                                throws ResourceCheckerException
Perform a CheckResources, producing an outcome.

Parameters:
task - the request to check resources that requires incarnation
incedUser - the incarnated user performing the check
user - the User performing the check
outcome - the incarnated user performing the check
ResourceCheckerException

getLogger

public Logger getLogger()
Get the master logger for the broker.


getLogger

public Logger getLogger(NamedPlugin np)
Create a logger instance that is specialised to running the given plugin module within this broker.


getQoSCheckResource

public QoSCheck getQoSCheckResource()
Return a QoSCheck object for advertising by the NJS. Subclasses should override if they do not support QoS checks.

Specified by:
getQoSCheckResource in interface ResourceBroker
Returns:
Resource object used for advertising ourselves.

getResourceCheckResource

public ResourceCheck getResourceCheckResource()
Return a ResourceCheck object for advertising by the NJS. Subclasses should override if they do not support QoS checks.

Specified by:
getResourceCheckResource in interface ResourceChecker
Returns:
Resource object used for advertising ourselves.

getState

public Control getState(CheckResources cr)
Discover the control state of the given CheckResources task.

See Also:
apply(Control,CheckResources)

incarnateCheckQoS

public final void incarnateCheckQoS(CheckQoS task,
                                    IncarnatedUser incedUser,
                                    User user,
                                    CheckQoS_Outcome outcome)
                             throws ResourceCheckerException
Incarnate a CheckQoS, producing an outcome. Really just a wrapper round checkQoS(...) that handles input validation and delegation.

Specified by:
incarnateCheckQoS in interface ResourceBroker
Parameters:
task - the request to check resources that requires incarnation
incedUser - the incarnated user performing the check
user - the User performing the check
outcome - the incarnated user performing the check
ResourceCheckerException

incarnateCheckResources

public final void incarnateCheckResources(CheckResources task,
                                          IncarnatedUser incedUser,
                                          User user,
                                          CheckResources_Outcome outcome)
                                   throws ResourceCheckerException
Incarnate a CheckResources, producing an outcome. Really just a wrapper round checkResources(...) that handles input validation and delegation.

Specified by:
incarnateCheckResources in interface ResourceChecker
Parameters:
task - the request to check resources that requires incarnation
incedUser - the incarnated user performing the check
user - the User performing the check
outcome - the incarnated user performing the check
ResourceCheckerException

initialise

protected abstract String initialise(Vsite vsite,
                                     ResourceSet resources,
                                     ResourceChecker.NJS njs,
                                     Element configuration)
                              throws ResourceCheckerException
Initialise the core of the broker.

Parameters:
vsite - The Vsite where we are.
resources - The resources at this Vsite.
njs - The hosting NJS.
configuration - The root of the broker's XML/DOM configuration tree.
Returns:
The name of the host Vsite for use in broker-loop detection.
ResourceCheckerException

initialise

public final void initialise(Vsite vsite,
                             ResourceSet resources,
                             ResourceChecker.NJS njs,
                             String initString)
                      throws ResourceCheckerException
Initialise ourselves

Specified by:
initialise in interface ResourceChecker
Parameters:
vsite - The Vsite where we are.
resources - The resources at this Vsite.
njs - The hosting NJS.
initString - The initialisation string (XML) from the IDB.
ResourceCheckerException

initialiseLogger

protected void initialiseLogger()
                         throws ResourceCheckerException
ResourceCheckerException

logBannerMessage

protected abstract void logBannerMessage()
Write the main banner message to the log. At least one line should be written at level CONFIG and any additional lines should be at level INFO.


nextJobID

public String nextJobID()
Sequence value generator for use by brokers creating tasks. Generates values that are unique to a particular NJS invokation.


UNICORE Resource Broker NJS Plugin
1.5α1

Submit a bug or feature
Copyright © 2002-2004 University of Manchester, U.K. See license.terms for details.