Difference between revisions of "DIS-HLS-Client"

From Gcube Wiki
Jump to: navigation, search
(Implentation Overview)
(DL context filtering)
Line 30: Line 30:
  
  
=== DL context filtering ===
+
=== VO selection and DL context filtering ===
 +
 
 +
All DISHLSClient Query Managers has to be created a parameter instance of org.gridforum.jgss.ExtendedGSSCredential and a parameter instance of org.apache.axis.message.addressing.EndpointReferenceType. At Query Manager creation time, the ExtendedGSSCredential object is checked and using Authorization API the current VO and DL are extracted:
 +
 
 +
*  the VO is used to select the right VOMap to use (that contains the addresses of the DIS-IC instances to contact)
 +
 
 +
*  the DL is used to filter queries towards DILIGENT Profiles and WS-Resources. 
 +
 
 +
If the ExtendedGSSCredential object passed at Manager creation time is null, the EndpointReferenceType instance is checked to extract VO and DL information. This
  
 
=== Usage Examples ===
 
=== Usage Examples ===

Revision as of 11:10, 20 March 2007

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]]


VO selection and DL context filtering

All DISHLSClient Query Managers has to be created a parameter instance of org.gridforum.jgss.ExtendedGSSCredential and a parameter instance of org.apache.axis.message.addressing.EndpointReferenceType. At Query Manager creation time, the ExtendedGSSCredential object is checked and using Authorization API the current VO and DL are extracted:

  • the VO is used to select the right VOMap to use (that contains the addresses of the DIS-IC instances to contact)
  • the DL is used to filter queries towards DILIGENT Profiles and WS-Resources.

If the ExtendedGSSCredential object passed at Manager creation time is null, the EndpointReferenceType instance is checked to extract VO and DL information. This

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)