eu.xtreemos.xosd.resmng
Class ResMng

java.lang.Object
  extended by eu.xtreemos.system.eventmachine.stage.AbstractStage
      extended by eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
          extended by eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
              extended by eu.xtreemos.xosd.resmng.ResMng
All Implemented Interfaces:
eu.xtreemos.system.eventmachine.queue.IEventHandler, eu.xtreemos.system.eventmachine.stage.IStage

public class ResMng
extends eu.xtreemos.system.eventmachine.stage.Abstract2wayStage

A class implementing the Resource Manager service. The service collects the available computation node and enables the node selection by resource queries expressed as a part of a job description. The job descriptions are formed as XMLs using the JSDL schema. Resource Manager queries nodes' local Resource Monitor service to obtain the resource descriptors formed as XMLs using the GLUE v.1.2 schema.

Author:
matej.artac@xlab.si, eva.milosev@xlab.si

Nested Class Summary
 class ResMng.WeightedResourceDescriptorComparator
           
protected  class ResMng.XMLMatch
          A class-structure for defining which element in GLUE match (i.e. should be used for checking the criteria against) an element in JSDL.
 
Field Summary
private  boolean compromised
          Indicates whether returned signed data was compromised.
protected  CResMngConfig config
          The configuration of the service.
private  java.lang.String delim
           
(package private) static org.apache.log4j.Logger logger
           
private  eu.xtreemos.xosd.utilities.metrics.JobMetrics metrics
           
private  eu.xtreemos.xosd.utilities.metrics.JobMetricsData metricsData
           
(package private)  org.bouncycastle.openssl.PasswordFinder myPass
           
protected  ResMng.XMLMatch[] xmlMatches
           
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
context, counter, curContext, sink
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
queue
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage
handlerChain, handlerGroup, handlerThreads, name, running, serviceListeners
 
Constructor Summary
ResMng()
           
 
Method Summary
 java.lang.Integer addJobMetric(java.lang.String jobId, eu.xtreemos.xosd.utilities.metrics.MetricsDesc metric)
           
 java.util.ArrayList<CommunicationAddress> createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlTable)
           
 java.lang.Object createRequestAnswer(java.util.ArrayList<CommunicationAddress> alRes)
           
 java.lang.Exception failureCallback(java.lang.Exception ex)
           
 java.lang.Object getDaemonsReplyAndProcess(java.util.ArrayList list)
          Dorothy, you're not in Kansas anymore... but in a Callback!
 java.lang.String getHandledEventType()
           
 java.lang.String getJobInfo(java.lang.String jobId, java.lang.Integer flags, java.lang.Integer infoLevel, java.util.ArrayList<java.lang.String> metricsList, java.lang.String user)
           
 java.util.ArrayList<ResourceDescriptorRecord> getNodeResourceDescriptor(CommunicationAddress address)
          A proxy call to ResourceMonitor.query of a service running at particular node.
 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.
 java.util.ArrayList<ResourceDescriptorRecord> getProxyResMonDescrReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
          The callback that concludes the call to getNodeResourceDescriptor(CommunicationAddress) and passes the returns the value.
 java.util.Hashtable<java.lang.String,java.lang.Object> getProxyResMonReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
          The callback that concludes the call to getNodeResourceGLUE(CommunicationAddress) and passes the returns the value.
 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.
 java.util.Hashtable<java.lang.String,java.lang.String> getResInfoSuccess(java.util.Hashtable<java.lang.String,java.lang.String> list)
           
 java.util.ArrayList<java.lang.String> getResMetrics(CommunicationAddress resource, java.security.cert.X509Certificate userCtx)
          Returns the list of metrics available on that resource.
 java.util.ArrayList<java.lang.String> getResMetricsSuccess(java.util.ArrayList<java.lang.String> metrics)
           
 java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptors(java.util.ArrayList<CommunicationAddress> resources)
          Retrieve the resource descriptors of the nodes from the given list.
 java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsFailure(java.lang.Exception ex)
           
 java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsSuccess(java.util.ArrayList<ResourceDescriptorRecord> result)
           
 java.lang.Object getResourceMonitorReply(java.util.Hashtable glue)
          continuing the processing after ResourceMonitor call, to the Wicked Witch of the West.
 java.lang.Object getResourceMonitorReplyFailure(java.lang.Exception ex)
           
 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.
 java.util.ArrayList<CommunicationAddress> getResourcesADS(java.lang.String query, java.security.cert.X509Certificate userCtx, java.lang.Integer howMany)
           
 java.util.ArrayList<CommunicationAddress> getResourcesADSSucceeded(java.util.ArrayList<CommunicationAddress> selection)
          The SRDSMng retuns here after the call to getResources[ADS] to provide its selection based on the JSDL.
 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.
 java.util.ArrayList<CommunicationAddress> getResourcesFromParsedCommand(ParsedCommand command)
           
 java.util.ArrayList<CommunicationAddress> getResourcesFromPath(java.lang.String queryFileName)
          Retrieve a collection of resources that match the job's resource demands.
 java.util.ArrayList<CommunicationAddress> getResourcesFromString(java.lang.String query)
          Retrieve a collection of resources that match the job's resource demands.
 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.
 java.util.ArrayList<CommunicationAddress> getResourcesScored(java.lang.String query)
           
 java.util.ArrayList<CommunicationAddress> getResourcesScoredWeighted(java.lang.String query, java.util.Hashtable<java.lang.Integer,java.lang.Double> weights)
           
 java.util.ArrayList<CommunicationAddress> getResourcesSorted(java.lang.String query, ResourceDescriptorComparatorSerializable comparator)
          Retrieve a collection of resources that match the job's resource demands.
 java.util.ArrayList<CommunicationAddress> getXMLExtractorReply(java.util.Hashtable list)
          The callback with the final piece of processing of the #getResources(String) service call.
 void handleEvent(java.lang.Object event)
           
