Class JsonProxyRequest

java.lang.Object
org.restheart.exchange.Exchange<com.google.gson.JsonElement>
org.restheart.exchange.Request<com.google.gson.JsonElement>
org.restheart.exchange.ProxyRequest<com.google.gson.JsonElement>
org.restheart.exchange.JsonProxyRequest
All Implemented Interfaces:
AutoCloseable, BufferedExchange<com.google.gson.JsonElement>

public class JsonProxyRequest extends ProxyRequest<com.google.gson.JsonElement>
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Constructor Details

    • JsonProxyRequest

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

    • of

      public static JsonProxyRequest of(io.undertow.server.HttpServerExchange exchange)
    • readContent

      public com.google.gson.JsonElement readContent() throws IOException
      Description copied from interface: BufferedExchange
      reads data from the buffer converting it to T
      Specified by:
      readContent in interface BufferedExchange<com.google.gson.JsonElement>
      Specified by:
      readContent in class ProxyRequest<com.google.gson.JsonElement>
      Returns:
      the content as Json
      Throws:
      IOException
    • writeContent

      public void writeContent(com.google.gson.JsonElement content) throws IOException
      updates the request content allocates the PooledByteBuffer array so close() must be invoked to avoid memory leaks
      Specified by:
      writeContent in interface BufferedExchange<com.google.gson.JsonElement>
      Specified by:
      writeContent in class ProxyRequest<com.google.gson.JsonElement>
      Parameters:
      content -
      Throws:
      IOException