DIS-HLS-Client
Contents
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. The use of the EndpointReferenceType to check the Running Instance DL context, can be done only if the Running Instance is acting in only one DL.
These page show how to provide credentials to your service. Provide_your_service_with_credentials
In case of Credentials that contains roles related to a DL, a filter over the DILIGENT Resources and WS-Resource Properties queries is applied. This means checks if the DL the service is acting is contained inside the AuthorizationPolicies element of a Profile or a DLs WS-Resource-Properties ( added by the DILIGENTProvider) of a WS-Resource. The Filter over DL context is not applied queryng for a Service Profile ( that is not related to a particular DL).
An xQuery parsers has also been implemented to set automatically filters to Custom xQuery ( Queries created by developers ).
Usage Examples
In order to test DIS-HLS-Client without credentials and EPR, it'possible to create a manager with null parameters. By default the query will be sent to the diligent VO ( the DIS-IC deployed for it) without DL restrictions.
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)