Class CustomHeadersDecorator<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
java.lang.Object
org.apache.flink.runtime.rest.messages.CustomHeadersDecorator<R,P,M>
- All Implemented Interfaces:
RestHandlerSpecification,MessageHeaders<R,,P, M> UntypedResponseMessageHeaders<R,M>
public class CustomHeadersDecorator<R extends RequestBody,P extends ResponseBody,M extends MessageParameters>
extends Object
implements MessageHeaders<R,P,M>
Decorator class for
MessageHeaders that adds the ability to include custom HTTP headers.-
Constructor Summary
ConstructorsConstructorDescriptionCustomHeadersDecorator(MessageHeaders<R, P, M> decorated) Creates a newCustomHeadersDecoratorfor a givenMessageHeadersobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomHeader(HttpHeader httpHeader) Adds a custom header to the message.Returns the custom headers added to the message.Returns the description for this header.Returns theHttpMethodWrapperto be used for the request.Returns the class of the request message.Returns the class of the response message.org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatusReturns the http status code for the response.Collection<Class<?>>Returns the collection of type parameters for the response type.Collection<? extends RestAPIVersion<?>>Returns the supported API versions that this request supports.Returns the generalized endpoint url that this request should be sent to, for example/job/:jobid.Returns a newMessageParametersobject.voidsetCustomHeaders(Collection<HttpHeader> customHeaders) Sets the custom headers for the message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.rest.messages.MessageHeaders
operationIdMethods inherited from interface org.apache.flink.runtime.rest.messages.UntypedResponseMessageHeaders
acceptsFileUploads
-
Constructor Details
-
CustomHeadersDecorator
Creates a newCustomHeadersDecoratorfor a givenMessageHeadersobject.- Parameters:
decorated- The MessageHeaders to decorate.
-
-
Method Details
-
getHttpMethod
Description copied from interface:RestHandlerSpecificationReturns theHttpMethodWrapperto be used for the request.- Specified by:
getHttpMethodin interfaceRestHandlerSpecification- Returns:
- http method to be used for the request
-
getTargetRestEndpointURL
Description copied from interface:RestHandlerSpecificationReturns the generalized endpoint url that this request should be sent to, for example/job/:jobid.- Specified by:
getTargetRestEndpointURLin interfaceRestHandlerSpecification- Returns:
- endpoint url that this request should be sent to
-
getSupportedAPIVersions
Description copied from interface:RestHandlerSpecificationReturns the supported API versions that this request supports.- Specified by:
getSupportedAPIVersionsin interfaceRestHandlerSpecification- Returns:
- Collection of supported API versions
-
getResponseClass
Description copied from interface:MessageHeadersReturns the class of the response message.- Specified by:
getResponseClassin interfaceMessageHeaders<R extends RequestBody,P extends ResponseBody, M extends MessageParameters> - Returns:
- class of the response message
-
getResponseStatusCode
public org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus getResponseStatusCode()Description copied from interface:MessageHeadersReturns the http status code for the response.- Specified by:
getResponseStatusCodein interfaceMessageHeaders<R extends RequestBody,P extends ResponseBody, M extends MessageParameters> - Returns:
- http status code of the response
-
getDescription
Description copied from interface:MessageHeadersReturns the description for this header.- Specified by:
getDescriptionin interfaceMessageHeaders<R extends RequestBody,P extends ResponseBody, M extends MessageParameters> - Returns:
- description for the header
-
getRequestClass
Description copied from interface:UntypedResponseMessageHeadersReturns the class of the request message.- Specified by:
getRequestClassin interfaceUntypedResponseMessageHeaders<R extends RequestBody,P extends ResponseBody> - Returns:
- class of the request message
-
getUnresolvedMessageParameters
Description copied from interface:UntypedResponseMessageHeadersReturns a newMessageParametersobject.- Specified by:
getUnresolvedMessageParametersin interfaceUntypedResponseMessageHeaders<R extends RequestBody,P extends ResponseBody> - Returns:
- new message parameters object
-
getCustomHeaders
Returns the custom headers added to the message.- Specified by:
getCustomHeadersin interfaceMessageHeaders<R extends RequestBody,P extends ResponseBody, M extends MessageParameters> - Returns:
- The custom headers as a collection of
HttpHeader.
-
getResponseTypeParameters
Description copied from interface:MessageHeadersReturns the collection of type parameters for the response type.- Specified by:
getResponseTypeParametersin interfaceMessageHeaders<R extends RequestBody,P extends ResponseBody, M extends MessageParameters> - Returns:
- Collection of type parameters for the response type
-
setCustomHeaders
Sets the custom headers for the message.- Parameters:
customHeaders- A collection of custom headers.
-
addCustomHeader
Adds a custom header to the message. Initializes the custom headers collection if it hasn't been initialized yet.- Parameters:
httpHeader- The header to add.
-
getDecorated
-