Package org.refcodes.web
HttpStatusCode
or exceptions representing erroneous
HTTP state, or if you are tired of cookie handling, Header-Field processing
... and so on:
This artifact provides various types such as Cookie
,
FormFields
, HeaderFields
or
HttpMethod
, which enable you to use such HTTP based
structures in a native Java way while having a tool at hand to bridge back
into the HTTP protocol world. HTTP related error codes are provided as
exception types such as NotFoundException
(404) or
`InternalServerErrorException` (500).
Please note that the HttpBodyMap
is most useful when
you have to handle dynamic data structures. The
HttpBodyMap
type is a "dynamic" type in terms of
it's structure being represented by paths'. When a data structure is parsed
e.g. from JSON or XML, then the data structure's internal structure and
values are reflected by according paths's and values in the
HttpBodyMap
. The
HttpBodyMap
is a kind of flat (no nested maps)
representation of the according (nested) data structures. Implementations of
the HttpClientRequest
,
HttpClientResponse
,
HttpServerRequest
as well as
HttpServerResponse
types support the
HttpBodyMap
.
As another example, the BasicAuthCredentials
make it
ease to parse or create Basic-Auth Header-Fields.
Other interesting types and classes to mention are the
Port
enumeration, defining quite a few default
ports or the MediaTypeFactory
interface, which's
implementations make marshaling and unmarshaling of your types from and to
JSON, XML (and so on) an easy task.
Predefined MIME-Types are bundled in the MediaType
enumeration, as of the information provided by the
[`IANA`](http://www.iana.org/assignments/media-types/media-types.xhtml),
effective in October 2016.
See the [Javadoc](https://www.javadoc.io/doc/org.refcodes/refcodes-web) for a full overview on this artifact.
-
ClassDescriptionAbstract implementation of the
HeaderFields
type.AbstractHttpFields<T extends HttpFields<T>>Abstract implementation of theHeaderFields
type.Implementation of theHttpRequest
interface.Implementation of theHttpResponse
interface.The Enum AuthType.Provides an accessor for aAuthType
property.Provides a builder method for aAuthType
property returning the builder for applying multiple build operations.Provides a mutator for aAuthType
property.Provides aAuthType
property.The Interface AuthTypeCredentials.The Class BadGatewayException.The Class BadGatewayRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).The Class BadRequestException.The Class BadRequestRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Provides an accessor for a base locator property.Provides a builder method for a base locator property returning the builder for applying multiple build operations.Provides a mutator for a base locator property.Provides a base locator property.Provides an accessor for a base URL (protocol, host, port, locator) property.BaseUrlAccessor.BaseUrlBuilder<B extends BaseUrlAccessor.BaseUrlBuilder<B>>Provides a builder method for a base URL (protocol, host, port, path) property returning the builder for applying multiple build operations.Provides a mutator for a base URL (protocol, host, port, locator) property.Provides a base URL (protocol, host, port, path) property.TheBasicAuthCredentials
defines a type for representing a Basic-Authentication credentials Header-Field.Provides an accessor for aBasicAuthCredentials
property.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B extends BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>>Provides a builder method for aBasicAuthCredentials
property returning the builder for applying multiple build operations.Provides a mutator for aBasicAuthCredentials
property.Provides aBasicAuthCredentials
property.TheBasicAuthCredentialsBuilder
compares the secret (BasicAuthCredentials.getSecret()
) case sensitive but the username (BasicAuthCredentials.getIdentity()
) case insensitive within theBasicAuthCredentials.equals(Object)
method.Thrown in case HTTP basic authorization failed, e.g. verifyingBasicAuthCredentials
failed.Thrown in case HTTP basic authorization failed, e.g. verifyingBasicAuthCredentials
failed.BasicAuthObservable<B extends BasicAuthObservable<B>>An observable which notifies the registeredBasicAuthObserver
on incoming HTTP Basic-Authentication requests.An observer being notified by incoming HTTP Basic-Authentication requests which might have been registered viaBasicAuthObservable.onBasicAuthRequest(BasicAuthObserver)
possibly using lambda syntax.Defines aBasicAuthRequest
describes a Baisc-Auth request as of HTTP.Thrown in case HTTP basic authorization is required but no requiredHeaderField.WWW_AUTHENTICATE
data was found, e.g.Thrown in case HTTP basic authorization is required but no requiredHeaderField.WWW_AUTHENTICATE
data was found, e.g.The enumeration for a Basic-Auth response.TheBasicCredentials
describes the attributes required by a Basic-Auth authentication over HTTP(S).TheBearerAuthCredentials
defines a type for representing a Bearer-Authentication credentials Header-Field.Provides an accessor for aBearerAuthCredentials
property.BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B extends BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B>>Provides a builder method for aBearerAuthCredentials
property returning the builder for applying multiple build operations.Provides a mutator for aBearerAuthCredentials
property.Provides aBearerAuthCredentials
property.The Class ConflictException.The Class ConflictRuntimeException.ContentEncoding
s are specified an an HTTP Header-FieldsHeaderField.ACCEPT_ENCODING
orHeaderField.CONTENT_ENCODING
and how to encode a HTTP body or how a HTTP body is encoded.AContentType
represents aMediaType
and its accordingTopLevelType
with additional (optional) suffixed parameters (as of the according HTTP Header-Fields).Provides an accessor for a Content-Type property.Provides a builder method for a Content-Type property returning the builder for applying multiple build operations.Provides a mutator for a Content-Type property.Provides a Content-Type property.A provider interface provides a "toSomething(?)"TheCookie
represents a HTTP cookie.The Enum CookieAttribute.The Class ExpectationFailedException.The Class ExpectationFailedRuntimeException.The Class FailedDependencyException.The Class FailedDependencyRuntimeException.The Class ForbiddenException.The Class ForbiddenRuntimeException.TheFormFields
represent the URL's Query-String by the notation originally used by the GET request of the ancient web forms (see "https://en.wikipedia.org/wiki/Query_string#Web_forms").Provides an accessor for a request Form-Fields property.Provides a mutator for a request Form-Fields property.Provides a mutator for a request Form-Fields property.Provides a request Form-Fields property.Implements theMediaTypeFactory
for Media-Type "application/x-www-form-urlencoded" (MediaType.APPLICATION_X_WWW_FORM_URLENCODED
).Provides an accessor for a fragment property.Provides a mutator for an fragment property.Provides a mutator for a fragment property.Provides a fragment property.The Class GatewayTimeoutException.The Class GatewayTimeoutRuntimeException.The Class GoneException.The Class GoneRuntimeException.TheGrantType
enumerations.The Enum HeaderField.Provides an accessor for aHeaderField
property.Provides a builder method for aHeaderField
property returning the builder for applying multiple build operations.Provides a mutator for aHeaderField
property.Provides aHeaderField
property.TheHeaderFields
reflect the structure of a HTTP header and may be used to represent a HTTP header.Provides an accessor for an Header-Fields property.HeaderFieldsAccessor.HeaderFieldsBuilder<T extends HeaderFields<?,?>, B extends HeaderFieldsAccessor.HeaderFieldsBuilder<T, B>> Provides a mutator for an Header-Fields property.Provides a mutator for an Header-Fields property.Provides an Header-Fields property.Provides an accessor for a host property.HostAccessor.HostBuilder<B extends HostAccessor.HostBuilder<?>>Provides a mutator for an host property.Provides a mutator for a host property.Provides a host property.Implements theMediaTypeFactory
for Media-Type "application/YAML" (MediaType.APPLICATION_YAML
).Provides an accessor for a HTTP body property.Provides a builder body for a HTTP body property returning the builder for applying multiple build operations.Provides a mutator for a HTTP body property.Provides a HTTP body property.HttpBodyAccessor.HttpBodyProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"TheHttpBodyMap
type is a "dynamic" type in terms of it's structure being represented by paths'.This context describes all information required to open a client (HTTP or HTTPS).TheHttpClientContextBuilder
implements theHttpClientContextBuilder
interface.TheHttpClientInterceptable
provides base functionality for working withHttpClientInterceptor
instances using thePreHttpClientInterceptable
as well as thePostHttpClientInterceptable
definitions.AnHttpClientInterceptor
definition for pre- as well as post-processingHttpClientRequest
as well asHttpClientResponse
instances.Defines aHttpClientRequest
being the request as produced by the client.Defines aHttpClientResponse
being the response as consumed by the client.Base exception HTTP related problems.HttpFields<B extends HttpFields<B>>Various key/value "collections" we run across when we develop HTTP based applications may have more then one value for one key.Provides an accessor for a HTTPInputStream
body property.HttpInputStreamAccessor.HttpInputStreamBuilder<B extends HttpInputStreamAccessor.HttpInputStreamBuilder<B>>Provides a builder body for a HTTPInputStream
property returning the builder for applying multiple build operations.Provides a mutator for aInputStream
property.Provides a HTTPInputStream
property.HttpInputStreamAccessor.HttpInputStreamProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"TheHttpInterceptable
provides base functionality for working withHttpInterceptor
instances using thePreHttpInterceptable
as well as thePostHttpInterceptable
definitions.AnHttpInterceptor
definition for pre- as well as post-processingHttpRequest
as well asHttpResponse
instances.TheHttpMediaType
converts an implementing instance's state into an HTTP media type as used in HTTP Header-Fields.Provides an accessor for a HTTP Media-Type property.Provides a builder body for a HTTP Media-Type property returning the builder for applying multiple build operations.Provides a mutator for a HTTP Media-Type property.Provides a HTTP Media-Type property.HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"The Enum HttpMethod.Provides an accessor for a HTTP-Method property.Provides a builder method for a HTTP-Method property returning the builder for applying multiple build operations.Provides a mutator for a HTTP-Method property.Provides a HTTP-Method property.Defines a HTTP-Request, being theHttpMethod
, the Header-Fields and the locator representing, though without the request body.HttpRequestBuilder<B extends HttpRequestBuilder<B>>The Interface HttpRequestBuilder.Defines aHttpResponse
being the response Header-Fields and the response body.The Interface HttpResponseBuilder.Thrown by a HTTP-Response handling system in case of some unexpected response.Thrown by a HTTP-Response handling system in case of some unexpected response.The Class HttpRuntimeException.An observable which notifies the registeredHttpsConnectionRequestObserver
on incoming HTTPS requests.An observer being notified by incoming HTTPS requests which might have been registered viaHttpsConnectionRequestObservable.onConnectionRequest(HttpsConnectionRequestObserver)
possibly using lambda syntax.This context describes all information required to open a server (HTTP or HTTPS) and bind a port.TheHttpServerContextBuilder
implements theHttpServerContext
interface extending it with builder functionality..TheHttpServerInterceptable
provides base functionality for working withHttpServerInterceptor
instances using thePreHttpServerInterceptable
as well as thePostHttpServerInterceptable
definitions.AnHttpServerInterceptor
definition for pre- as well as post-processingHttpServerRequest
as well asHttpServerResponse
instances.Defines aHttpServerRequest
being the request as consumed by the server.Defines aHttpServerResponse
as produced by the server.The org.apache.commons.httpclient.HttpStatus constants as enumeration.Provides access to a HTTP Status-Code property including all known HTTP HTTP Status-Codes (success as well as error codes) as ofHttpStatusCode
.HttpStatusCodeAccessor.HttpStatusCodeBuilder<B extends HttpStatusCodeAccessor.HttpStatusCodeBuilder<B>>Provides a builder method for a HTTP Status-Code property returning the builder for applying multiple build operations.Extends theHttpStatusCodeAccessor
with a setter method.Extends theHttpStatusCodeAccessor
with a setter method.Base HTTP exception, thrown in case of HTTP status code related exceptions (e.g. as of a HTTP response was of an erroneous status).The ClassHttpStatusRuntimeException
.Only the Success 2xx codes as of (from) theHttpStatusCode
enumeration.Provides access to a HTTP success code property including just the 2xx HTTP success codes as ofHttpSuccessCode
excluding all HTTP error codes.HttpSuccessCodeAccessor.HttpSuccessCodeBuilder<B extends HttpSuccessCodeAccessor.HttpSuccessCodeBuilder<B>>Provides a builder method for a HTTP success code property returning the builder for applying multiple build operations.Extends theHttpSuccessCodeAccessor
with a setter method.Extends theHttpSuccessCodeAccessor
with a setter method.The Class HttpVersionNotSupportedException.The Class HttpVersionNotSupportedRuntimeException.The Class InsufficientSpaceOnResourceException.The Class InsufficientSpaceOnResourceRuntimeException.The Class InsufficientStorageException.The Class InsufficientStorageRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).The Class InternalServerErrorException.The Class InternalServerErrorRuntimeException.Implements theMediaTypeFactory
for Media-Type "application/json" (MediaType.APPLICATION_JSON
).The Class LengthRequiredException.The Class LengthRequiredRuntimeException.Some simple load balancing strategies.Provides access to a load balancing strategy property as ofLoadBalancingStrategy
.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B extends LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>>Provides a builder method for a load balancing strategy property returning the builder for applying multiple build operations.Extends theLoadBalancingStrategyAccessor
with a setter method.Extends theLoadBalancingStrategyAccessor
with a setter method.Provides an accessor for a local address property.Provides a builder method for a local address property returning the builder for applying multiple build operations.Provides a mutator for a local address property.Provides a local address property.The Class LockedException.The Class LockedRuntimeException.TheMediaType
is the Media-Sub-Type part of a HTTP Media-Type.Provides an accessor for a Media-Type property.Provides a builder method for a Media-Type property returning the builder for applying multiple build operations.Provides a mutator for a Media-Type property.Provides a Media-Type property.TheMediaTypeFactory
creates instances from an HTTP body and creates an HTTP body from given instances according to theMediaType
(as ofMediaTypesAccessor.getMediaTypes()
) for which theMediaTypeFactory
is responsible.The Interface MediaTypeFactoryLookup.Adds functionality to modify theMediaTypeFactoryLookup
e.g.Known or in this scope usedMediaType
parameters.Provides an accessor for a Media-Types property.Provides a builder method for a Media-Types property returning the builder for applying multiple build operations.Provides a mutator for a Media-Types property.Provides a Media-Types property.The Class MethodFailureException.The Class MethodFailureRuntimeException.The Class MethodNotAllowedException.The Class MethodNotAllowedRuntimeException.The Class MovedPermanentlyException.The Class MovedPermanentlyRuntimeException.The Class MovedTemporarilyException.The Class MovedTemporarilyRuntimeException.The Class MultipleChoicesException.The Class MultipleChoicesRuntimeException.The Class MultiStatusException.The Class MultiStatusRuntimeException.The Class NoContentException.The Class NoContentRuntimeException.The Class NonAuthoritativeInformationException.The Class NonAuthoritativeInformationRuntimeException.The Class NotAcceptableException.The Class NotAcceptableRuntimeException.The Class NotFoundException.The Class NotFoundRuntimeException.The Class NotImplementedException.The Class NotImplementedRuntimeException.The Class NotModifiedException.The Class NotModifiedRuntimeException.The Enum OauthField.An OAuth-Token contains all relevant information to access a protected resource and refresh the the access token.Provides an accessor for a OAuth token property.Provides a builder method for a OAuth token property returning the builder for applying multiple build operations.Provides a mutator for a OAuth token property.Provides a OAuth token property.The Class PartialContentException.The Class PartialContentRuntimeException.The Class PaymentRequiredException.The Class PaymentRequiredRuntimeException.ThePostHttpClientInterceptable
defines aPostHttpInterceptable
for thePostHttpClientInterceptor
type.AnPostHttpClientInterceptor
definition for post-processingHttpClientRequest
as well asHttpClientResponse
instances.ThePostHttpInterceptable
provides base functionality for working withPostHttpInterceptor
instances.AnPostHttpInterceptor
definition for post-processingHttpRequest
as well asHttpResponse
instances.ThePostHttpServerInterceptable
defines aPostHttpInterceptable
for thePostHttpServerInterceptor
type.AnPostHttpServerInterceptor
definition for post-processingHttpServerRequest
as well asHttpServerResponse
instances.The Class PreconditionFailedException.The Class PreconditionFailedRuntimeException.ThePreHttpClientInterceptable
defines aPreHttpInterceptable
for thePreHttpClientInterceptor
type.AnPreHttpClientInterceptor
definition for pre-processingHttpClientRequest
as well asHttpClientResponse
instances.ThePreHttpInterceptable
provides base functionality for working withPreHttpInterceptor
instances.ThePreHttpServerInterceptable
defines aPreHttpInterceptable
for thePreHttpServerInterceptor
type.AnPreHttpServerInterceptor
definition for pre-processingHttpServerRequest
as well asHttpServerResponse
instances.The Enum Proxy.The Class ProxyAuthenticationRequiredException.The Class ProxyAuthenticationRequiredRuntimeException.Provides an accessor for a request Query-Fields property.Provides a mutator for a request Query-Fields property.Provides a mutator for a request Query-Fields property.Provides a request Query-Fields property.Provides an accessor for a realm property.RealmAccessor.RealmBuilder<B extends RealmAccessor.RealmBuilder<B>>Provides a builder method for a realm property returning the builder for applying multiple build operations.Provides a mutator for a realm property.Provides a realm property.The Class ReauthenticationRequiredException.The Class ReauthenticationRequiredRuntimeException.Provides an accessor for a redirect depth property.Provides a builder method for a redirect depth property returning the builder for applying multiple build operations.Provides a mutator for a redirect depth property.Provides a redirect depth property.Provides an accessor for a remote address property.Provides a builder method for a remote address property returning the builder for applying multiple build operations.Provides a mutator for a remote address property.Provides a remote address property.TheRequestCookie
represents a request cookies: We use URL encoding / decoding for the cookie value (regardingRequestCookie.fromHttpCookie(String)
andRequestCookie.toHttpCookie()
) to make life easier and not fall into the trap of unescaped values.The Class RequestedRangeNotSatisfiableException.The Class RequestedRangeNotSatisfiableRuntimeException.TheRequestHeaderFields
reflect the structure of a HTTP-Header and may be used to represent a HTTP-Header.Provides an accessor for an request Header-Fields property.RequestHeaderFieldsAccessor.RequestHeaderFieldsBuilder<B extends RequestHeaderFieldsAccessor.RequestHeaderFieldsBuilder<?>>Provides a mutator for an request Header-Fields property.Provides a mutator for an request Header-Fields property.Provides an request Header-Fields property.The Class RequestTimeoutException.The Class RequestTimeoutRuntimeException.The Class RequestTooLongException.The Class RequestTooLongRuntimeException.The Class RequestUriTooLongException.The Class RequestUriTooLongRuntimeException.The Class ResetContentException.The Class ResetContentRuntimeException.As of "HTTP cookies explained - NCZOnline": "...TheResponseHeaderFields
reflect the structure of a HTTP header and may be used to represent a HTTP header.Provides an accessor for an response Header-Fields property.ResponseHeaderFieldsAccessor.ResponseHeaderFieldsBuilder<B extends ResponseHeaderFieldsAccessor.ResponseHeaderFieldsBuilder<?>>Provides a mutator for an response Header-Fields property.Provides a mutator for an response Header-Fields property.Provides an response Header-Fields property.Provides an accessor for a URL scheme.SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>Provides a builder method for a URL scheme returning the builder for applying multiple build operations.Provides a mutator for a URL scheme.Provides a URL scheme.The Class SeeOtherException.The Class SeeOtherRuntimeException.The Class ServiceUnavailableException.The Class ServiceUnavailableRuntimeException.The Class TemporaryRedirectException.The Class TemporaryRedirectRuntimeException.Implements theMediaTypeFactory
for Media-Type "text/plain" (MediaType.TEXT_PLAIN
).The Interface TokenCredentials.The Enum TokenType.TheTopLevelType
is the top-level part of a HTTP Media-Type.Provides an accessor for a Media-Top-Level-Type property.Provides a builder method for a Media-Top-Level-Type property returning the builder for applying multiple build operations.Provides a mutator for a Media-Top-Level-Type property.Provides a Media-Top-Level-Type property.Transport Layer Security Protocols (TLS-Protocols) known by the herein contained libraries.The Class UnassignedStatusCodeException.The Class UnassignedStatusCodeRuntimeException.The Class UnauthorizedException.The Class UnauthorizedRuntimeException.The Class UnavailableForLegalReasonsException.The Class UnavailableForLegalReasonsRuntimeException.The Class UnprocessableEntityException.The Class UnprocessableEntityRuntimeException.Thrown in case a Media-Type has been provied which is not supported.Thrown in case a Media-Type has been provied which is not supported.TheUrl
class represents an immutable URL: An URL looks something like this: "scheme://[identity[:secret]@]host[:port][/path][?Provides an accessor for aUrl
property..Provides a builder method for aUrl
property returning the builder for applying multiple build operations.Provides a mutator for aUrl
property.Provides aUrl
property.TheUrlBuilder
extends an immutableUrl
with mutable functionality.Declarative syntactic sugar which may be statically imported in order to allow declarative definitions forUrl
(UrlBuilder
) creation and tweaking:import static org.refcodes.web.UrlSugar
The Class UseProxyException.The Class UseProxyRuntimeException.Provides an accessor for a user agent property.Provides a builder method for a user agent property returning the builder for applying multiple build operations.Provides a mutator for a user agent property.Provides a user agent property.The Class VersionNotSupportedException.The Class VersionNotSupportedRuntimeException.Provides an accessor for a virtual host property.Provides a mutator for an virtual host property.Provides a mutator for a virtual host property.Provides a virtual host property.The base exception for networking related issues.The base runtime exception for networking related issues.Implements theMediaTypeFactory
for Media-Type "application/xml" (MediaType.APPLICATION_XML
).Implements theMediaTypeFactory
for Media-Type "application/YAML" (MediaType.APPLICATION_YAML
).