Package si.mazi.rescu
Classes in this package may be used to create proxy client objects for REST web services.
For a working example see the XChange project on github.
This is based on JAX-RS (javax.ws.rs -- only the JAX-RS annotations are used) and Proxy.
- Create a java interface that represents the API -- see BitStamp.java for an example
- Annotate the interface with JAX-RS annotations
- Call
RestProxyFactory.createProxy(Class, String)
Basic support is provided for Path, GET, POST,
DELETE, HEAD, OPTIONS, QueryParam,
FormParam, HeaderParam, PathParam.
Params.- See Also:
RestProxyFactory
-
Interface Summary Interface Description HttpResponseAware HttpStatusException Interceptor InvocationAware IRestProxyFactory ParamsDigest This may be used for REST APIs where some parameters' values must be digests of other parameters.RequestWriter Interface for serializing data sent to REST services (HTTP body).SynchronizedValueFactory<T> Allows services to accept a placeholder that is replaced with generated value just before message is serialized and sent. -
Class Summary Class Description AnnotationUtils BasicAuthCredentials ClientConfig FormUrlEncodedRequestWriter Writes the @FormParam annotated data as URL-encoded string.HmacPostBodyDigest This may be used as the value of a @HeaderParam, @QueryParam or @PathParam to create a digest of the post body (composed of @FormParam's).InvocationResult Result of a REST service invocation.LongValueFactory NullRequestWriter Params This class provides support for various types of HTTP params, especially in the context of RESTful web services, but may be also used to construct urls in other contexts.RequestWriterResolver Resolves which RequestWriter to use for REST requests.ResponseReader Interface for deserializing of REST returned data.ResponseReaderResolver Resolves which ResponseReader to use for REST responses.RestInvocation This holds name-value mapping for various types of params used in REST (QueryParam, PathParam, FormParam, HeaderParam).RestInvocationHandler RestMethodMetadata RestProxyFactory RestProxyFactoryImpl The default implementation ofIRestProxyFactorythat callsRestProxyFactoryUtils -
Enum Summary Enum Description ClientConfigUtil HttpMethod -
Exception Summary Exception Description AwareException ExceptionalReturnContentException Throw this exception (eg.HttpStatusExceptionSupport HttpStatusIOException