DIS-IC

From Gcube Wiki
Jump to: navigation, search


Introduction

The DILIGENT Information Collector (DIS-IC) is the service in charge to collect WS-ResourceProperties (including the Resource Profiles from the DIS-Registry) registered via the DIS-IP and to make them available to be queried by the DIS-HLSClient.

Implementation overview

It is implemented as an aggregator service, able to create Aggregator Sinks that query remote Aggregator Sources (in particular QueryAggregatorSources, as those created by the DIS-IP) to harvest resource properties. Then, the collected information is stored in an embedded instance of an eXist XML database . This allows to persist the information as well as to build on top of eXist query APIs, the DIS-IC query interface, based on the XQuery query language . From an architectural point of view, four WSRF Services (DISICRegistrationService, DISICRegistrationServiceEntry, DISICFactoryService and DISICService) which globally implement the Aggregator Sink functionalities (including those related to the storage, indexing, and management of resource information) compose the DIS-IC. The DISICService also exposes the public interface to query and/or delete the stored information.

XML database organization

The eXist database supports the XML:DB Initiative API and therefore the information is organized in Collections as requested by this Initiative. The following hierarchy of Collections is automatically created at the first start up by the DIS-IC:

db (root collection)
|
|-Properties
|
|-Profiles
       |
       |-RunningInstance
       |-DHN
       |-Service
       |-ExternalRunningInstance
       |-CS
       |-CSInstance
       |-Collection
       |-MetadataCollection 
       |-gLiteResource
       |-GenericResource
       |-TransformationProgram

Document structure

In a XML database, usually, there is no need to fix a particular schema for documents to store. However, in the DIS-IC case, a set of “metadata elements” are added to the resource properties documents harvested from the Aggregator Sources to characterize and manage such information. The following document structure has been adopted:

<Document>
	<ID>internal document identifier</ID>
	<Source>EPR of the RI that publishes this document</Source>
	<EntryKey>Entry key of the ServiceGroupEntry</EntryKey>
	<GroupKey>Group key of the ServiceGroupEntry</GroupKey>
	<TerminationTime>expiration date from the epoch 	</TerminationTime>
	<TerminationTimeHuman>human readable version 	</TerminationTimeHuman>
	<LastUpdateMs>last update time from the epoch </LastUpdateMs>
	<LastUpdateHuman>human readable version</LastUpdateHuman>
	<Data>
 		(the list of ws-resourceproperties
 			or
 		the profile)
 		 +
 		 DILIGENT PROVIDER properties
	</Data>
</Document>

XQuery

The above information, i.e. the organization of Collections and the structure of the documents stored, are the basic knowledge needed to create queries in the XQuery language able to retrieve information from the DIS-IC. The most common queries are provided by the DIS-HLSClient – thus DILIGENT services can query the DIS-IC using the methods exposed by this library (see ...) without dealing with the XQuery language. However, these methods do not cover all the needs. Therefore, it is always possible to directly send an XQuery query to the eXist database instance embedded in the DIS-IC using the queryDISIC() operation of the DIS-HLSClient (see ...).

Dependencies

  • jdk 1.5
  • Java WS Core 4.0.4
  • MDS 4.0.4
  • eXist 1.1

Usage Example

The DIS-IC should not be directly accessed with its stubs by other services. Two high level Libraries have been developed to manage the publishing phase (DIS-IP) and the query operations (DIS-HLSClient).

Operation executeXQuery

This operation executes the given XQuery on the embedded database instance of eXist. The result of the query is returned in the following format:

<Resultset> 
	<Record> .... </Record> 
	<Record> .... </Record> 
</Resultset> 

where the "...." are the content identified by the expression specified in the return statement of the given XQuery. A query takes into account the Collections hierarchy and the Document structure explained in the previous sections. Examples:

  • the following query retrieves all the Service profiles whose class is 'CSD':
for $doc in collection("/db/Profiles/Service")//Document/Data/child::*[local-name()='Profile']/DILIGENTResource/Profile 
where $doc/Class/text() eq 'CSD' 
return $doc
  • the following query retrieves all the resource properties documents published by the all the WS-Resource of the BatchUpdaterService hosted on dili02.osl.fast.no:8080:
for $r in (collection("/db/Properties"))//Document/Source where $r/text() eq 
'http://dili02.osl.fast.no:8080/wsrf/services/org/diligent/BatchUpdaterService' 
return $r/ancestor::Document/Data

--Manuele Simi 17:43, 29 May 2007 (EET)