public class CustomHeadersDecorator<R extends RequestBody,P extends ResponseBody,M extends MessageParameters> extends Object implements MessageHeaders<R,P,M>
MessageHeaders
that adds the ability to include custom HTTP headers.Constructor and Description |
---|
CustomHeadersDecorator(MessageHeaders<R,P,M> decorated)
Creates a new
CustomHeadersDecorator for a given MessageHeaders object. |
Modifier and Type | Method and Description |
---|---|
void |
addCustomHeader(HttpHeader httpHeader)
Adds a custom header to the message.
|
Collection<HttpHeader> |
getCustomHeaders()
Returns the custom headers added to the message.
|
MessageHeaders<R,P,M> |
getDecorated() |
String |
getDescription()
Returns the description for this header.
|
HttpMethodWrapper |
getHttpMethod()
Returns the
HttpMethodWrapper to be used for the request. |
Class<R> |
getRequestClass()
Returns the class of the request message.
|
Class<P> |
getResponseClass()
Returns the class of the response message.
|
org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus |
getResponseStatusCode()
Returns the http status code for the response.
|
Collection<Class<?>> |
getResponseTypeParameters()
Returns the collection of type parameters for the response type.
|
Collection<? extends RestAPIVersion<?>> |
getSupportedAPIVersions()
Returns the supported API versions that this request supports.
|
String |
getTargetRestEndpointURL()
Returns the generalized endpoint url that this request should be sent to, for example
/job/:jobid . |
M |
getUnresolvedMessageParameters()
Returns a new
MessageParameters object. |
void |
setCustomHeaders(Collection<HttpHeader> customHeaders)
Sets the custom headers for the message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
operationId
acceptsFileUploads
public CustomHeadersDecorator(MessageHeaders<R,P,M> decorated)
CustomHeadersDecorator
for a given MessageHeaders
object.decorated
- The MessageHeaders to decorate.public HttpMethodWrapper getHttpMethod()
RestHandlerSpecification
HttpMethodWrapper
to be used for the request.getHttpMethod
in interface RestHandlerSpecification
public String getTargetRestEndpointURL()
RestHandlerSpecification
/job/:jobid
.getTargetRestEndpointURL
in interface RestHandlerSpecification
public Collection<? extends RestAPIVersion<?>> getSupportedAPIVersions()
RestHandlerSpecification
getSupportedAPIVersions
in interface RestHandlerSpecification
public Class<P> getResponseClass()
MessageHeaders
getResponseClass
in interface MessageHeaders<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
public org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus getResponseStatusCode()
MessageHeaders
getResponseStatusCode
in interface MessageHeaders<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
public String getDescription()
MessageHeaders
getDescription
in interface MessageHeaders<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
public Class<R> getRequestClass()
UntypedResponseMessageHeaders
getRequestClass
in interface UntypedResponseMessageHeaders<R extends RequestBody,M extends MessageParameters>
public M getUnresolvedMessageParameters()
UntypedResponseMessageHeaders
MessageParameters
object.getUnresolvedMessageParameters
in interface UntypedResponseMessageHeaders<R extends RequestBody,M extends MessageParameters>
public Collection<HttpHeader> getCustomHeaders()
getCustomHeaders
in interface MessageHeaders<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
HttpHeader
.public Collection<Class<?>> getResponseTypeParameters()
MessageHeaders
getResponseTypeParameters
in interface MessageHeaders<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
public void setCustomHeaders(Collection<HttpHeader> customHeaders)
customHeaders
- A collection of custom headers.public void addCustomHeader(HttpHeader httpHeader)
httpHeader
- The header to add.public MessageHeaders<R,P,M> getDecorated()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.