eu.xtreemos.xati.API
Class XResMng

java.lang.Object
  extended by eu.xtreemos.xati.API.XResMng

public class XResMng
extends java.lang.Object

Author:
gregor.pipan@xlab.si

Field Summary
static java.lang.String servicename
           
 
Constructor Summary
XResMng()
           
 
Method Summary
static java.util.ArrayList<CommunicationAddress> createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> __jsdlTable)
           
static java.util.ArrayList<ResourceDescriptorRecord> getNodeResourceDescriptor(CommunicationAddress __address)
          A proxy call to ResourceMonitor.query of a service running at particular node.
static java.util.Hashtable<java.lang.String,java.lang.Object> getNodeResourceGLUE(CommunicationAddress __address)
          A proxy call to ResourceMonitor.query of a service running at particular node.
static java.util.Hashtable<java.lang.String,java.lang.String> getResInfo(CommunicationAddress __resource, java.security.cert.X509Certificate __userCtx)
          Returns the monitoring information associated with the resource.
static java.util.ArrayList<java.lang.String> getResMetrics(CommunicationAddress __resource, java.security.cert.X509Certificate __userCtx)
          Returns the list of metrics available on that resource.
static java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptors(java.util.ArrayList<CommunicationAddress> __resources)
          Retrieve the resource descriptors of the nodes from the given list.
static java.util.ArrayList<CommunicationAddress> getResources(java.lang.String __query, java.security.cert.X509Certificate __userCtx, java.lang.Integer __howMany)
          Retrieve a collection of resources that match the job's resource demands.
static java.util.ArrayList<CommunicationAddress> getResourcesADS(java.lang.String __query, java.security.cert.X509Certificate __userCtx, java.lang.Integer __howMany)
           
static java.util.ArrayList<CommunicationAddress> getResourcesCentral(java.lang.String __query, java.security.cert.X509Certificate __userCtx, java.lang.Integer __howMany)
          Retrieve a collection of resources that match the job's resource demands.
static java.util.ArrayList<CommunicationAddress> getResourcesFromParsedCommand(ParsedCommand __command)
           
static java.util.ArrayList<CommunicationAddress> getResourcesFromString(java.lang.String __query)
          Retrieve a collection of resources that match the job's resource demands.
static java.util.ArrayList<CommunicationAddress> getResourcesFromStructure(java.util.Hashtable<java.lang.String,java.lang.Object> __jsdl)
          Retrieve a collection of resources that match the job's resource demands.
static java.util.ArrayList<CommunicationAddress> getResourcesScored(java.lang.String __query)
           
static java.util.ArrayList<CommunicationAddress> getResourcesScoredWeighted(java.lang.String __query, java.util.Hashtable<java.lang.Integer,java.lang.Double> __weights)
           
static java.util.ArrayList<CommunicationAddress> getResourcesSorted(java.lang.String __query, ResourceDescriptorComparatorSerializable __comparator)
          Retrieve a collection of resources that match the job's resource demands.
static java.util.ArrayList<CommunicationAddress> testCall()
          A function for testing stuff.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servicename

public static java.lang.String servicename
Constructor Detail

XResMng

public XResMng()
Method Detail

createRequest

public static java.util.ArrayList<CommunicationAddress> createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> __jsdlTable)
                                                               throws java.lang.Exception
Throws:
java.lang.Exception

getResources

public static java.util.ArrayList<CommunicationAddress> getResources(java.lang.String __query,
                                                                     java.security.cert.X509Certificate __userCtx,
                                                                     java.lang.Integer __howMany)
                                                              throws java.lang.Exception
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a JSDL document with its contents in a string.

Parameters:
query - The contents of the XML file with JSDL query containing the resource query as a part of a job description.
userCtx - The certificate signifying the user on whose behalf the call is doing the query.
howMany - A hint, specifying how many retrieved resources we would like to have.
Returns:
A collection of addresses of nodes that offer resources that satisfy the job's resource requirements.
Throws:
java.lang.Exception

getResourcesADS

public static java.util.ArrayList<CommunicationAddress> getResourcesADS(java.lang.String __query,
                                                                        java.security.cert.X509Certificate __userCtx,
                                                                        java.lang.Integer __howMany)
                                                                 throws java.lang.Exception
Throws:
java.lang.Exception

getResourcesCentral

public static java.util.ArrayList<CommunicationAddress> getResourcesCentral(java.lang.String __query,
                                                                            java.security.cert.X509Certificate __userCtx,
                                                                            java.lang.Integer __howMany)
                                                                     throws java.lang.Exception
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a JSDL document with its contents in a string.

Parameters:
query - The contents of the XML file with JSDL query containing the resource query as a part of a job description.
userCtx - The certificate signifying the user on whose behalf the call is doing the query.
howMany - A hint, specifying how many retrieved resources we would like to have.
Returns:
A collection of addresses of nodes that offer resources that satisfy the job's resource requirements.
Throws:
java.lang.Exception

