Module org.refcodes.rest
Package org.refcodes.rest
package org.refcodes.rest
With this artifact you easily create your serverless RESTful services and
REST clients. It lets you do it the Bare-Metal way or the syntactic sugar
(see HttpRestClientSugar
or HttpRestServerSugar)
way (being the use of statically imported methods).
Please refer to the refcodes-rest: RESTful services using lambdas documentation for an up-to-date and detailed description on the usage of this artifact.
-
ClassDescriptionAbstractHttpDiscoverySidecar<B extends HttpDiscoverySidecar<B>>Abstract class for easily decorating a
HttpRegistrySidecar
.AbstractHttpRegistryContextBuilder<DESC extends HttpServerDescriptor>The Class AbstractHttpRegistryContextBuilder.AbstractHttpRegistrySidecar<DESC extends HttpServerDescriptor,B extends HttpRegistrySidecar<DESC, B>> Abstract class for easily decorating aHttpRegistrySidecar
.Abstract base implementation of theRestfulClient
interface being the foundation for variousRestfulClient
implementations such asHttpRestClient
orLoopbackRestClient
.Abstract class for easily decorating aRestfulHttpClient
.Abstract class for easily decorating aRestfulHttpDiscoveryClient
.AbstractRestfulHttpRegistryServerDecorator<DESC extends HttpServerDescriptor,B extends RestfulHttpRegistryServer<DESC, B>> Abstract class for easily decorating aRestfulHttpRegistryServer
.Abstract class for easily decorating aRestfulHttpServer
.Implementation of the base functionality of theRestfulServer
interface omitting the HTTP handling part being the foundation for variousRestfulServer
implementations such asHttpRestServer
orLoopbackRestServer
.ABasicAuthEndpoint
subscribes to aRestfulServer
(RestfulHttpServer
) and defines the target for a Basic-Auth request.ABasicAuthEndpointBuilder
extends anBasicAuthEndpoint
with builder functionality and addslambda
support for handling the requests addressed to thisBasicAuthEndpoint
.TheCorrelationClientInterceptor
manages (adds) correlation IDs for request and session.TheCorrelationServerInterceptor
manages (adds) correlation IDs for request and session.Provides an accessor for a home path property.Provides a mutator for an home path property.Provides a mutator for a home path property.Provides a home path property.Mixin to register aRestRequestConsumer
upon "home" requests.Provides an accessor for a homeRestRequestConsumer
property.HomeRequestObserverAccessor.HomeRequestObserverBuilder<B extends HomeRequestObserverAccessor.HomeRequestObserverBuilder<B>>Provides a builder method for a homeRestRequestConsumer
property returning the builder for applying multiple build operations.Provides a mutator for a homeRestRequestConsumer
property.Provides a homeRestRequestConsumer
property.Provides an accessor for a homeUrl
property.HomeUrlAccessor.HomeUrlBuilder<B extends HomeUrlAccessor.HomeUrlBuilder<?>>Provides a mutator for an homeUrl
property.Provides a mutator for a homeUrl
property.Provides a homeUrl
property.HttpDiscovery<B extends HttpDiscovery<B>>TheHttpDiscovery
describes the functionality required in order to discover a service at a service discovery and discovery service.This context describes all information required to register a server ("service") at a service discovery registry.TheHttpDiscoveryContextBuilder
implements theHttpDiscoveryContext
with builder functionality as of the builder pattern.HttpDiscoverySidecar<B extends HttpDiscoverySidecar<B>>TheHttpDiscoverySidecar
describes the functionality required in order to discover a service at a service discovery and discovery service.Provides an accessor for a service discovery discoveryUrl
property.HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B extends HttpDiscoveryUrlAccessor.HttpDiscoveryUrlBuilder<B>>Provides a builder method for a service discovery discovery URL property returning the builder for applying multiple build operations.Provides a mutator for a service discovery discovery URL property.Provides a service discovery discovery URL property.A lambda "catch-all" for handling exceptions during HTTP-Request processing.Provides access to aHttpExceptionHandler
property.HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B extends HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>>Provides a builder method for aHttpExceptionHandler
property returning the builder for applying multiple build operations.Extends theHttpExceptionHandlerAccessor
with a setter method.Extends theHttpExceptionHandlerAccessor
with a setter method.Defines how errors affect the HTTP-Body whilst processing aHttpRequest
or aHttpResponse
along with the according sub-classes.Provides access to aHttpExceptionHandling
property.HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B extends HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>>Provides a builder method for aHttpExceptionHandling
property returning the builder for applying multiple build operations.Extends theHttpExceptionHandlingAccessor
with a setter method.Extends theHttpExceptionHandlingAccessor
with a setter method.TheHttpRegistry
describes the functionality required in order to register a service at a service registry and discovery service.HttpRegistryContext<DESC extends HttpServerDescriptor>This context describes all information required to register a server ("service") at a service discovery registry.TheHttpRegistryContext.HttpRegistryContextBuilder
interface extends theHttpRegistryContext
with builder functionality as of the builder pattern.TheHttpRegistrySidecar
describes the functionality required in order to register a service at a service registry and discovery service.Provides an accessor for a service registry registryUrl
property.HttpRegistryUrlAccessor.HttpRegistryUrlBuilder<B extends HttpRegistryUrlAccessor.HttpRegistryUrlBuilder<B>>Provides a builder method for a service registry registry URL property returning the builder for applying multiple build operations.Provides a mutator for a service registry registry URL property.Provides a service registry registry URL property.TheHttpRestClient
implements theRestfulHttpClient
interface.The singleton of theHttpRestClient
for easyRestfulHttpClient
access.Declarative syntactic sugar which may be statically imported in order to allow declarative definitions of REST client functionality:import static org.refcodes.rest.HttpRestClientSugar.*;
Implementation of theRestfulHttpServer
interface using theRestfulHttpServer
defined in thecom.sun.net.httpserver
package.The singleton of theHttpRestServer
for easyRestfulHttpServer
access.Declarative syntactic sugar which may be statically imported in order to allow declarative definitions of RESTful server functionality:import static org.refcodes.rest.HttpRestServerSugar
TheHttpServerDescriptor
describes a server to be registered at a discovery registry so clients can resolve the server's URL.HttpServerDescriptor.HttpServerDescriptorBuilder<B extends HttpServerDescriptor.HttpServerDescriptorBuilder<B>>TheHttpServerDescriptor.HttpServerDescriptorBuilder
interface extends theHttpServerDescriptor
interface with builder functionality as of the builder pattern.HttpServerDescriptorAccessor<DESC extends HttpServerDescriptor>Provides an accessor for aHttpServerDescriptor
property.HttpServerDescriptorAccessor.HttpServerDescriptorBuilder<DESC extends HttpServerDescriptor,B extends HttpServerDescriptorAccessor.HttpServerDescriptorBuilder<DESC, B>> Provides a builder method for aHttpServerDescriptor
property returning the builder for applying multiple build operations.Provides a mutator for aHttpServerDescriptor
property.Provides aHttpServerDescriptor
property.HttpServerDescriptorFactory<DESC extends HttpServerDescriptor>TheHttpServerDescriptorFactory
provides factory functionality for creatingHttpServerDescriptor
instances.Implements theRestfulClient
interface to be used as loopback device e.g. for testing purposes such as testing yourRestResponseConsumer
implementations.The singleton of theLoopbackRestClient
for easyLoopbackRestClient
access.Implements aRestfulServer
to be used as loopback device e.g. for testing purposes such as testing yourRestRequestConsumer
implementations.The singleton of theLoopbackRestServer
for easyRestfulServer
access.Self refreshing implementation of theOauthToken
.Provides an accessor for a ping path property.Provides a mutator for an ping path property.Provides a mutator for a ping path property.Provides a ping path property.Mixin to register aRestRequestConsumer
upon "ping" requests.Provides an accessor for a pingRestRequestConsumer
property.PingRequestObserverAccessor.PingRequestObserverBuilder<B extends PingRequestObserverAccessor.PingRequestObserverBuilder<B>>Provides a builder method for a pingRestRequestConsumer
property returning the builder for applying multiple build operations.Provides a mutator for a pingRestRequestConsumer
property.Provides a pingRestRequestConsumer
property.Provides an accessor for a pingUrl
property.PingUrlAccessor.PingUrlBuilder<B extends PingUrlAccessor.PingUrlBuilder<?>>Provides a mutator for an pingUrl
property.Provides a mutator for a pingUrl
property.Provides a pingUrl
property.Helper interface to keep the huge amount of convenience methods under control.Helper class to get the syntactic sugar (from a maintenance point of view) under control.AnRestEndpoint
subscribes to aRestfulServer
(RestfulHttpServer
) and defines the target for a REST request.AnRestEndpointBuilder
extends anRestEndpoint
with builder functionality and addslambda
support for handling the requests addressed to thisRestEndpoint
.A client to send requests for communicating with a RESTful server such as theRestfulHttpServer
.Extends aRestfulClient
to be capable of providing a User-Agent withUserAgentAccessor.UserAgentMutator.setUserAgent(String)
(RestfulHttpClient.withUserAgent(String)
) and to be capable of using base URLs to be set withBaseUrlAccessor.BaseUrlMutator.setBaseUrl(String)
(RestfulHttpClient.withBaseUrl(String)
).RestfulHttpDiscoveryClient<B extends RestfulHttpDiscoveryClient<B>>TheRestfulHttpDiscoveryClient
provides additional functionality for registering at and signing off from a service discovery service in order to resolve URLs to or from other services.RestfulHttpRegistryServer<DESC extends HttpServerDescriptor,B extends RestfulHttpRegistryServer<DESC, B>> TheRestfulHttpRegistryServer
provides additional functionality for registering at and signing off from a service discovery service in order to resolve URLs to or from other services.Extends aRestfulServer
to be capable of opening a server socket on the local host with the provided port number viaConnectionOpenable.open(Object)
or with an additional maximum number of connections viaRestfulHttpServer.open(int, int)
.TheRestfulServer
acts as the target for clients issuing REST requests.Helper interface to keep the huge amount of convenience methods under control.Helper class to get the syntactic sugar (from a maintenance point of view) under control.Helper interface to keep the huge amount of convenience methods under control.Helper class to get the syntactic sugar (from a maintenance point of view) under control.Helper interface to keep the huge amount of convenience methods under control.Helper class to get the syntactic sugar (from a maintenance point of view) under control.ARestRequest
describes a REST request and theRestResponse
providing the response.The implementation of theRestResponseHandler
interface as good old POJO for use by differentRestfulClient
implementations.Helper interface to keep the huge amount of convenience methods under control.Helper class to get the syntactic sugar (from a maintenance point of view) under control.TheRestRequestConsumer
can be coded using thelambda
syntax and processes a request for a given locator and for a givenHttpMethod
.Defines aRestRequestEvent
being the request as consumed by aRestEndpoint
.ARestRequestHandler
handles a REST request on theRestfulClient
instance's side to do the actual technical implementation of sending that request (or mocking the send-out of a request).Defines aRestResponse
being the base definition of a response as returned as of a request issued by aRestfulClient
(RestfulHttpClient
).TheRestResponseConsumer
can be coded using thelambda
syntax and processes a response from a server.Defines aRestResponseEvent
being the response as consumed by aRestResponseHandler
'sRestResponseConsumer
.ARestResponseHandler
describes a REST request and theRestResponseConsumer
in charge for handling a REST response.ARestResponseResult
handles a REST request asynchronously on theRestfulClient
instance's side to do the actual technical implementation of sending that request (or mocking the send-out of a request).Provides an accessor for a status path property.Provides a mutator for an status path property.Provides a mutator for a status path property.Provides a status path property.Mixin to register aRestRequestConsumer
upon "status" requests.Provides an accessor for a statusRestRequestConsumer
property.StatusRequestObserverAccessor.StatusRequestObserverBuilder<B extends StatusRequestObserverAccessor.StatusRequestObserverBuilder<B>>Provides a builder method for a statusRestRequestConsumer
property returning the builder for applying multiple build operations.Provides a mutator for a statusRestRequestConsumer
property.Provides a statusRestRequestConsumer
property.Provides an accessor for a statusUrl
property.Provides a mutator for an statusUrl
property.Provides a mutator for a statusUrl
property.Provides a statusUrl
property.