Difference between revisions of "Resource Registry Service - Query & Access"
Luca.frosini (Talk | contribs) |
Luca.frosini (Talk | contribs) |
||
Line 8: | Line 8: | ||
Please note that the provided examples can intentionally hide some details in the response to avoid unneeded complexity. | Please note that the provided examples can intentionally hide some details in the response to avoid unneeded complexity. | ||
− | |||
Apart the REST API this port type can be used also by using [[Information System Resource Registry#Resource_Registry_Client | Resource Registry Client]] java client. | Apart the REST API this port type can be used also by using [[Information System Resource Registry#Resource_Registry_Client | Resource Registry Client]] java client. | ||
− | |||
[[Information System Resource Registry#Resource_Registry_Client | Resource Registry Client]] has the following maven coordinates | [[Information System Resource Registry#Resource_Registry_Client | Resource Registry Client]] has the following maven coordinates | ||
Line 31: | Line 29: | ||
ResourceRegistryClient resourceRegistryClient = ResourceRegistryClientFactory.create(); | ResourceRegistryClient resourceRegistryClient = ResourceRegistryClientFactory.create(); | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
=== Exists === | === Exists === |
Revision as of 10:56, 9 November 2017
This sections provide information regarding how to interact with Resource Registry Service for Query and Access. REST and JAVA API are presented for each functionality.
Please note that the provided examples can intentionally hide some details in the response to avoid unneeded complexity.
Apart the REST API this port type can be used also by using Resource Registry Client java client.
Resource Registry Client has the following maven coordinates
<dependency> <groupId>org.gcube.information-system</groupId> <artifactId>resource-registry-client</artifactId> <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> </dependency>
To use the client you need first get a ResourceRegistryClient instance.
By using ResourceRegistryClientFactory.create() method the library discover the correct endpoint to interact with the Resource Registry for the current context.
SecurityTokenProvider.instance.set("Your-NextNext-Token-Here"); //If not already set ResourceRegistryClient resourceRegistryClient = ResourceRegistryClientFactory.create();
Exists
HEAD /resource-registry/access/instance/{ER-Type}/{INSTANCE UUID}
Example
HEAD /resource-registry/access/instance/ContactFacet/4d28077b-566d-4132-b073-f4edaf61dcb9
Get Instance
GET /resource-registry/access/instance/{ER-Type}/{INSTANCE UUID}
Example
GET /resource-registry/access/instance/ContactFacet/4d28077b-566d-4132-b073-f4edaf61dcb9
Get All Instances of a Specific Type
GET /resource-registry/access/instances/{ER-Type}?[polymorphic=(true|false)][&reference={INSTANCE UUID}][&direction=(in|out|both)]
Default:
* polymorphic : false * direction : both
direction has sense only if reference UUID is provided, is ignored otherwise.
GET /resource-registry/access/instances/EService?polymorphic=true
GET /resource-registry/access/instances/EService?polymorphic=true&reference=4d28077b-566d-4132-b073-f4edaf61dcb9&direction=(in|out|both)
Raw Query
GET /resource-registry/access?query=SELECT FROM Facet