getResourcesFromString

public static java.util.ArrayList<CommunicationAddress> getResourcesFromString(java.lang.String __query)
                                                                        throws java.lang.Exception
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a JSDL document with its contents in a string.

Parameters:
query - The contents of the XML file with JSDL query containing the resource query as a part of a job description.
Returns:
A collection of addresses of nodes that offer resources that satisfy the job's resource requirements.
Throws:
java.lang.Exception

getResourcesFromStructure

public static java.util.ArrayList<CommunicationAddress> getResourcesFromStructure(java.util.Hashtable<java.lang.String,java.lang.Object> __jsdl)
                                                                           throws java.lang.Exception
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a structure containing a parsed and searchable JSDL document.

Parameters:
jsdl - The structure containing the parsed and searchable contents of the XML file with JSDL query.
Returns:
A collection of addresses of nodes that offer resources that satisfy the job's resource requirements.
Throws:
java.lang.Exception

getResourcesSorted

public static java.util.ArrayList<CommunicationAddress> getResourcesSorted(java.lang.String __query,
                                                                           ResourceDescriptorComparatorSerializable __comparator)
                                                                    throws java.lang.Exception
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a JSDL document with its contents in a string. The resulting nodes will be sorted according to the attribute ordering.

Parameters:
query - The contents of the XML file with JSDL query containing the resource query as a part of a job description.
comparator - The comparator to use when sorting the records.
Returns:
A collection of addresses of nodes that offer resources that satisfy the job's resource requirements.
Throws:
java.lang.Exception

getResourcesScored

public static java.util.ArrayList<CommunicationAddress> getResourcesScored(java.lang.String __query)
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

getResourcesScoredWeighted

public static java.util.ArrayList<CommunicationAddress> getResourcesScoredWeighted(java.lang.String __query,
                                                                                   java.util.Hashtable<java.lang.Integer,java.lang.Double> __weights)
                                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getNodeResourceGLUE

public static java.util.Hashtable<java.lang.String,java.lang.Object> getNodeResourceGLUE(CommunicationAddress __address)
                                                                                  throws java.lang.Exception
A proxy call to ResourceMonitor.query of a service running at particular node.

Parameters:
address - The node we request the resource details of the ResourceMonitor service from.
Returns:
The GLUE structure enumerating the resources of the node.
Throws:
java.lang.Exception

getNodeResourceDescriptor

public static java.util.ArrayList<ResourceDescriptorRecord> getNodeResourceDescriptor(CommunicationAddress __address)
                                                                               throws java.lang.Exception
A proxy call to ResourceMonitor.query of a service running at particular node.

Parameters:
address - The node we request the resource details of the ResourceMonitor service from.
Returns:
The collection of resource descriptors detailing the resources of the node.
Throws:
java.lang.Exception

testCall

public static java.util.ArrayList<CommunicationAddress> testCall()
                                                          throws java.lang.Exception
A function for testing stuff.

Returns:
Nothing in particular.
Throws:
java.lang.Exception

getResourcesFromParsedCommand

public static java.util.ArrayList<CommunicationAddress> getResourcesFromParsedCommand(ParsedCommand __command)
                                                                               throws java.lang.Exception
Throws:
java.lang.Exception

getResInfo

public static java.util.Hashtable<java.lang.String,java.lang.String> getResInfo(CommunicationAddress __resource,
                                                                                java.security.cert.X509Certificate __userCtx)
                                                                         throws java.lang.Exception
Returns the monitoring information associated with the resource. Only the users authorised for access to the resource can obtain the information.

Parameters:
resource - The resource we are querying the information on.
userCtx - The user that queries the information
Returns:
A list of metrics (see #getResourceMetrics and their respective values on the resource.
Throws:
java.lang.Exception

getResMetrics

public static java.util.ArrayList<java.lang.String> getResMetrics(CommunicationAddress __resource,
                                                                  java.security.cert.X509Certificate __userCtx)
                                                           throws java.lang.Exception
Returns the list of metrics available on that resource. Only the users authorised for access to the resource can obtain the information.

Parameters:
resource - The resource we are querying the information on.
userCtx - The user that queries the information
Returns:
A list of metrics monitored on the resource.
Throws:
java.lang.Exception

getResourceDescriptors

public static java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptors(java.util.ArrayList<CommunicationAddress> __resources)
                                                                            throws java.lang.Exception
Retrieve the resource descriptors of the nodes from the given list. It asynchronously calls each node's resource monitor and queries its resource info. Once all the responses are accounted for, it returns the result.

Parameters:
resources - The list of communication addresses of the resources that we would like to learn the resource properties of.
Returns:
The list of resource descriptors of the nodes that the local resource monitors succeeded in sending the resource description. Warning: the order of the resources in the returned value will differ from the order of their respective addresses in the call parameter. Please use ResourceDescriptorRecord.communicationAddress of each element to check the responses' address.
Throws:
java.lang.Exception