|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.enterprise.client.jaxrs.api.RestClient
public class RestClient
API for communicating with REST endpoints based on JAX-RS interfaces.
Constructor Summary | |
---|---|
RestClient()
|
Method Summary | ||
---|---|---|
static
|
create(Class<T> remoteService,
RemoteCallback<R> callback,
Integer... successCodes)
Creates a client/proxy for the provided JAX-RS resource interface. |
|
static
|
create(Class<T> remoteService,
RemoteCallback<R> callback,
RestErrorCallback errorCallback,
Integer... successCodes)
Creates a client/proxy for the provided JAX-RS resource interface. |
|
static
|
create(Class<T> remoteService,
String baseUrl,
RemoteCallback<R> callback,
Integer... successCodes)
Creates a client/proxy for the provided JAX-RS resource interface. |
|
static
|
create(Class<T> remoteService,
String baseUrl,
RemoteCallback<R> callback,
RestErrorCallback errorCallback,
Integer... successCodes)
Creates a client/proxy for the provided JAX-RS resource interface. |
|
static String |
getApplicationRoot()
Returns the configured JAX-RS default application root path. |
|
static boolean |
isJacksonMarshallingActive()
Checks if a jackson compatible JSON format should be used instead of Errai JSON. |
|
static void |
setApplicationRoot(String path)
Configures the JAX-RS default application root path. |
|
static void |
setJacksonMarshallingActive(boolean active)
Activates/Deactivates jackson conform JSON marshalling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestClient()
Method Detail |
---|
public static <T,R> T create(Class<T> remoteService, RemoteCallback<R> callback, Integer... successCodes)
remoteService
- the JAX-RS resource interface. Must not be null.callback
- the asynchronous callback to use. Must not be null.successCodes
- optional HTTP status codes used to determine whether the request was successful. If omitted, all 2xx
status codes are interpreted as success for this request.
public static <T,R> T create(Class<T> remoteService, String baseUrl, RemoteCallback<R> callback, Integer... successCodes)
remoteService
- the JAX-RS resource interface. Must not be null.baseUrl
- the base URL overriding the default application root pathcallback
- the asynchronous callback to use. Must not be null.successCodes
- optional HTTP status codes used to determine whether the request was successful. If omitted, all 2xx
status codes are interpreted as success for this request.
public static <T,R> T create(Class<T> remoteService, RemoteCallback<R> callback, RestErrorCallback errorCallback, Integer... successCodes)
remoteService
- the JAX-RS resource interface. Must not be null.callback
- the asynchronous callback to use. Must not be null.errorCallback
- the error callback to usesuccessCodes
- optional HTTP status codes used to determine whether the request was successful. If omitted, all 2xx
status codes are interpreted as success for this request.
public static <T,R> T create(Class<T> remoteService, String baseUrl, RemoteCallback<R> callback, RestErrorCallback errorCallback, Integer... successCodes)
remoteService
- the JAX-RS resource interface. Must not be null.baseUrl
- the base URL overriding the default application root pathcallback
- the asynchronous callback to use. Must not be null.errorCallback
- the error callback to usesuccessCodes
- optional HTTP status codes used to determine whether the request was successful. If omitted, all 2xx
status codes are interpreted as success for this request.
public static String getApplicationRoot()
public static void setApplicationRoot(String path)
path
- path to use when sending requests to the JAX-RS endpointpublic static boolean isJacksonMarshallingActive()
public static void setJacksonMarshallingActive(boolean active)
active
- true if jackson marshalling should be activated, otherwise false.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |