DIS-HLS-Client

From Gcube Wiki
Revision as of 10:44, 20 March 2007 by Andrea (Talk | contribs) (Implentation Overview)

Jump to: navigation, search

Introduction

The DIS-HLSClient is a Java library that allows to query the DIS in order to retrieve any information handled there (i.e. WS-ResourceProperties and DILIGENT resource profiles). The latest version of the library is composed by a set of Managers, one per each logical section of the information your service wants to query. By requesting the appropriate Manager (like the ones for DHNs data or the WS-ResourceProperties), it is possible to query the a subset of the information available with better performances than the previous versions. However, a generic Manager is also available to perform queries on the whole information available on the DIS. It is of course less efficient w.r.t. the specialized ones since, of course, it queries a bigger set of data.

Another thing to keep in mind when dealing with the DIS-HLSClient is the secure or non secure context. Each method of the library accepts two parameters (in addition to the others): a parameter instance of org.gridforum.jgss.ExtendedGSSCredential and a parameter instance of org.apache.axis.message.addressing.EndpointReferenceType. If a service is acting in a secure DL, then it has to pass to each method of the library the credentials it is actually using to contact other secure services. By analysing such credentials, the DIS-HLSClient is able to understand the DL in which the service is actually acting on and therefore appropriately filters the queries in order to retrieve only the information belonging to that DL. On the other hand, if a service is acting in a non secure DL, it has to pass its current EndPointReference from which the DIS-HLSClient understands the DL and, again, filters the queries by minding on the DL context.

Implentation Overview

The DISHLSClient is a static class that allows to instance a Manager for each type of DILIGENT resource. In addiction to the 11 DILIGENT resource Managers have been implemented a PropertiesManager, to query for WS-Resource Properties and a GeneralQueryManager that contains methods that apply to all type of Resource. Moreover a DISBrokerManager has been implemented: it contains method to contact the DIS-Broker instance for the VO and let the client subscribe to topics.

The Managers that have been implemented are :

  • CollectionManager
  • CSInstanceManager
  • CSManager
  • DHNManager
  • DISBrokerManager
  • ExternalRunningInstanceManager
  • GeneralQueryManager
  • GLiteManager
  • MetadataCollectionManager
  • PropertiesManager
  • RunningInstanceManager
  • ServiceManager
  • TransformationProgramManager


The Source Javadoc documentation can be found here [[1]]


DL context filtering

Usage Examples

ExtendedGSSCredential cred=null;
try {
       cred = ProxyUtil.loadProxyCredentials("certWithDLRoles");
} catch (IOException e) {
	e.printStackTrace();
} catch (GSSException e) {
	e.printStackTrace();
}
RunningInstanceManager riManager=null;
PropertiesManager pMan =null;
try {
	//null credential and null EPR
	riManager=DISHLSClient.getRunningInstanceManager(null, null);
        pMan= DISHLSClient.getPropertiesManager(cred, null);
} catch (DISHLSClientException e) {
       e.printStackTrace();
}
String test= null;
try {
       riManager.getEPRsRIFromClassAndName("InformationSystem", "DIS-Registry", "dililigentproject/informationservice/disregistry/DISRegistryFactoryService", null,null);
       test= pMan.getAllPublishedEntries(cred, null);
} catch (DISHLSClientException e) {
       e.printStackTrace();
} catch (DISHLSCredentialException e) {
       //community changed
       e.printStackTrace();
} 

How to adapt the existing xQuery to eXist 1.1

In the following examples are shown the necessary modifications to xQueries in order to make them compatible with eXist 1.1

  • the function text() is not supported:
  .../DILIGENTResource/UniqueID/text() eq 'id' ==> .../DILIGENTResource/UniqueID/string() eq 'id'
  
  • to keep an attribute value it must use the function string()
  .../Endpoint[@EntryName="*ENTRYNAME*"]  ==>  ../Endpoint[string(@EntryName) eq "*ENTRYNAME*"] 
 

--Andrea 14:08, 19 March 2007 (EET)