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
- generic type
- Direct Known Subclasses:
BsonFromCsvRequest
,BsonRequest
,ByteArrayRequest
,JsonRequest
,StringRequest
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 <[email protected]>
-
Field Summary
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
ModifierConstructorDescriptionprotected
ServiceRequest(io.undertow.server.HttpServerExchange exchange)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isHandledBy(String serviceName)
static ServiceRequest<?>
of(io.undertow.server.HttpServerExchange exchange)
static <R extends ServiceRequest<?>>
Rvoid
setContent(T content)
Methods inherited from class org.restheart.exchange.Request
addXForwardedHeader, getAuthenticatedAccount, getContentType, getContentType, getCookie, getHeader, getHeaders, getMethod, getPath, getPathParam, getPathParams, getPipelineInfo, getQueryParameterOfDefault, getQueryParameters, getQueryString, getRequestContentLength, getStartTime, getURL, getXForwardedHeaders, isContentTypeFormOrMultipart, isContentTypeFormOrMultipart, isContentTypeJson, isDelete, isGet, isOptions, isPatch, isPost, isPut, pipelineInfo, setContentLength, setContentType, setContentTypeAsJson, setHeader, setHeader, setPipelineInfo, 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 Details
-
-
Constructor Details
-
ServiceRequest
protected ServiceRequest(io.undertow.server.HttpServerExchange exchange)
-
-
Method Details
-
of
-
of
public static <R extends ServiceRequest<?>> R of(io.undertow.server.HttpServerExchange exchange, Class<R> type) -
getContent
-
setContent
-
isHandledBy
- Parameters:
serviceName
-- Returns:
- true if the request is handled by the specified Service
-