Package org.restheart.exchange
Class BsonResponse
- java.lang.Object
-
- org.restheart.exchange.Exchange<T>
-
- org.restheart.exchange.Response<T>
-
- org.restheart.exchange.ServiceResponse<org.bson.BsonValue>
-
- org.restheart.exchange.BsonResponse
-
- Direct Known Subclasses:
MongoResponse
public class BsonResponse extends ServiceResponse<org.bson.BsonValue>
ServiceResponse implementation backed by BsonValue- Author:
- Andrea Di Cesare
-
-
Field Summary
-
Fields inherited from class org.restheart.exchange.ServiceResponse
content
-
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 Modifier Constructor Description protectedBsonResponse(io.undertow.server.HttpServerExchange exchange)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BsonResponseinit(io.undertow.server.HttpServerExchange exchange)static BsonResponseof(io.undertow.server.HttpServerExchange exchange)StringreadContent()Reads the content as a String.voidsetInError(int code, String message, Throwable t)-
Methods inherited from class org.restheart.exchange.ServiceResponse
getContent, of, setContent
-
Methods inherited from class org.restheart.exchange.Response
getContentType, getContentType, getMDCContext, getStatusCode, setContentType, setContentTypeAsJson, setInError, setMDCContext, setStatusCode, type
-
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
-
init
public static BsonResponse init(io.undertow.server.HttpServerExchange exchange)
-
of
public static BsonResponse of(io.undertow.server.HttpServerExchange exchange)
-
readContent
public String 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
-
setInError
public void setInError(int code, String message, Throwable t)- Specified by:
setInErrorin classServiceResponse<org.bson.BsonValue>t- can be null
-
-