Package org.restheart.exchange
Class BsonResponse
java.lang.Object
org.restheart.exchange.Exchange<org.bson.BsonValue>
org.restheart.exchange.Response<org.bson.BsonValue>
org.restheart.exchange.ServiceResponse<org.bson.BsonValue>
org.restheart.exchange.BsonResponse
- Direct Known Subclasses:
MongoResponse
ServiceResponse implementation backed by BsonValue
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Field Summary
Fields inherited from class org.restheart.exchange.ServiceResponse
contentFields 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
ConstructorsModifierConstructorDescriptionprotectedBsonResponse(io.undertow.server.HttpServerExchange exchange) -
Method Summary
Modifier and TypeMethodDescriptionstatic BsonResponseinit(io.undertow.server.HttpServerExchange exchange) static BsonResponseof(io.undertow.server.HttpServerExchange exchange) Reads the content as a String.voidsetContent(BsonUtils.ArrayBuilder builder) voidsetContent(BsonUtils.DocumentBuilder builder) voidsetInError(int code, String message, Throwable t) Methods inherited from class org.restheart.exchange.ServiceResponse
getContent, getCustomSender, of, setContent, setCustomSenderMethods inherited from class org.restheart.exchange.Response
getContentType, getContentType, getHeader, getHeader, getHeaders, getMDCContext, getStatusCode, setContentType, setContentTypeAsJson, setHeader, setHeader, setInError, setMDCContext, setStatusCodeMethods inherited from class org.restheart.exchange.Exchange
getExchange, getWrappedExchange, isAccountInRole, isAuthenticated, isAuthenticated, isContentTypeFormOrMultipart, isContentTypeFormOrMultipart, isContentTypeJson, isContentTypeJson, isContentTypeText, isContentTypeXml, isInError, isInError, responseInterceptorsExecuted, setInError, setInError, setResponseInterceptorsExecuted, updateBufferSize
-
Constructor Details
-
BsonResponse
protected BsonResponse(io.undertow.server.HttpServerExchange exchange)
-
-
Method Details
-
init
-
of
-
readContent
Description copied from class:ServiceResponseReads the content as a String. This method is used by ResponseSender to generate the response content to send to the client.- Specified by:
readContentin classServiceResponse<org.bson.BsonValue>- Returns:
- the content as string
-
setContent
-
setContent
-
setInError
- Specified by:
setInErrorin classServiceResponse<org.bson.BsonValue>- Parameters:
code-message-t-
-