private  java.lang.Integer inheritMetrics(java.lang.String jobId, CommunicationAddress jobMngAddr)
           
 java.lang.Integer inheritMetricsCB(java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> metricsList)
           
 void init()
           
protected  java.util.ArrayList<ResourceDescriptorScorekeeper> matchAndScoreResources(java.util.ArrayList<ResourceDescriptorRecord> resources, IConditionTreeNode conditionTreeRoot)
           
protected  java.util.ArrayList<CommunicationAddress> matchProcesses(java.util.ArrayList fullList, java.util.ArrayList glues, java.util.Hashtable jsdl, ResMngStorage storage)
           
protected  java.util.ArrayList<ResourceDescriptorRecord> matchResources(java.util.ArrayList<ResourceDescriptorRecord> resources, IConditionTreeNode conditionTreeRoot, ResMngStorage storage)
          Traverses the condition tree for each element in the resource descriptor collection and selects those that match the query expressed in the condition tree.
 java.lang.Object policyEnforceRequest(java.util.ArrayList<CommunicationAddress> list)
          Call to VOPS service.
 java.lang.Object policyEnforceRequestCertificateCatcher(java.security.cert.X509Certificate certificate)
          Catching certificates from CDAMngs that are being queried for certificates.
 java.lang.Object policyEnforceRequestCertificateCatcherFailure(java.lang.Exception err)
          Catches failures of CDAMng.getResourceCertificate call.
 void removeBuffers(java.lang.String jobId)
          It's called from jobMng when cleaning.
 java.lang.Integer removeJobMetric(java.lang.String jobId, java.lang.String metricName)
           
 void removeMetrics(java.lang.String jobId)
          Should be called after jobUnit dies, but resmng doesn't notice it.
 java.lang.Integer setMetricValue(java.lang.String jobId, java.lang.String metricName, java.lang.String value)
           
 java.lang.Integer setMonitoringBuffering(java.lang.String jobId, java.lang.String metricName, java.lang.Boolean enable, java.lang.String user)
           
 java.util.ArrayList<CommunicationAddress> testCall()
          A function for testing stuff.
 java.lang.Object testCallCallback1(java.util.Hashtable jsdl)
           
 java.util.ArrayList testCallCallback2(java.util.Hashtable glue)
           
 java.util.ArrayList<CommunicationAddress> VerifyPolicyAEMSuccess(ResourceMatching verifiedMatching)
           
 java.util.ArrayList<CommunicationAddress> verifyPolicyCertResHandler(ResourceMatching rmList)
          Reads VOPS' public key and checks if rmList has been written with VOPS' private key.
 java.util.Hashtable<java.lang.String,java.lang.String> VerifyPolicyForResInfo(ResourceMatching resmatching)
           
 java.util.ArrayList<java.lang.String> VerifyPolicyForResMetrics(ResourceMatching resmatching)
           
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
getContext, removeContext, SendException, SendException, SendException, SendReply, SendReply, SendReply, setSink
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
dequeue, getSource
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage
addHandler, addHandler, addServiceListener, getName, getShortName, getThreadCount, notifyServiceInitialised, notifyServiceStarted, notifyServiceStopped, processEvent, removeHandler, removeServiceListener, setThreadCount, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delim

