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

public class BsonResponse extends ServiceResponse<org.bson.BsonValue>
ServiceResponse implementation backed by BsonValue
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Constructor Details

    • BsonResponse

      protected BsonResponse(io.undertow.server.HttpServerExchange exchange)
  • Method Details

    • 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: ServiceResponse
      Reads the content as a String. This method is used by ResponseSender to generate the response content to send to the client.
      Specified by:
      readContent in class ServiceResponse<org.bson.BsonValue>
      Returns:
      the content as string
    • setContent

      public void setContent(BsonUtils.ArrayBuilder builder)
    • setContent

      public void setContent(BsonUtils.DocumentBuilder builder)
    • setInError

      public void setInError(int code, String message, Throwable t)
      Specified by:
      setInError in class ServiceResponse<org.bson.BsonValue>
      Parameters:
      code -
      message -
      t -