Difference between revisions of "GxRest"

From Gcube Wiki
Jump to: navigation, search
(Distribution)
Line 1: Line 1:
The gCube eXtensions to the Rest Protocol library (gxRest) provides a convenient round-trip interaction between a Restful web application and its client. The approach is completely independent from the web framework used to develop the web application, being entirely based on the <code lang="Java">javax.ws.rs</code> package.
+
The gCube eXtensions to the Rest Protocol library (gxRest) provides a convenient round-trip interaction between a Restful web application and its client. The approach is completely independent from the JAX-RS implementation used to develop the web application, being entirely based on the <code lang="Java">javax.ws.rs</code> package.
 
   
 
   
 
The library is consistently divided in:
 
The library is consistently divided in:
* context-aware requests sent from a client to a web application
+
* context-aware [[GxRest/Requests | requests]] sent from a client to a web application
 
* outbound status-aware [[GxRest/Responses#Outbound_Responses | responses]] returned from a web application
 
* outbound status-aware [[GxRest/Responses#Outbound_Responses | responses]] returned from a web application
 
* inbound [[GxRest/Responses#Inbound_Responses | responses]] received by a client.
 
* inbound [[GxRest/Responses#Inbound_Responses | responses]] received by a client.
  
 
Besides achieving independence over the web framework, the prominent features of the library are:
 
Besides achieving independence over the web framework, the prominent features of the library are:
* to abstract of the HTTP-based details required by the gCube framework when invoking a remote service
+
* to guarantee the correctness of requests/responses across the D4Science infrastructure;
 +
* to abstract over the HTTP-based details required by the gCube framework when invoking a remote service;
 
* to return error responses at the familiar (for any Java programmer) level of exceptions and error codes, while web frameworks usually just let return an HTTP status.
 
* to return error responses at the familiar (for any Java programmer) level of exceptions and error codes, while web frameworks usually just let return an HTTP status.
  

Revision as of 03:37, 24 April 2018

The gCube eXtensions to the Rest Protocol library (gxRest) provides a convenient round-trip interaction between a Restful web application and its client. The approach is completely independent from the JAX-RS implementation used to develop the web application, being entirely based on the javax.ws.rs package.

The library is consistently divided in:

  • context-aware requests sent from a client to a web application
  • outbound status-aware responses returned from a web application
  • inbound responses received by a client.

Besides achieving independence over the web framework, the prominent features of the library are:

  • to guarantee the correctness of requests/responses across the D4Science infrastructure;
  • to abstract over the HTTP-based details required by the gCube framework when invoking a remote service;
  • to return error responses at the familiar (for any Java programmer) level of exceptions and error codes, while web frameworks usually just let return an HTTP status.

Distribution

gxRest is available as Maven artifact and can be added to a project with the following coordinates:

<dependency>
	<groupId>org.gcube.common</groupId>
	<artifactId>gxRest</artifactId>
	<version>0.0.2-SNAPSHOT</version>
</dependency>