Package org.restheart.exchange
Class ProxyRequest<T>
java.lang.Object
org.restheart.exchange.Exchange<T>
org.restheart.exchange.Request<T>
org.restheart.exchange.ProxyRequest<T>
- Type Parameters:
T
- generic type
- All Implemented Interfaces:
AutoCloseable
,BufferedExchange<T>
- Direct Known Subclasses:
ByteArrayProxyRequest
,JsonProxyRequest
public abstract class ProxyRequest<T>
extends Request<T>
implements BufferedExchange<T>, AutoCloseable
Base class for Request implementation that can be used in proxied requests.
It stores the response content in the BUFFERED_REQUEST_DATA attachment
of the HttpServerExchange.
- 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this resource, relinquishing any underlying resources.io.undertow.connector.PooledByteBuffer[]
protected io.undertow.util.AttachmentKey<io.undertow.connector.PooledByteBuffer[]>
boolean
abstract T
reads data from the buffer converting it to Tvoid
setBuffer(io.undertow.connector.PooledByteBuffer[] raw)
abstract void
writeContent(T content)
writes data the buffer from TMethods 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, of, 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
-
Constructor Details
-
ProxyRequest
public ProxyRequest(io.undertow.server.HttpServerExchange exchange)
-
-
Method Details
-
readContent
Description copied from interface:BufferedExchange
reads data from the buffer converting it to T- Specified by:
readContent
in interfaceBufferedExchange<T>
- Returns:
- Throws:
IOException
-
writeContent
Description copied from interface:BufferedExchange
writes data the buffer from T- Specified by:
writeContent
in interfaceBufferedExchange<T>
- Throws:
IOException
-
getRawContentKey
protected io.undertow.util.AttachmentKey<io.undertow.connector.PooledByteBuffer[]> getRawContentKey() -
setBuffer
public void setBuffer(io.undertow.connector.PooledByteBuffer[] raw)- Specified by:
setBuffer
in interfaceBufferedExchange<T>
-
getBuffer
public io.undertow.connector.PooledByteBuffer[] getBuffer()- Specified by:
getBuffer
in interfaceBufferedExchange<T>
-
isContentAvailable
public boolean isContentAvailable()- Specified by:
isContentAvailable
in interfaceBufferedExchange<T>
-
close
public void close()Closes this resource, relinquishing any underlying resources.- Specified by:
close
in interfaceAutoCloseable
-