The Information Service

From VCGR Wiki

Jump to: navigation, search

This page describes what the Information Service does and how to use it

Introduction

The Information Service (IS), as it works now, is a polling service that stores information about BES containers. An XML document is stored for every BES container linked to the IS. This XML document contains the AttributesDocument of the BES container as well as its endpoint reference (EPR) and the time the document was created. The data is stored into an XML database – Oracle Berkeley DB XML, and is updated approximately every three seconds. A client can send XQuery queries to the XML database and get information about the BES containers whose data is being polled.


The environment

IS is one of the services provided by Genesis II. It extends the RNS implementation of Genesis II and inherits some of its functionality. The IS can be viewed as a directory and BES containers can be linked to it, unlinked, listed, etc. The methods performed by the IS are described in .xsd and .wsdl documents and SOAP messages are used for communication.


How to use the Information Service


1. Create a resource of the IS. For example:


create-resource --rns containers/BootstrapContainer/Services/InformationServicePortType /MyIS


here InformationServicePortType is the port type used to access the service. MyIS is the name of the Information Service resource


2. Link a container to the service.

ln /bes-containers/BootstrapContainer /MyIS/one


Here /bes-containers/BootstrapContainer is the path to the container we would like to link to the Information Service. one is the name we give to that container.

By linking a container to the Information Service we tell the service to start polling data about this container. Once we're done with the container and are no longer interested in its contents we can unlink it using the following command:


unlink /MyIS/one


3. Querying the Information Service Database

Now we can query the XML database on the documents we have there. There is a tool called xmldb-query which is used for that purpose. The tool takes two arguments: the first one is the XQuery query and the second one is the path to the Information Service instance we’d like to get information from. The simplest possible query looks like that:


xmldb-query "" /MyIS


What this query does is getting all the documents stored in the container for that information service. The result we will get back from this query will show us the AttributesDocument of the BootstrapContainer.