private java.lang.String delim

compromised

private boolean compromised
Indicates whether returned signed data was compromised.


config

protected CResMngConfig config
The configuration of the service.


metrics

private eu.xtreemos.xosd.utilities.metrics.JobMetrics metrics

metricsData

private eu.xtreemos.xosd.utilities.metrics.JobMetricsData metricsData

logger

static final org.apache.log4j.Logger logger

xmlMatches

protected ResMng.XMLMatch[] xmlMatches

myPass

org.bouncycastle.openssl.PasswordFinder myPass
Constructor Detail

ResMng

public ResMng()
Method Detail

policyEnforceRequest

public java.lang.Object policyEnforceRequest(java.util.ArrayList<CommunicationAddress> list)
Call to VOPS service. Call this method to filter selected resources with enforcing policies, residing at VOPS' home.


policyEnforceRequestCertificateCatcher

public java.lang.Object policyEnforceRequestCertificateCatcher(java.security.cert.X509Certificate certificate)
Catching certificates from CDAMngs that are being queried for certificates.

Parameters:
certificate -
Returns:

policyEnforceRequestCertificateCatcherFailure

public java.lang.Object policyEnforceRequestCertificateCatcherFailure(java.lang.Exception err)
Catches failures of CDAMng.getResourceCertificate call.

Parameters:
err -
Returns:

verifyPolicyCertResHandler

public java.util.ArrayList<CommunicationAddress> verifyPolicyCertResHandler(ResourceMatching rmList)
Reads VOPS' public key and checks if rmList has been written with VOPS' private key.

Parameters:
rmList - Signed list of resources
Returns:
ArrayList of CommunicationAddresses if the list is trusted. If we do not trust the list, empty ArrayList is returned.

createRequest

public java.util.ArrayList<CommunicationAddress> createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlTable)

createRequestAnswer

public java.lang.Object createRequestAnswer(java.util.ArrayList<CommunicationAddress> alRes)

getDaemonsReplyAndProcess

public java.lang.Object getDaemonsReplyAndProcess(java.util.ArrayList list)
Dorothy, you're not in Kansas anymore... but in a Callback! Generally this is where the processing continues from getResources(String).

Parameters:
list - List of available hosts
Returns:
ServiceMessage for another callback. Cause that's how we roll on.

getResourceMonitorReplyFailure

public java.lang.Object getResourceMonitorReplyFailure(java.lang.Exception ex)
                                                throws java.lang.Exception
Parameters:
ex -
Returns:
Throws:
java.lang.Exception

getResourceMonitorReply

public java.lang.Object getResourceMonitorReply(java.util.Hashtable glue)
continuing the processing after ResourceMonitor call, to the Wicked Witch of the West. Flying monkeys will pick up the resource descriptor callbacks and bring them to you.

Parameters:
glue -
Returns:
Nothing. We're moving on to another callback.

getXMLExtractorReply

public java.util.ArrayList<CommunicationAddress> getXMLExtractorReply(java.util.Hashtable list)
The callback with the final piece of processing of the #getResources(String) service call. The method getResourceMonitorReply(Hashtable) registers this callback.

Parameters:
list - The structure representing the JSDL input, the result of the call to the XMLExtractor service.
Returns:
The list of addresses of the nodes that match the JSDL resource query.

getResourcesADSSucceeded

