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-
- All Implemented Interfaces:
BufferedExchange<T>
- Direct Known Subclasses:
ByteArrayProxyRequest,JsonProxyRequest
public abstract class ProxyRequest<T> extends Request<T> implements BufferedExchange<T>
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
-
-
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
Constructors Constructor Description ProxyRequest(io.undertow.server.HttpServerExchange exchange)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description io.undertow.connector.PooledByteBuffer[]getBuffer()protected io.undertow.util.AttachmentKey<io.undertow.connector.PooledByteBuffer[]>getRawContentKey()booleanisContentAvailable()abstract TreadContent()reads data from the buffer converting it to TvoidsetBuffer(io.undertow.connector.PooledByteBuffer[] raw)abstract voidwriteContent(T content)writes data the buffer from T-
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, of, 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
-
-
-
-
Method Detail
-
readContent
public abstract T readContent() throws IOException
Description copied from interface:BufferedExchangereads data from the buffer converting it to T- Specified by:
readContentin interfaceBufferedExchange<T>- Returns:
- Throws:
IOException
-
writeContent
public abstract void writeContent(T content) throws IOException
Description copied from interface:BufferedExchangewrites data the buffer from T- Specified by:
writeContentin 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:
setBufferin interfaceBufferedExchange<T>
-
getBuffer
public io.undertow.connector.PooledByteBuffer[] getBuffer()
- Specified by:
getBufferin interfaceBufferedExchange<T>
-
isContentAvailable
public boolean isContentAvailable()
- Specified by:
isContentAvailablein interfaceBufferedExchange<T>
-
-