Class BsonRequest

java.lang.Object
org.restheart.exchange.Exchange<org.bson.BsonValue>
org.restheart.exchange.Request<org.bson.BsonValue>
org.restheart.exchange.ServiceRequest<org.bson.BsonValue>
org.restheart.exchange.BsonRequest
Direct Known Subclasses:
MongoRequest

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

    • BsonRequest

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

    • init

      public static BsonRequest init(io.undertow.server.HttpServerExchange exchange)
    • of

      public static BsonRequest of(io.undertow.server.HttpServerExchange exchange)
    • parseContent

      public org.bson.BsonValue parseContent() throws IOException, BadRequestException
      Description copied from class: ServiceRequest
      Parses the content from the exchange and converts it into an instance of the specified type T. This method retrieves data from the exchange, interprets it according to the expected format, and attempts to convert this data into an object of type T.
      Specified by:
      parseContent in class ServiceRequest<org.bson.BsonValue>
      Returns:
      an instance of T representing the parsed content
      Throws:
      IOException - if an IO error occurs
      BadRequestException - if the content does not match the expected format for type T