Package org.refcodes.net
Interface HeaderFields<C extends Cookie,B extends HeaderFields<C,B>>
-
- Type Parameters:
C
- the generic typeB
- the generic type
- All Superinterfaces:
BasicAuthCredentialsAccessor
,BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>
,BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
,BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
,BearerAuthCredentialsAccessor
,BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B>
,BearerAuthCredentialsAccessor.BearerAuthCredentialsMutator
,BearerAuthCredentialsAccessor.BearerAuthCredentialsProperty
,HttpFields<B>
,java.util.Map<C,B>
- All Known Subinterfaces:
RequestHeaderFields
,ResponseHeaderFields
- All Known Implementing Classes:
AbstractHeaderFields
,RequestHeaderFieldsImpl
,ResponseHeaderFieldsImpl
public interface HeaderFields<C extends Cookie,B extends HeaderFields<C,B>> extends HttpFields<B>, BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty, BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>, BearerAuthCredentialsAccessor.BearerAuthCredentialsProperty, BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B>
TheHeaderFields
reflect the structure of a HTTP header and may be used to represent a HTTP header.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.BasicAuthCredentialsAccessor
BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B extends BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>>, BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.BearerAuthCredentialsAccessor
BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B extends BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B>>, BearerAuthCredentialsAccessor.BearerAuthCredentialsMutator, BearerAuthCredentialsAccessor.BearerAuthCredentialsProperty
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BASIC_REALM
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description C
addCookie(C aCookie)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance.C
addCookie(java.lang.String aHttpCookie)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance.C
addCookie(java.lang.String aCookieName, java.lang.String aValue)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance.default void
addTo(HeaderField aHeaderField, java.lang.String aValue)
Adds the value to the given Header-Field.default void
addTo(HeaderField aHeaderField, java.lang.String... aValues)
Adds the given values to the according Header-Field.default void
addTo(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Adds the given values to the according Header-Field.default java.util.List<java.lang.String>
get(HeaderField aHeaderField)
Gets the values for the according Header-Field..default java.util.List<java.lang.String>
getAcceptCharsets()
Gets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default java.util.List<ContentEncoding>
getAcceptEncodings()
Gets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default java.util.List<ContentType>
getAcceptTypes()
Gets the Accept request-Header-FieldHeaderField.ACCEPT
: "...java.util.List<C>
getAllCookies()
Retrieves an array of cookies sent by the client stored in thisRequestHeaderFields
instance.default java.util.List<HttpMethod>
getAllowMethods()
Gets the Allow entity-Header-FieldHeaderField.ALLOW
: "...default java.lang.String
getAuthenticate()
Gets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "...default java.lang.String
getAuthorize()
Gets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default java.lang.String
getBasicAuth()
Retrieves the WWW-Authenticate field for Basic-Authentication.default BasicAuthCredentials
getBasicAuthCredentials()
Retrieves theBasicAuthCredentials
from the request (or null if there are none such credentials).default BearerAuthCredentials
getBearerAuthCredentials()
Retrieves theBearerAuthCredentials
from the request (or null if there are none such credentials).default ContentEncoding
getContentEncoding()
Gets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default ContentType
getContentType()
Gets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
: "...default java.util.List<C>
getCookies(java.lang.String aCookieName)
Retrieves an individual cookie sent by the client stored in thisRequestHeaderFields
instance.default java.lang.String
getFirst(HeaderField aHeaderField)
Gets the first value of the according Header-Field.default C
getFirstCookie(java.lang.String aCookieName)
Same asgetAllCookies()
though just returning the first cookie.default java.lang.String
getHost()
Gets the Host request-Header-FieldHeaderField.HOST
: "...default java.lang.String
getRequestId()
Gets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.default java.lang.String
getSessionId()
Gets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.default java.util.List<java.lang.String>
getUnknownAcceptTypes()
Gets the unresolvable (unknown) Accept request-Header-FieldHeaderField.ACCEPT
.default java.util.List<java.lang.String>
getUnknownContentTypes()
Gets the unresolvable (unknown) Content-Type request-Header-FieldHeaderField.CONTENT_TYPE
.default java.lang.String
getUserAgent()
Gets the User-Agent request-Header-FieldHeaderField.USER_AGENT
: "...default java.util.List<java.lang.String>
put(HeaderField aHeaderField, java.lang.String aValue)
Puts (replaces) the currently set Header-Field values with the provided one.default java.util.List<java.lang.String>
put(HeaderField aHeaderField, java.lang.String... aValues)
Puts (replaces) the currently set Header-Field values with the provided ones.default java.util.List<java.lang.String>
put(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Puts (replaces) the currently set Header-Field values with the provided ones.default java.util.List<java.lang.String>
putAcceptCharsets(java.lang.String... aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default java.util.List<java.lang.String>
putAcceptCharsets(java.util.List<java.lang.String> aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default java.util.List<ContentEncoding>
putAcceptEncodings(java.util.List<ContentEncoding> aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default java.util.List<ContentEncoding>
putAcceptEncodings(ContentEncoding... aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default java.util.List<ContentType>
putAcceptTypes(java.util.List<? extends HttpMediaType> aHttpMediaTypes)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
.default java.util.List<ContentType>
putAcceptTypes(HttpMediaType... aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
.default java.util.List<HttpMethod>
putAllowMethods(java.util.List<HttpMethod> aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "...default java.util.List<HttpMethod>
putAllowMethods(HttpMethod... aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "...default java.lang.String
putAuthenticate(java.lang.String aAuthenticate)
Sets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "...default java.lang.String
putAuthorize(java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default java.lang.String
putAuthorize(java.lang.String aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default java.lang.String
putAuthorize(AuthType aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default BasicAuthCredentials
putBasicAuthCredentials(BasicAuthCredentials aBasicAuthCredentials)
Sets theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.default java.lang.String
putBasicAuthRequired(java.lang.String aRealm)
Sets the WWW-Authenticate field for Basic-Authentication with the given realm.default BearerAuthCredentials
putBearerAuthCredentials(BearerAuthCredentials aBearerAuthCredentials)
Sets theBearerAuthCredentials
(token) for HTTP bearer authentication.default ContentEncoding
putContentEncoding(ContentEncoding aEncoding)
Sets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default ContentType
putContentType(HttpMediaType aHttpMediaType)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
.default ContentType
putContentType(MediaType aMediaType, java.util.Map<java.lang.String,java.lang.String> aParameters)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. : "...default java.lang.String
putHost(java.lang.String aHost)
Sets the Host request-Header-FieldHeaderField.HOST
: "...default java.lang.String
putRequestId(java.lang.String aRequestId)
Sets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.default java.lang.String
putSessionId(java.lang.String aSessionId)
Sets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.default java.lang.String
putUserAgent(java.lang.String aUserAgent)
Sets the User-Agent request-Header-FieldHeaderField.USER_AGENT
: "...default java.util.List<java.lang.String>
remove(HeaderField aHeaderField)
Removes the values from the given Header-Field.default java.util.List<java.lang.String>
removeAcceptCharsets()
Removes the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default java.util.List<ContentEncoding>
removeAcceptEncodings()
Removes the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default java.util.List<ContentType>
removeAcceptTypes()
Removes the Accept request-Header-FieldHeaderField.ACCEPT
: "...default java.util.List<HttpMethod>
removeAllowMethods()
Removes the Allow entity-Header-FieldHeaderField.ALLOW
: "...default java.lang.String
removeAuthenticate()
Removes the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "...default java.lang.String
removeAuthorize()
Removes the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default BasicAuthCredentials
removeBasicAuthCredentials()
Removes theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.default java.lang.String
removeBasicAuthenticate()
Removes the WWW-Authenticate field for Basic-Authentication.default BearerAuthCredentials
removeBearerAuthCredentials()
Removes theBearerAuthCredentials
(token) for HTTP bearer authentication.default ContentEncoding
removeContentEncoding()
Removes the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default ContentType
removeContentType()
Removes the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. : "...default java.lang.String
removeHost()
Removes the Host request-Header-FieldHeaderField.HOST
: "...default java.lang.String
removeRequestId()
Removes the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.default java.lang.String
removeSessionId()
Removes the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.default java.lang.String
removeUserAgent()
Removes he User-Agent request-Header-FieldHeaderField.USER_AGENT
: "...default java.lang.String
toBasicAuthRealm()
Extracts the real (if any) from theHeaderField.WWW_AUTHENTICATE
Header-Field (getAuthenticate()
).default void
toHeaderFields(java.util.Map<java.lang.String,java.util.List<java.lang.String>> aToFields)
Copies the Header-Fields into the providedMap
.default java.lang.String[]
toHttpCookies()
Creates a HTTP Header-Field value from the herein storedCookie
instances.default B
withAcceptCharsets(java.lang.String... aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default B
withAcceptCharsets(java.util.List<java.lang.String> aAcceptCharsets)
Sets the the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
.default B
withAcceptEncodings(java.util.List<ContentEncoding> aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default B
withAcceptEncodings(ContentEncoding... aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default B
withAcceptTypes(java.util.List<? extends HttpMediaType> aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
.default B
withAcceptTypes(HttpMediaType... aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
.default HeaderFields<C,B>
withAddCookie(C aCookie)
Builder method for theaddCookie(Cookie)
method.default HeaderFields<C,B>
withAddCookie(java.lang.String aCookieName, java.lang.String aValue)
Builder method for theaddCookie(String, String)
method.default HeaderFields<C,B>
withAddTo(HeaderField aHeaderField, java.lang.String aValue)
Builder method foraddTo(HeaderField, String)
.default HeaderFields<C,B>
withAddTo(HeaderField aHeaderField, java.lang.String... aValues)
Builder method foraddTo(HeaderField, String ...)
.default HeaderFields<C,B>
withAddTo(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Builder method foraddTo(HeaderField, List)
.default B
withAllowMethods(java.util.List<HttpMethod> aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "...default B
withAllowMethods(HttpMethod... aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "...default B
withAuthenticate(java.lang.String aAuthenticate)
Sets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "...default B
withAuthorize(java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default B
withAuthorize(java.lang.String aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default B
withAuthorize(AuthType aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "...default B
withBasicAuthCredentials(java.lang.String aUserName, java.lang.String aSecret)
Sets the user name and secret (password) for HTTP Basic-Authentication.default B
withBasicAuthCredentials(BasicAuthCredentials aBasicAuthCredentials)
Sets theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.default B
withBasicAuthRequired(java.lang.String aRealm)
Sets the WWW-Authenticate field for Basic-Authentication with the given realm.default B
withBearerAuthCredentials(java.lang.String aToken)
Sets the token (secret) for HTTP bearer authentication.default B
withBearerAuthCredentials(BearerAuthCredentials aBearerAuthCredentials)
Sets theBearerAuthCredentials
(token) for HTTP bearer authentication.default B
withContentEncoding(ContentEncoding aEncoding)
Sets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "...default B
withContentType(HttpMediaType aHttpMediaType)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
.default B
withContentType(MediaType aMediaType, java.util.Map<java.lang.String,java.lang.String> aParameters)
Sets the Content-Type'sMediaType
and the parameters for the HTTP body.default B
withHost(java.lang.String aHost)
Sets the Host request-Header-FieldHeaderField.HOST
: "...default HeaderFields<C,B>
withPut(HeaderField aHeaderField, java.lang.String aValue)
Builder method forput(HeaderField, String)
.default HeaderFields<C,B>
withPut(HeaderField aHeaderField, java.lang.String... aValues)
Builder method forput(HeaderField, String ...)
.default HeaderFields<C,B>
withPut(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Builder method forput(HeaderField, List)
.default B
withRequestId(java.lang.String aRequestId)
Sets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.default B
withSessionId(java.lang.String aSessionId)
Sets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.default B
withUserAgent(java.lang.String aUserAgent)
Sets he User-Agent request-Header-FieldHeaderField.USER_AGENT
: "...-
Methods inherited from interface org.refcodes.net.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
putBasicAuthCredentials
-
Methods inherited from interface org.refcodes.net.BearerAuthCredentialsAccessor.BearerAuthCredentialsMutator
putBearerAuthCredentials
-
Methods inherited from interface org.refcodes.net.HttpFields
addTo, addTo, addTo, addTo, addTo, addTo, getFirst, getFirst, put, put, put, put, toField, toField, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withPut, withPut, withPut, withPut, withPut, withPut
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
BASIC_REALM
static final java.lang.String BASIC_REALM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllowMethods
default java.util.List<HttpMethod> getAllowMethods()
Gets the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Returns:
- The HTTP-Methods allowed for the resource.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAllowMethods
default java.util.List<HttpMethod> putAllowMethods(HttpMethod... aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Parameters:
aHttpMethods
- The HTTP-Methods allowed for the resource.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAllowMethods
default java.util.List<HttpMethod> putAllowMethods(java.util.List<HttpMethod> aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Parameters:
aHttpMethods
- The HTTP-Methods allowed for the resource.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAllowMethods
default B withAllowMethods(HttpMethod... aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Parameters:
aHttpMethods
- The HTTP-Methods allowed for the resource.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAllowMethods
default B withAllowMethods(java.util.List<HttpMethod> aHttpMethods)
Sets the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Parameters:
aHttpMethods
- The HTTP-Methods allowed for the resource.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeAllowMethods
default java.util.List<HttpMethod> removeAllowMethods()
Removes the Allow entity-Header-FieldHeaderField.ALLOW
: "... The Allow entity-Header-Field lists the set of methods supported by the resource ... The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getContentType
default ContentType getContentType()
Gets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
: "... The Content-Type entity-Header-Field indicates the media type of the entity-body sent to the recipient ..."- Returns:
- The media type being used for the body.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getUnknownContentTypes
default java.util.List<java.lang.String> getUnknownContentTypes()
Gets the unresolvable (unknown) Content-Type request-Header-FieldHeaderField.CONTENT_TYPE
. E.g. the ones which cannot be mapped by the enumerationMediaType
.- Returns:
- the unknown content types
- See Also:
getContentType()
-
putContentType
default ContentType putContentType(HttpMediaType aHttpMediaType)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Content-Type entity-Header-Field indicates the media type of the entity-body sent to the recipient ..."- Parameters:
aHttpMediaType
- The media type used for the body.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putContentType
default ContentType putContentType(MediaType aMediaType, java.util.Map<java.lang.String,java.lang.String> aParameters)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. : "... The Content-Type entity-Header-Field indicates the media type of the entity-body sent to the recipient ..."- Parameters:
aMediaType
- The media type used for the body.aParameters
- The Content-Type's parameters.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withContentType
default B withContentType(HttpMediaType aHttpMediaType)
Sets the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Content-Type entity-Header-Field indicates the media type of the entity-body sent to the recipient ..."- Parameters:
aHttpMediaType
- The media type used for the body.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withContentType
default B withContentType(MediaType aMediaType, java.util.Map<java.lang.String,java.lang.String> aParameters)
Sets the Content-Type'sMediaType
and the parameters for the HTTP body.- Parameters:
aMediaType
- The media type used for the body.aParameters
- The Content-Type's parameters.- Returns:
- This object as of the Builder-Pattern.
-
removeContentType
default ContentType removeContentType()
Removes the Content-Type entity-Header-FieldHeaderField.CONTENT_TYPE
. : "... The Content-Type entity-Header-Field indicates the media type of the entity-body sent to the recipient ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getAcceptTypes
default java.util.List<ContentType> getAcceptTypes()
Gets the Accept request-Header-FieldHeaderField.ACCEPT
: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired ..."- Returns:
- The expected (supported) kinds of
MediaType
and the according parameters (being actually instances of theContentType
type). - See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getUnknownAcceptTypes
default java.util.List<java.lang.String> getUnknownAcceptTypes()
Gets the unresolvable (unknown) Accept request-Header-FieldHeaderField.ACCEPT
. E.g. the ones which cannot be mapped by the enumerationMediaType
.- Returns:
- the unknown accept types
- See Also:
getAcceptTypes()
-
putAcceptTypes
default java.util.List<ContentType> putAcceptTypes(HttpMediaType... aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types ..."- Parameters:
aHttpMediaType
- The accordingHttpMediaTypeAccessor.HttpMediaTypeProvider
.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAcceptTypes
default java.util.List<ContentType> putAcceptTypes(java.util.List<? extends HttpMediaType> aHttpMediaTypes)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types ..."- Parameters:
aHttpMediaTypes
- The accordingHttpMediaTypeAccessor.HttpMediaTypeProvider
.- Returns:
- The replaced element (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAcceptTypes
default B withAcceptTypes(HttpMediaType... aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types ..."- Parameters:
aHttpMediaType
- The accordingHttpMediaTypeAccessor.HttpMediaTypeProvider
.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAcceptTypes
default B withAcceptTypes(java.util.List<? extends HttpMediaType> aHttpMediaType)
Sets the Accept request-Header-FieldHeaderField.ACCEPT
. You may pass aMediaType
or aContentType
instance as them both implement theHttpMediaTypeAccessor.HttpMediaTypeProvider
interface: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types ..."- Parameters:
aHttpMediaType
- The accordingHttpMediaTypeAccessor.HttpMediaTypeProvider
.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeAcceptTypes
default java.util.List<ContentType> removeAcceptTypes()
Removes the Accept request-Header-FieldHeaderField.ACCEPT
: "... The Accept request-Header-Field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getAcceptCharsets
default java.util.List<java.lang.String> getAcceptCharsets()
Gets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Returns:
- The Accept-Charset expected by a client from a server.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAcceptCharsets
default java.util.List<java.lang.String> putAcceptCharsets(java.lang.String... aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Parameters:
aAcceptCharsets
- The Accept-Charset expected by a client from a server.- Returns:
- The replaced elements (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAcceptCharsets
default java.util.List<java.lang.String> putAcceptCharsets(java.util.List<java.lang.String> aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Parameters:
aAcceptCharsets
- The Accept-Charset expected by a client from a server.- Returns:
- The replaced elements (if any, else null).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAcceptCharsets
default B withAcceptCharsets(java.util.List<java.lang.String> aAcceptCharsets)
Sets the the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Parameters:
aAcceptCharsets
- The Accept-Charset expected by a client from a server.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAcceptCharsets
default B withAcceptCharsets(java.lang.String... aAcceptCharsets)
Sets the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Parameters:
aAcceptCharsets
- The Accept-Charset expected by a client from a server.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeAcceptCharsets
default java.util.List<java.lang.String> removeAcceptCharsets()
Removes the Accept-Charset request-Header-FieldHeaderField.ACCEPT_CHARSET
. "... The Accept-Charset request-Header-Field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special- purpose character sets to signal that capability to a server which is capable of representing documents in those character sets ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getAcceptEncodings
default java.util.List<ContentEncoding> getAcceptEncodings()
Gets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Returns:
- The expected (supported) kinds of encodings.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html", "https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Encoding"
-
putAcceptEncodings
default java.util.List<ContentEncoding> putAcceptEncodings(ContentEncoding... aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncodings
- The according encodings.- Returns:
- the list
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html", "https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Encoding"
-
putAcceptEncodings
default java.util.List<ContentEncoding> putAcceptEncodings(java.util.List<ContentEncoding> aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncodings
- The according encodings.- Returns:
- the list
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html", "https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Encoding"
-
withAcceptEncodings
default B withAcceptEncodings(ContentEncoding... aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncodings
- The according encodings.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html", "https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Encoding"
-
withAcceptEncodings
default B withAcceptEncodings(java.util.List<ContentEncoding> aEncodings)
Sets the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncodings
- The according encodings.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html", "https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Encoding"
-
removeAcceptEncodings
default java.util.List<ContentEncoding> removeAcceptEncodings()
Removes the the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getContentEncoding
default ContentEncoding getContentEncoding()
Gets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Returns:
- The communication partner's HTTP body's encoding.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putContentEncoding
default ContentEncoding putContentEncoding(ContentEncoding aEncoding)
Sets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncoding
- The HTTP body's content encoding.- Returns:
- the content encoding
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withContentEncoding
default B withContentEncoding(ContentEncoding aEncoding)
Sets the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Parameters:
aEncoding
- The HTTP body's content encoding.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeContentEncoding
default ContentEncoding removeContentEncoding()
Removes the Content-Encoding entity-Header-FieldHeaderField.CONTENT_ENCODING
: "... The Content-Encoding entity-Header-Field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type Header-Field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getUserAgent
default java.lang.String getUserAgent()
Gets the User-Agent request-Header-FieldHeaderField.USER_AGENT
: "... The User-Agent request-Header-Field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests ..."- Returns:
- The according user agent.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putUserAgent
default java.lang.String putUserAgent(java.lang.String aUserAgent)
Sets the User-Agent request-Header-FieldHeaderField.USER_AGENT
: "... The User-Agent request-Header-Field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests ..."- Parameters:
aUserAgent
- The according user agent.- Returns:
- the string
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withUserAgent
default B withUserAgent(java.lang.String aUserAgent)
Sets he User-Agent request-Header-FieldHeaderField.USER_AGENT
: "... The User-Agent request-Header-Field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests ..."- Parameters:
aUserAgent
- The according user agent.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeUserAgent
default java.lang.String removeUserAgent()
Removes he User-Agent request-Header-FieldHeaderField.USER_AGENT
: "... The User-Agent request-Header-Field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getHost
default java.lang.String getHost()
Gets the Host request-Header-FieldHeaderField.HOST
: "... The Host request-Header-Field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource ..."- Returns:
- The according host.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putHost
default java.lang.String putHost(java.lang.String aHost)
Sets the Host request-Header-FieldHeaderField.HOST
: "... The Host request-Header-Field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource ..."- Parameters:
aHost
- The according host.- Returns:
- the string
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withHost
default B withHost(java.lang.String aHost)
Sets the Host request-Header-FieldHeaderField.HOST
: "... The Host request-Header-Field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource ..."- Parameters:
aHost
- The according host.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeHost
default java.lang.String removeHost()
Removes the Host request-Header-FieldHeaderField.HOST
: "... The Host request-Header-Field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getRequestId
default java.lang.String getRequestId()
Gets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.- Returns:
- The according Request-Correlation ID.
-
putRequestId
default java.lang.String putRequestId(java.lang.String aRequestId)
Sets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.- Parameters:
aRequestId
- The according Request-Correlation ID.- Returns:
- The value being removed (or null if none was set).
-
withRequestId
default B withRequestId(java.lang.String aRequestId)
Sets the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.- Parameters:
aRequestId
- The according Request-Correlation ID.- Returns:
- This object as of the Builder-Pattern.
-
removeRequestId
default java.lang.String removeRequestId()
Removes the (interprocess) Request-Correlation ID fieldHeaderField.REQUEST_ID
: A Request-Correlation ID is an ID to uniquely identify an entity (request) across multiple systems.- Returns:
- The value being removed (or null if none was set).
-
getSessionId
default java.lang.String getSessionId()
Gets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.- Returns:
- The according Session-Correlation ID.
-
putSessionId
default java.lang.String putSessionId(java.lang.String aSessionId)
Sets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.- Parameters:
aSessionId
- The according Session-Correlation ID.- Returns:
- The value being removed (or null if none was set).
-
withSessionId
default B withSessionId(java.lang.String aSessionId)
Sets the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.- Parameters:
aSessionId
- The according Session-Correlation ID.- Returns:
- This object as of the Builder-Pattern.
-
removeSessionId
default java.lang.String removeSessionId()
Removes the (interprocess) Session-Correlation ID fieldHeaderField.SESSION_ID
: A Session-Correlation ID is an ID to uniquely identify an entity (session) across multiple systems.- Returns:
- The value being removed (or null if none was set).
-
getAuthenticate
default java.lang.String getAuthenticate()
Gets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "... The WWW-Authenticate Response-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Returns:
- The according WWW-Authenticate field.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
putAuthenticate
default java.lang.String putAuthenticate(java.lang.String aAuthenticate)
Sets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "... The WWW-Authenticate Response-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthenticate
- The according WWW-Authenticate field.- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
withAuthenticate
default B withAuthenticate(java.lang.String aAuthenticate)
Sets the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "... The WWW-Authenticate Response-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthenticate
- The according WWW-Authenticate field.- Returns:
- This object as of the Builder-Pattern.
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
removeAuthenticate
default java.lang.String removeAuthenticate()
Removes the WWW-Authenticate Response-Header-FieldHeaderField.WWW_AUTHENTICATE
: "... The WWW-Authenticate Response-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Returns:
- The value being removed (or null if none was set).
- See Also:
- "https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"
-
getBasicAuth
default java.lang.String getBasicAuth()
Retrieves the WWW-Authenticate field for Basic-Authentication. If not set or another kind of authorization is set, then null is returned. UsegetAuthenticate()
to get the field's value no matter which kind of authenticate is used.- Returns:
- The WWW-Authenticate field for Basic-Authentication or null if there is no value for the given field or it does not declare Basic-Authentication.
-
putBasicAuthRequired
default java.lang.String putBasicAuthRequired(java.lang.String aRealm)
Sets the WWW-Authenticate field for Basic-Authentication with the given realm.- Parameters:
aRealm
- The realm to be set for Basic-Authentication of the WWW-authenticate field.- Returns:
- The value being removed (or null if none was set).
-
withBasicAuthRequired
default B withBasicAuthRequired(java.lang.String aRealm)
Sets the WWW-Authenticate field for Basic-Authentication with the given realm.- Parameters:
aRealm
- The realm to be set for Basic-Authentication of the WWW-authenticate field.- Returns:
- This object as of the Builder-Pattern.
-
removeBasicAuthenticate
default java.lang.String removeBasicAuthenticate()
Removes the WWW-Authenticate field for Basic-Authentication. If not set or another kind of authorization is set, then null is returned and the field is not removed. UseremoveAuthenticate()
to remove the field's value no matter which kind of authenticate is used.- Returns:
- The value being removed (or null if none or none for basic authentication was set).
-
toBasicAuthRealm
default java.lang.String toBasicAuthRealm()
Extracts the real (if any) from theHeaderField.WWW_AUTHENTICATE
Header-Field (getAuthenticate()
).- Returns:
- The basic authenticate's realm or null if there is none such.
-
getAuthorize
default java.lang.String getAuthorize()
Gets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Returns:
- The according Authorize field.
-
putAuthorize
default java.lang.String putAuthorize(java.lang.String aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthType
- TheAuthType
to be used.aAuthorize
- The according Authorize field.- Returns:
- The value being removed (or null if none was set).
-
withAuthorize
default B withAuthorize(java.lang.String aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthorize
- The according Authorize field.aAuthType
- TheAuthType
to be used.- Returns:
- This object as of the Builder-Pattern.
-
putAuthorize
default java.lang.String putAuthorize(AuthType aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthType
- TheAuthType
to be used.aAuthorize
- The according Authorize field.- Returns:
- The value being removed (or null if none was set).
-
withAuthorize
default B withAuthorize(AuthType aAuthType, java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthorize
- The according Authorize field.aAuthType
- TheAuthType
to be used.- Returns:
- This object as of the Builder-Pattern.
-
putAuthorize
default java.lang.String putAuthorize(java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthorize
- The according Authorize field.- Returns:
- The value being removed (or null if none was set).
-
withAuthorize
default B withAuthorize(java.lang.String aAuthorize)
Sets the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Parameters:
aAuthorize
- The according Authorize field.- Returns:
- This object as of the Builder-Pattern.
-
removeAuthorize
default java.lang.String removeAuthorize()
Removes the Authorize Request-Header-FieldHeaderField.AUTHORIZATION
: "... The Authorize Request-Header-Field MUST be included in 401 (Unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI ..."- Returns:
- The value being removed (or null if none was set).
-
getBearerAuthCredentials
default BearerAuthCredentials getBearerAuthCredentials()
Retrieves theBearerAuthCredentials
from the request (or null if there are none such credentials). Throw anUnauthorizedException
in case you do not agree with the credentials you find there.- Specified by:
getBearerAuthCredentials
in interfaceBearerAuthCredentialsAccessor
- Returns:
- The
BearerAuthCredentials
stored by the bearer authentication credentials property (or null if there are none such credentials).
-
putBearerAuthCredentials
default BearerAuthCredentials putBearerAuthCredentials(BearerAuthCredentials aBearerAuthCredentials)
Sets theBearerAuthCredentials
(token) for HTTP bearer authentication.- Specified by:
putBearerAuthCredentials
in interfaceBearerAuthCredentialsAccessor.BearerAuthCredentialsMutator
- Parameters:
aBearerAuthCredentials
- The credentials (token).- Returns:
- the bearer auth credentials
-
withBearerAuthCredentials
default B withBearerAuthCredentials(BearerAuthCredentials aBearerAuthCredentials)
Sets theBearerAuthCredentials
(token) for HTTP bearer authentication.- Specified by:
withBearerAuthCredentials
in interfaceBearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<C extends Cookie>
- Parameters:
aBearerAuthCredentials
- The credentials (token).- Returns:
- This object as of the Builder-Pattern.
-
withBearerAuthCredentials
default B withBearerAuthCredentials(java.lang.String aToken)
Sets the token (secret) for HTTP bearer authentication.- Specified by:
withBearerAuthCredentials
in interfaceBearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<C extends Cookie>
- Parameters:
aToken
- The password part of the credentials.- Returns:
- This object as of the Builder-Pattern.
-
removeBearerAuthCredentials
default BearerAuthCredentials removeBearerAuthCredentials()
Removes theBearerAuthCredentials
(token) for HTTP bearer authentication.- Returns:
- The value being removed (or null if none was set).
-
getBasicAuthCredentials
default BasicAuthCredentials getBasicAuthCredentials()
Retrieves theBasicAuthCredentials
from the request (or null if there are none such credentials). Throw anUnauthorizedException
in case you do not agree with the credentials you find there.- Specified by:
getBasicAuthCredentials
in interfaceBasicAuthCredentialsAccessor
- Returns:
- The
BasicAuthCredentials
stored by the basic authentication credentials property (or null if there are none such credentials).
-
putBasicAuthCredentials
default BasicAuthCredentials putBasicAuthCredentials(BasicAuthCredentials aBasicAuthCredentials)
Sets theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.- Specified by:
putBasicAuthCredentials
in interfaceBasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
- Parameters:
aBasicAuthCredentials
- The credentials (user name and secret).- Returns:
- the basic auth credentials
-
withBasicAuthCredentials
default B withBasicAuthCredentials(BasicAuthCredentials aBasicAuthCredentials)
Sets theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.- Specified by:
withBasicAuthCredentials
in interfaceBasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<C extends Cookie>
- Parameters:
aBasicAuthCredentials
- The credentials (user name and secret).- Returns:
- This object as of the Builder-Pattern.
-
withBasicAuthCredentials
default B withBasicAuthCredentials(java.lang.String aUserName, java.lang.String aSecret)
Sets the user name and secret (password) for HTTP Basic-Authentication.- Specified by:
withBasicAuthCredentials
in interfaceBasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<C extends Cookie>
- Parameters:
aUserName
- The user name part of the credentials.aSecret
- The password part of the credentials.- Returns:
- This object as of the Builder-Pattern.
-
removeBasicAuthCredentials
default BasicAuthCredentials removeBasicAuthCredentials()
Removes theBasicAuthCredentials
(user name and secret) for HTTP Basic-Authentication.- Returns:
- The value being removed (or null if none was set).
-
get
default java.util.List<java.lang.String> get(HeaderField aHeaderField)
Gets the values for the according Header-Field..- Parameters:
aHeaderField
- The Header-Field- Returns:
- The list of values.
-
getFirst
default java.lang.String getFirst(HeaderField aHeaderField)
Gets the first value of the according Header-Field.- Parameters:
aHeaderField
- The a Header-Field- Returns:
- The first value.
-
addTo
default void addTo(HeaderField aHeaderField, java.lang.String aValue)
Adds the value to the given Header-Field.- Parameters:
aHeaderField
- The Header-Field.aValue
- The a value to be added.
-
withAddTo
default HeaderFields<C,B> withAddTo(HeaderField aHeaderField, java.lang.String aValue)
Builder method foraddTo(HeaderField, String)
.- Parameters:
aHeaderField
- the Header-FieldaValue
- the value- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
addTo
default void addTo(HeaderField aHeaderField, java.lang.String... aValues)
Adds the given values to the according Header-Field.- Parameters:
aHeaderField
- The Header-Field.aValues
- The a values to be added.
-
addTo
default void addTo(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Adds the given values to the according Header-Field.- Parameters:
aHeaderField
- The Header-Field.aValues
- The a values to be added.
-
withAddTo
default HeaderFields<C,B> withAddTo(HeaderField aHeaderField, java.lang.String... aValues)
Builder method foraddTo(HeaderField, String ...)
.- Parameters:
aHeaderField
- the Header-FieldaValues
- the values- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
withAddTo
default HeaderFields<C,B> withAddTo(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Builder method foraddTo(HeaderField, List)
.- Parameters:
aHeaderField
- the Header-FieldaValues
- the values- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
put
default java.util.List<java.lang.String> put(HeaderField aHeaderField, java.lang.String aValue)
Puts (replaces) the currently set Header-Field values with the provided one.- Parameters:
aHeaderField
- The a Header-Field.aValue
- The value with which to replace the currently set Header-Field values.- Returns:
- The
List
with the previously set Header-Field values.
-
withPut
default HeaderFields<C,B> withPut(HeaderField aHeaderField, java.lang.String aValue)
Builder method forput(HeaderField, String)
.- Parameters:
aHeaderField
- The Header-Field.aValue
- The value.- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
put
default java.util.List<java.lang.String> put(HeaderField aHeaderField, java.lang.String... aValues)
Puts (replaces) the currently set Header-Field values with the provided ones.- Parameters:
aHeaderField
- The a Header-Field.aValues
- The values with which to replace the currently set Header-Field values.- Returns:
- The
List
with the previously set Header-Field values.
-
put
default java.util.List<java.lang.String> put(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Puts (replaces) the currently set Header-Field values with the provided ones.- Parameters:
aHeaderField
- The a Header-Field.aValues
- The values with which to replace the currently set Header-Field values.- Returns:
- The
List
with the previously set Header-Field values.
-
withPut
default HeaderFields<C,B> withPut(HeaderField aHeaderField, java.lang.String... aValues)
Builder method forput(HeaderField, String ...)
.- Parameters:
aHeaderField
- The Header-Field.aValues
- The values.- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
withPut
default HeaderFields<C,B> withPut(HeaderField aHeaderField, java.util.List<java.lang.String> aValues)
Builder method forput(HeaderField, List)
.- Parameters:
aHeaderField
- The Header-Field.aValues
- The values.- Returns:
- This instance as of the Builder-Pattern to chain operations.
-
remove
default java.util.List<java.lang.String> remove(HeaderField aHeaderField)
Removes the values from the given Header-Field.- Parameters:
aHeaderField
- The a Header-Field for which to remove the values.- Returns:
- The
List
with the previously set Header-Field values.
-
addCookie
C addCookie(java.lang.String aHttpCookie)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance. The server-side cookies are retrieved from theHeaderField.SET_COOKIE
Header-Field. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aHttpCookie
- The HTTP-CookieString
to be paresd as a cookie.- Returns:
- The resulting cookie builder being added which can be modified
affecting(!) this
ResponseHeaderFields
instance! - Throws:
java.lang.IllegalArgumentException
- thrown in case the HTTP-CookieString
cannot be parsed as a cookie.
-
addCookie
C addCookie(java.lang.String aCookieName, java.lang.String aValue)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance. The server-side cookies are retrieved from theHeaderField.SET_COOKIE
Header-Field. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookieName
- The name for the cookie to be added.aValue
- The value of the cookie to be added.- Returns:
- The resulting cookie builder being added which can be modified
affecting(!) this
ResponseHeaderFields
instance!
-
addCookie
C addCookie(C aCookie)
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFields
instance. The server-side cookies are retrieved from theHeaderField.SET_COOKIE
Header-Field. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookie
- The cookie to be added.- Returns:
- The resulting cookie builder being added which can be modified
affecting(!) this
ResponseHeaderFields
instance!
-
withAddCookie
default HeaderFields<C,B> withAddCookie(java.lang.String aCookieName, java.lang.String aValue)
Builder method for theaddCookie(String, String)
method. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookieName
- The name for the cookie to be added.aValue
- The value of the cookie to be added.- Returns:
- This
ResponseHeaderFields
instance to continue building up the Header-Fields.
-
withAddCookie
default HeaderFields<C,B> withAddCookie(C aCookie)
Builder method for theaddCookie(Cookie)
method. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookie
- The cookie to be added.- Returns:
- This
ResponseHeaderFields
instance to continue building up the Header-Fields.
-
getAllCookies
java.util.List<C> getAllCookies()
Retrieves an array of cookies sent by the client stored in thisRequestHeaderFields
instance. If no cookie has been found, then an empty array is returned. The client-side cookies are retrieved from theHeaderField.COOKIE
Header-Field. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field. According to the Netscape cookie_spec (https://curl.haxx.se/rfc/cookie_spec.html) the entire NAME=VALUE string of a cookie is a sequence of characters excluding semi-colon, comma and white space.- Returns:
- An array containing the cookies (key/value) stored in this
RequestHeaderFields
instance.
-
getCookies
default java.util.List<C> getCookies(java.lang.String aCookieName)
Retrieves an individual cookie sent by the client stored in thisRequestHeaderFields
instance. The client-side cookies are retrieved from theHeaderField.COOKIE
Header-Field. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookieName
- The name of the cookie to be retrieved.- Returns:
- The values of the cookie found for the according name.
-
getFirstCookie
default C getFirstCookie(java.lang.String aCookieName)
Same asgetAllCookies()
though just returning the first cookie. WITH THE METHODgetAllCookies()
andgetCookies(String)
as well asgetFirstCookie(String)
ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE
). COOKIES SET VIAaddCookie(String, String)
ORwithAddCookie(String, String)
CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIE
Header-Field.- Parameters:
aCookieName
- The name of the cookie to be retrieved.- Returns:
- The first cookie found for the according name or null if none such cookies exist.
-
toHttpCookies
default java.lang.String[] toHttpCookies()
Creates a HTTP Header-Field value from the herein storedCookie
instances.- Returns:
- The text representing the HTTP Header-Field for the herein stored cookies.
-
toHeaderFields
default void toHeaderFields(java.util.Map<java.lang.String,java.util.List<java.lang.String>> aToFields)
Copies the Header-Fields into the providedMap
. This is useful when some underlying system provides an own instance of Header-Fields to be filled.- Parameters:
aToFields
- TheMap
where to copy the Header-Fields to.
-
-