Package org.restheart.exchange
Class JsonProxyRequest
java.lang.Object
org.restheart.exchange.Exchange<com.google.gson.JsonElement>
org.restheart.exchange.Request<com.google.gson.JsonElement>
org.restheart.exchange.ProxyRequest<com.google.gson.JsonElement>
org.restheart.exchange.JsonProxyRequest
- All Implemented Interfaces:
AutoCloseable,BufferedExchange<com.google.gson.JsonElement>
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Field Summary
Fields inherited from class org.restheart.exchange.Request
PATCH, PIPELINE_INFO_KEY, SLASH, UNDERSCOREFields inherited from class org.restheart.exchange.Exchange
APPLICATION_PDF_TYPE, FORM_URLENCODED, HAL_JSON_MEDIA_TYPE, IN_ERROR_KEY, JSON_MEDIA_TYPE, MAX_BUFFERS, MAX_CONTENT_SIZE, MULTIPART, TEXT_PLAIN_CONTENT_TYPE, wrapped -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJsonProxyRequest(io.undertow.server.HttpServerExchange exchange) -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonProxyRequestof(io.undertow.server.HttpServerExchange exchange) com.google.gson.JsonElementreads data from the buffer converting it to TvoidwriteContent(com.google.gson.JsonElement content) updates the request content allocates the PooledByteBuffer array so close() must be invoked to avoid memory leaksMethods inherited from class org.restheart.exchange.ProxyRequest
close, getBuffer, getRawContentKey, isContentAvailable, setBufferMethods inherited from class org.restheart.exchange.Request
addXForwardedHeader, blockForTooManyRequests, getAuthenticatedAccount, getContentType, getContentType, getCookie, getHeader, getHeaders, getMethod, getPath, getPathParam, getPathParams, getPipelineInfo, getPipelineInfo, getQueryParameterOfDefault, getQueryParameterOrDefault, getQueryParameters, getQueryString, getRequestContentLength, getStartTime, getURL, getXForwardedHeaders, isAuthenticated, isBlockForTooManyRequests, isDelete, isGet, isOptions, isPatch, isPost, isPut, pipelineInfo, setContentLength, setContentType, setContentTypeAsJson, setHeader, setHeader, setPipelineInfo, setPipelineInfo, setStartTimeMethods inherited from class org.restheart.exchange.Exchange
getExchange, getWrappedExchange, isAccountInRole, isAuthenticated, isContentTypeFormOrMultipart, isContentTypeFormOrMultipart, isContentTypeJson, isContentTypeJson, isContentTypeText, isContentTypeXml, isInError, isInError, responseInterceptorsExecuted, setInError, setInError, setResponseInterceptorsExecuted, updateBufferSize
-
Constructor Details
-
JsonProxyRequest
protected JsonProxyRequest(io.undertow.server.HttpServerExchange exchange)
-
-
Method Details
-
of
-
readContent
Description copied from interface:BufferedExchangereads data from the buffer converting it to T- Specified by:
readContentin interfaceBufferedExchange<com.google.gson.JsonElement>- Specified by:
readContentin classProxyRequest<com.google.gson.JsonElement>- Returns:
- the content as Json
- Throws:
IOException
-
writeContent
updates the request content allocates the PooledByteBuffer array so close() must be invoked to avoid memory leaks- Specified by:
writeContentin interfaceBufferedExchange<com.google.gson.JsonElement>- Specified by:
writeContentin classProxyRequest<com.google.gson.JsonElement>- Parameters:
content-- Throws:
IOException
-