eu.xtreemos.xosd.srdsaccess.resmng
Interface IResourceDiscovery


public interface IResourceDiscovery

The interface that represents the access from Resource Manager to Distributed Directory Service (ADS/RSS, WP3.2). The class implementing this interface should have an access to the directory service engine either directly through API calls or by some other communication means. The query calls assume an asynchronous invocation. This means that the call to the implemented methods only sends the query, but the implemented methods should not block the thread execution. Instead, each method receives a listener (implemented by the caller) that the implemented class has to invoke to provide the result of the query back to the caller class. The listener class sent to the implementation of the interface is unique to the query call. It is the implemented class's responsibility to store the listener until the query returns the results, then pass the results by calling the listener. The listener provides two methods: the success notification and the failure notification. If the query succeeds, then the implementing class should call the success notification, providing the query result as its parameter. If the query fails, either because of erroneous entries of the query or an exception occurs during the execution, then the failure notification should be called, passing the caught or a new exception describing the failure as its parameter. Not that obtaining an empty result list is not a failure. For each query, only one of the two notifications should be called, and even that one only once.

Author:
matej.artac@xlab.si

Method Summary
 int registerResource(CommunicationAddress hostAddress)
          Requests that the host to be added to the directory service.
 int removeResource(CommunicationAddress hostAddress)
          Requests that the host is to be removed from the directory service, effectively no longer being discoverable.
 int resourceQuery(java.lang.String jsdlDocument, java.lang.String xacmlDocument, java.security.cert.X509Certificate userXOSDCert, IProcessCompletionListener listener)
          Invoke a resource disovery process.
 

Method Detail

resourceQuery

int resourceQuery(java.lang.String jsdlDocument,
                  java.lang.String xacmlDocument,
                  java.security.cert.X509Certificate userXOSDCert,
                  IProcessCompletionListener listener)
Invoke a resource disovery process. The query XML document contents in Strings and need to be parsed to be used. The query is two-fold, one contains the resource attribute requirements for the job, and the other one contains the policy rules that the discovery should take into account. The implementation of the method should start the query, but not actually wait for the response. It should instead pass the result using the listener.

Parameters:
jsdlDocument - The resource query, described by the JSDL document. The contents of the document are in a String.
xacmlDocument - The policy, described by the XACML document. The contents of the document are in a String.
userXOSDCert - The VO user's proxy certificate (XOSD-Cert). The certificate authenticates the user and also provides the attributes needed for policy interpretation.
listener -
Returns:

registerResource

int registerResource(CommunicationAddress hostAddress)
Requests that the host to be added to the directory service. The host address contains the IP of the resource and the port number that the AEM/DIXI is listening at, and, additionally, an IP of the NAT gateway for NAT traversal. Note that multiple DIXI frameworks can co-exist on the same machine, but use different IPs, even though the case is unusual. TODO: do we need a listener to notify us of the results?

Parameters:
hostAddress -
Returns:

removeResource

int removeResource(CommunicationAddress hostAddress)
Requests that the host is to be removed from the directory service, effectively no longer being discoverable. The host address contains the IP of the resource and the port number that the AEM/DIXI is listening at, and, additionally, an IP of the NAT gateway for NAT traversal. Note that multiple DIXI frameworks can co-exist on the same machine, but use different IPs, even though the case is unusual.

Parameters:
hostAddress -
Returns: