Ic-client

From Gcube Wiki
Revision as of 11:53, 23 November 2012 by Fabio.simeoni (Talk | contribs) (Created page with '<code>ic-client</code> is a client library for the <code>Information Collector</code> service. It helps clients formulating queries for gCube resource descriptions, submitting th…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ic-client is a client library for the Information Collector service. It helps clients formulating queries for gCube resource descriptions, submitting them to the service, and processing their results. Similar facilities for resource discovery are traditionally provided by the gCube Application Framework (gCF) and the IS Client library. ic-client improves over the latter in a number of ways, most noticeably:

  • it is completely independent from the gCore stack.
ic-client can be easily embedded in a variety of client runtimes without out-of-band installation or configuration requirements. Clients may be external to gCube, or they may be 2nd-generation gCube services developed and running on stacks other than gCore stack. In this sense, ic-client is a key part of the Featherweight Stack for gCube clients.
  • it helps formulating a wider range of queries based only on knowledge of resource schemas.
simple queries can be configured with custom namespaces and custom result expressions. As a result, clients can retrieve only parts of resource descriptions or arbitrary combinations of parts. Fine-grained results are more easily processed and improve the performance of both clients and service.
  • it offers increased flexibility in how query results are processed.
clients can configure how results ought to be parsed, or else take direct responsibility for parsing them. For example, clients may configure their own JAXB object bindings, while preprepared bindings for whole resource descriptions or specific properties thereof are readily available.

ic-client is available in our Maven repositories with the following coordinates:

<artifactId>ic-client</artifactId>
<groupId>org.gcube.resources.discovery</groupId>
<version>...</version>

The library depends on a small set of components of the Featherweight Stack. Among these, the following are visible to library clients:

  • common-gcore-resources: the object-based implementation of the gCube resource model.
clients may and normally will use the classes in common-gcore-resources to parse and process query results.
  • discovery-client: a layer of interfaces and abstract implementations for queries and query submission API.
ic- client customises this layer for queries to the Information Collector.

Note: in what follows, we blur the distinction from ic- client and discovery-client, which reflects modular choices for the design of the library but is otherwise of little consequence for its clients. The visibility of discovery-client is limited only to the package of certain components discussed below, which starts with org.gcube.resource.discovery.client when the components belong to discovery-client and with org.gcube.discovery.icclient when they belong to ic-client.

First Examples

Queries

Query Submission