UNICORE Resource Broker NJS Plugin
1.5α1

org.eurogrid.broker.server.gt3
Class GT3LocalResourceChecker

java.lang.Object
  |
  +--org.eurogrid.broker.server.gt3.GT3LocalResourceChecker
All Implemented Interfaces:
LocalResourceChecker, NamedPlugin

public class GT3LocalResourceChecker
extends Object
implements LocalResourceChecker

Local resource checker that uses a GT3-based InformationService. It operates by translating UNICORE resources into XPath search terms based on an ontology that defines the concepts in the two universes and the schemes for mapping between the two.

Version:
$Revision: 1.8 $, $Date: 2004/02/17 11:46:20 $
Author:
Donal K. Fellows
See Also:
Translator

Constructor Summary
GT3LocalResourceChecker()
           
 
Method Summary
 boolean canGetQoSData()
          Delegates to fallback resource checker.
 boolean checkResources(ResourceBroker.TSIRunEngine tre, ResourceSet rs)
          Check whether the given set of resources are available.
 boolean estimateTurnaroundTime(ResourceBroker.TSIRunEngine tre, Estimate est, ResourceSet rs)
          Delegates to fallback resource checker.
 Integer getCPUQuota(IncarnatedUser user, ResourceSet rs)
          Delegates to fallback resource checker.
 String getFormalName()
          Get the full formal name of this module for use in the logger.
 String getName()
          Get the name of this module for use in the logger.
 boolean initialise(ResourceBroker broker, Logger logger, ResourceSet njsResources, Element configRoot)
          Initialise this local resource checker.
static void main(String[] args)
          Test harness.
protected  Element[] queryByResourceSet(ResourceSet resSet, List untranslatables, List log)
          Query a GT3 Index Service for those SDEs that satisfy the given set of resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GT3LocalResourceChecker

public GT3LocalResourceChecker()
Method Detail

canGetQoSData

public boolean canGetQoSData()
Delegates to fallback resource checker.

Specified by:
canGetQoSData in interface LocalResourceChecker
See Also:
LocalResourceChecker.canGetQoSData()

checkResources

public boolean checkResources(ResourceBroker.TSIRunEngine tre,
                              ResourceSet rs)
Check whether the given set of resources are available. Operates by:
  1. translating the resource set into an XPath search term
  2. firing that search term through a GT3 Index Service
  3. delegating all untranslatable terms to our fallback resource checker

Specified by:
checkResources in interface LocalResourceChecker
Parameters:
rs - The set of resources requested.
tre - User-locked TSI access interface.
Returns:
True iff the resource set can actually be provided one way or another.

estimateTurnaroundTime

public boolean estimateTurnaroundTime(ResourceBroker.TSIRunEngine tre,
                                      Estimate est,
                                      ResourceSet rs)
Delegates to fallback resource checker.

Specified by:
estimateTurnaroundTime in interface LocalResourceChecker
Parameters:
tre - Provides access to the NJS's TSI as well as describing on whose behalf we are getting the estimate.
See Also:
LocalResourceChecker.estimateTurnaroundTime(ResourceBroker.TSIRunEngine,Estimate,ResourceSet)

getCPUQuota

public Integer getCPUQuota(IncarnatedUser user,
                           ResourceSet rs)
Delegates to fallback resource checker.

Specified by:
getCPUQuota in interface LocalResourceChecker
Returns:
Number of seconds left, or null if the operation is not supported.
See Also:
LocalResourceChecker.getCPUQuota(IncarnatedUser,ResourceSet)

getFormalName

public String getFormalName()
Get the full formal name of this module for use in the logger.

Specified by:
getFormalName in interface NamedPlugin

getName

public String getName()
Get the name of this module for use in the logger.

Specified by:
getName in interface NamedPlugin

initialise

public boolean initialise(ResourceBroker broker,
                          Logger logger,
                          ResourceSet njsResources,
                          Element configRoot)
                   throws ResourceCheckerException
Initialise this local resource checker.

Specified by:
initialise in interface LocalResourceChecker
Returns:
whether the initialisation succeeded.
Throws:
Translator.TranslatorException - If something is badly wrong with the translation we ask to use.
ResourceCheckerException

main

public static void main(String[] args)
                 throws Exception
Test harness.

Exception

queryByResourceSet

protected Element[] queryByResourceSet(ResourceSet resSet,
                                       List untranslatables,
                                       List log)
                                throws Exception
Query a GT3 Index Service for those SDEs that satisfy the given set of resources.

Parameters:
resSet - The set of resources requested.
untranslatables - Place to store the untranslatable resources.
Returns:
A (possibly empty) array of elements that match the generated query, or null if the translation itself failed.
Exception

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.