Package org.restheart.exchange
Class ServiceRequest<T>
- java.lang.Object
-
- org.restheart.exchange.Exchange<T>
-
- org.restheart.exchange.Request<T>
-
- org.restheart.exchange.ServiceRequest<T>
-
- Type Parameters:
T-
- Direct Known Subclasses:
BsonRequest,ByteArrayRequest,JsonRequest
public abstract class ServiceRequest<T> extends Request<T>
Base class for Request implementations that can be used in service requests. Only one request object can be instantiated per exchage. The request object is instantiated by ServiceExchangeInitializer using the requestInitializer() function defined by the handling service- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Field Summary
Fields Modifier and Type Field Description protected Tcontent-
Fields inherited from class org.restheart.exchange.Request
FORM_URLENCODED, MULTIPART, PATCH, SLASH, UNDERSCORE
-
Fields inherited from class org.restheart.exchange.Exchange
APP_FORM_URLENCODED_TYPE, APPLICATION_PDF_TYPE, HAL_JSON_MEDIA_TYPE, IN_ERROR_KEY, JSON_MEDIA_TYPE, LOGGER, MAX_BUFFERS, MAX_CONTENT_SIZE, MULTIPART_FORM_DATA_TYPE, wrapped
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceRequest(io.undertow.server.HttpServerExchange exchange)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetContent()booleanisHandledBy(String serviceName)static ServiceRequest<?>of(io.undertow.server.HttpServerExchange exchange)static <R extends ServiceRequest<?>>
Rof(io.undertow.server.HttpServerExchange exchange, Class<R> type)voidsetContent(T content)-
Methods inherited from class org.restheart.exchange.Request
addXForwardedHeader, getAuthenticatedAccount, getContentType, getContentType, getMethod, getPath, getPipelineInfo, getStartTime, getXForwardedHeaders, isContentTypeFormOrMultipart, isContentTypeFormOrMultipart, isContentTypeJson, isDelete, isGet, isOptions, isPatch, isPost, isPut, setContentLength, setContentType, setContentTypeAsJson, setPipelineInfo, setStartTime
-
Methods inherited from class org.restheart.exchange.Exchange
getExchange, getWrappedExchange, isAccountInRole, isAuthenticated, isAuthenticated, isContentTypeJson, isContentTypeText, isContentTypeXml, isInError, isInError, responseInterceptorsExecuted, setInError, setInError, setResponseInterceptorsExecuted, updateBufferSize
-
-
-
-
Field Detail
-
content
protected T content
-
-
Method Detail
-
of
public static ServiceRequest<?> of(io.undertow.server.HttpServerExchange exchange)
-
of
public static <R extends ServiceRequest<?>> R of(io.undertow.server.HttpServerExchange exchange, Class<R> type)
-
getContent
public T getContent()
-
setContent
public void setContent(T content)
-
isHandledBy
public boolean isHandledBy(String serviceName)
- Parameters:
serviceName-- Returns:
- true if the request is handled by the specified Service
-
-