Package org.gcube.common.gxrest.request
Class GXWebTargetAdapterRequest
java.lang.Object
org.gcube.common.gxrest.request.GXWebTargetAdapterRequest
- All Implemented Interfaces:
org.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse>
public class GXWebTargetAdapterRequest
extends Object
implements org.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse>
A GX request based on JAX-RS. It requires a runtime implementation of JAX-RS
on the classpath (e.g. Jersey) to work.
- Author:
- Manuele Simi (ISTI CNR), Luca Frosini (ISTI-CNR)
-
Method Summary
Modifier and TypeMethodDescriptionconfigProperty(String name, String value) Sets a new property in the request.connect()delete()Sets the identity user agent associated to the request.get()head()Add an arbitrary header.static GXWebTargetAdapterRequestnewHTTPSRequest(String address) Creates a new request.static GXWebTargetAdapterRequestnewHTTPSRequest(String address, String tslprotocol) Creates a new secure request.static GXWebTargetAdapterRequestnewRequest(String address) Creates a new request.options()patch()patch(jakarta.ws.rs.client.Entity<?> body) Adds a positional path parameter to the request.post()post(jakarta.ws.rs.client.Entity<?> body) purge()put()put(jakarta.ws.rs.client.Entity<?> body) queryParams(Map<String, Object[]> parameters) Sets the query parameters for the request.Registers a class of a custom JAX-RS component (such as an extension provider or afeaturemeta-provider) to be instantiated and used in the scope of this request.Registers an instance of a custom JAX-RS component (such as an extension provider or afeaturemeta-provider) to be instantiated and used in the scope of this request.setAcceptedResponseType(jakarta.ws.rs.core.MediaType... acceptedResponseTypes) Defines the accepted response media types.trace()
-
Method Details
-
newRequest
Creates a new request.- Parameters:
address- the address of the web app to call- Returns:
- the request
-
newHTTPSRequest
Creates a new secure request.- Parameters:
address- the address of the web app to calltslprotocol- the secure socket protocol to use in the call- Returns:
- the request
-
newHTTPSRequest
Creates a new request.- Parameters:
address- the address of the web app to call- Returns:
- the request
-
from
Sets the identity user agent associated to the request.- Parameters:
agent- the agent- Returns:
- the request
-
configProperty
Sets a new property in the request.- Parameters:
name- the name of the propertyvalue- the value of the property- Returns:
- the request
-
register
Registers an instance of a custom JAX-RS component (such as an extension provider or afeaturemeta-provider) to be instantiated and used in the scope of this request.- Parameters:
component- the component to register- Returns:
- the request
-
register
Registers a class of a custom JAX-RS component (such as an extension provider or afeaturemeta-provider) to be instantiated and used in the scope of this request.- Parameters:
component- the class of the component to register- Returns:
- the request
-
path
Adds a positional path parameter to the request.- Parameters:
path- the new token in the path- Returns:
- the request
- Throws:
UnsupportedEncodingException- if the encoding is not supported
-
queryParams
public GXWebTargetAdapterRequest queryParams(Map<String, Object[]> parameters) throws UnsupportedEncodingExceptionSets the query parameters for the request.- Parameters:
parameters- the parameters that go in the URL after the address and the path params.- Returns:
- the request
- Throws:
UnsupportedEncodingException- if the encoding is not supported
-
setAcceptedResponseType
public GXWebTargetAdapterRequest setAcceptedResponseType(jakarta.ws.rs.core.MediaType... acceptedResponseTypes) Defines the accepted response media types.- Parameters:
acceptedResponseTypes- accepted response media types.- Returns:
- builder for a request targeted at the URI referenced by this target instance.
-
delete
- Specified by:
deletein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
purge
- Specified by:
purgein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
head
- Specified by:
headin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
get
- Specified by:
getin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
header
Add an arbitrary header.- Parameters:
name- the name of the headervalue- the value of the header- Returns:
- the builder
-
put
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
put
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
post
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
post
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
patch
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
patch
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
trace
- Specified by:
tracein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
options
- Specified by:
optionsin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-
connect
- Specified by:
connectin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<jakarta.ws.rs.client.Entity<?>,GXInboundResponse> - Throws:
Exception
-