public java.util.ArrayList<CommunicationAddress> getResourcesADSSucceeded(java.util.ArrayList<CommunicationAddress> selection)
The SRDSMng retuns here after the call to getResources[ADS] to provide its selection based on the JSDL.

Parameters:
selection - The result obtained from the ADS, filtered by the resource requirements in the JSDL.
Returns:

VerifyPolicyAEMSuccess

public java.util.ArrayList<CommunicationAddress> VerifyPolicyAEMSuccess(ResourceMatching verifiedMatching)
                                                                 throws java.lang.Exception
Throws:
java.lang.Exception

getResourcesFromPath

public java.util.ArrayList<CommunicationAddress> getResourcesFromPath(java.lang.String queryFileName)
                                                               throws java.io.FileNotFoundException
Retrieve a collection of resources that match the job's resource demands. The resource query is expressed in a JSDL document stored in a file.

Parameters:
queryFileName - The filename 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.io.FileNotFoundException

getResources

public 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 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 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 java.util.ArrayList<CommunicationAddress> getResourcesFromString(java.lang.String query)
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.

getResourcesFromStructure

public 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. 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.

getResourcesSorted

public java.util.ArrayList<CommunicationAddress> getResourcesSorted(java.lang.String query,
                                                                    ResourceDescriptorComparatorSerializable comparator)
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.

getResourcesScored

public java.util.ArrayList<CommunicationAddress> getResourcesScored(java.lang.String query)

getResourcesScoredWeighted

public java.util.ArrayList<CommunicationAddress> getResourcesScoredWeighted(java.lang.String query,
                                                                            java.util.Hashtable<java.lang.Integer,java.lang.Double> weights)

matchProcesses

protected java.util.ArrayList<CommunicationAddress> matchProcesses(java.util.ArrayList fullList,
                                                                   java.util.ArrayList glues,
                                                                   java.util.Hashtable jsdl,
                                                                   ResMngStorage storage)
Parameters:
fullList - list of resources
glues - list of resource descriptors
jsdl - parsed JSDL query
Returns:

getNodeResourceGLUE

public 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.

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

getProxyResMonReply

public java.util.Hashtable<java.lang.String,java.lang.Object> getProxyResMonReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
The callback that concludes the call to getNodeResourceGLUE(CommunicationAddress) and passes the returns the value.

Parameters:
glue - The value passed by the ResourceMonitor.
Returns:
The value passed by the ResourceMonitor.

getNodeResourceDescriptor

public java.util.ArrayList<ResourceDescriptorRecord> getNodeResourceDescriptor(CommunicationAddress address)
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.

getProxyResMonDescrReply

public java.util.ArrayList<ResourceDescriptorRecord> getProxyResMonDescrReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
The callback that concludes the call to getNodeResourceDescriptor(CommunicationAddress) and passes the returns the value.

Parameters:
glue - The value passed by the ResourceMonitor.
Returns:
The descriptor summarising the resources from the node.

failureCallback

public java.lang.Exception failureCallback(java.lang.Exception ex)

testCall

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

Returns:
Nothing in particular.

testCallCallback1

public java.lang.Object testCallCallback1(java.util.Hashtable jsdl)

testCallCallback2

public java.util.ArrayList testCallCallback2(java.util.Hashtable glue)

matchResources

protected java.util.ArrayList<ResourceDescriptorRecord> matchResources(java.util.ArrayList<ResourceDescriptorRecord> resources,
                                                                       IConditionTreeNode conditionTreeRoot,
                                                                       ResMngStorage storage)
Traverses the condition tree for each element in the resource descriptor collection and selects those that match the query expressed in the condition tree.

Parameters:
resources - A collection of resources to be matched against the resource query in the condition tree.
conditionTreeRoot - The root node of the condition tree to match the resources against.
Returns:
A collection containing the elements conforming the query expressed by the condition tree.

matchAndScoreResources

protected java.util.ArrayList<ResourceDescriptorScorekeeper> matchAndScoreResources(java.util.ArrayList<ResourceDescriptorRecord> resources,
                                                                                    IConditionTreeNode conditionTreeRoot)

getResourcesFromParsedCommand

public java.util.ArrayList<CommunicationAddress> getResourcesFromParsedCommand(ParsedCommand command)

getResInfo

public java.util.Hashtable<java.lang.String,java.lang.String> getResInfo(CommunicationAddress resource,
                                                                         java.security.cert.X509Certificate userCtx)
                                                                  throws java.net.ConnectException,
                                                                         java.io.IOException,
                                                                         java.lang.Exception,
                                                                         java.lang.InterruptedException,
                                                                         UserNotAuthorisedException
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.net.ConnectException
java.io.IOException
java.lang.Exception
java.lang.InterruptedException
UserNotAuthorisedException

addJobMetric

public java.lang.Integer addJobMetric(java.lang.String jobId,
                                      eu.xtreemos.xosd.utilities.metrics.MetricsDesc metric)

inheritMetricsCB

public java.lang.Integer inheritMetricsCB(java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> metricsList)
Returns:
an Integer to be determined

inheritMetrics

private java.lang.Integer inheritMetrics(java.lang.String jobId,
                                         CommunicationAddress jobMngAddr)
Parameters:
jobId -
jobMngAddr -
Returns:
an Integer to be determined

removeJobMetric

public java.lang.Integer removeJobMetric(java.lang.String jobId,
                                         java.lang.String metricName)
Parameters:
jobId -
metricName -
Returns:
an Integer to be determined

removeMetrics

public void removeMetrics(java.lang.String jobId)
Should be called after jobUnit dies, but resmng doesn't notice it. So, not used (yet).

Parameters:
jobId -

removeBuffers

public void removeBuffers(java.lang.String jobId)
It's called from jobMng when cleaning.

Parameters:
jobId -

setMetricValue

public java.lang.Integer setMetricValue(java.lang.String jobId,
                                        java.lang.String metricName,
                                        java.lang.String value)
Parameters:
jobId -
metricName -
value -
Returns:
an Integer to be determined

setMonitoringBuffering

public java.lang.Integer setMonitoringBuffering(java.lang.String jobId,
                                                java.lang.String metricName,
                                                java.lang.Boolean enable,
                                                java.lang.String user)
Parameters:
jobId -
metricName -
enable -
user -
Returns:
an Integer to be determined

getJobInfo

public java.lang.String getJobInfo(java.lang.String jobId,
                                   java.lang.Integer flags,
                                   java.lang.Integer infoLevel,
                                   java.util.ArrayList<java.lang.String> metricsList,
                                   java.lang.String user)

VerifyPolicyForResInfo

public java.util.Hashtable<java.lang.String,java.lang.String> VerifyPolicyForResInfo(ResourceMatching resmatching)
                                                                              throws UserNotAuthorisedException
Throws:
UserNotAuthorisedException

getResInfoSuccess

public java.util.Hashtable<java.lang.String,java.lang.String> getResInfoSuccess(java.util.Hashtable<java.lang.String,java.lang.String> list)

getResMetrics

public 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

VerifyPolicyForResMetrics

public java.util.ArrayList<java.lang.String> VerifyPolicyForResMetrics(ResourceMatching resmatching)
                                                                throws UserNotAuthorisedException
Throws:
UserNotAuthorisedException

getResMetricsSuccess

public java.util.ArrayList<java.lang.String> getResMetricsSuccess(java.util.ArrayList<java.lang.String> metrics)

getResourceDescriptors

public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptors(java.util.ArrayList<CommunicationAddress> resources)
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.

getResourceDescriptorsSuccess

public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsSuccess(java.util.ArrayList<ResourceDescriptorRecord> result)

getResourceDescriptorsFailure

public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsFailure(java.lang.Exception ex)

init

public void init()
Specified by:
init in interface eu.xtreemos.system.eventmachine.stage.IStage
Overrides:
init in class eu.xtreemos.system.eventmachine.stage.AbstractStage

handleEvent

public void handleEvent(java.lang.Object event)
                 throws java.lang.Exception
Specified by:
handleEvent in interface eu.xtreemos.system.eventmachine.queue.IEventHandler
Specified by:
handleEvent in class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
Throws:
java.lang.Exception

getHandledEventType

public java.lang.String getHandledEventType()
Specified by:
getHandledEventType in class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage