Class CrestHttp

java.lang.Object
org.forgerock.json.resource.http.CrestHttp

public final class CrestHttp extends Object

A CREST HTTP utility class which creates instances of the HttpAdapter to handle CREST HTTP requests.

Instances must be provided with a ConnectionFactory in order to operate and optionally a HttpContextFactory.

  • Method Details

    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(ConnectionFactory connectionFactory)
      Deprecated.
      Creates a new JSON resource HTTP Handler with the provided connection factory and no context factory.
      Parameters:
      connectionFactory - The connection factory.
      Returns:
      A CREST HTTP Handler.
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(ConnectionFactory connectionFactory, Context parentContext)
      Deprecated.
      Creates a new JSON resource HTTP Handler with the provided connection factory and a context factory which will always return the provided request context.
      Parameters:
      connectionFactory - The connection factory.
      parentContext - The parent request context which should be used as the parent context of each request context.
      Returns:
      A HTTP Handler.
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(ConnectionFactory connectionFactory, HttpContextFactory contextFactory)
      Deprecated.
      Creates a new JSON resource HTTP Handler with the provided connection factory and context factory.
      Parameters:
      connectionFactory - The connection factory.
      contextFactory - The context factory which will be used to obtain the parent context of each request context.
      Returns:
      A HTTP Handler.
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(RequestHandler handler)
      Deprecated.
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      handler - The RequestHandler.
      Returns:
      A HTTP Handler.
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(CrestApplication application)
      Deprecated.
      Since 25.0.0. Prefer to use newHttpHandler(CrestApplication, Factory) and provide your own factory instead of the default one.
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      Returns:
      The handler
    • newHttpHandler

      public static Handler newHttpHandler(CrestApplication application, Factory<Buffer> bufferFactory)
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      bufferFactory - The factory to create buffers to store temporary data.
      Returns:
      The handler
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(CrestApplication application, HttpContextFactory factory)
      Deprecated.
      Since 25.0.0. Prefer to use newHttpHandler(CrestApplication, HttpContextFactory, Factory) and provide your own factory instead of the default one.
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      factory - A factory for creating parent HTTP Contexts.
      Returns:
      The handler
    • newHttpHandler

      public static Handler newHttpHandler(CrestApplication application, HttpContextFactory factory, Factory<Buffer> bufferFactory)
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      factory - A factory for creating parent HTTP Contexts.
      bufferFactory - The factory to create buffers to store temporary data.
      Returns:
      The handler
    • newHttpHandler

      @Deprecated public static Handler newHttpHandler(CrestApplication application, Context context)
      Deprecated.
      Since 25.0.0. Prefer to use newHttpHandler(CrestApplication, Context, Factory) and provide your own factory instead of the default one.
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      context - The parent context to use for all contexts.
      Returns:
      The handler
    • newHttpHandler

      public static Handler newHttpHandler(CrestApplication application, Context context, Factory<Buffer> bufferFactory)
      Creates a new JSON resource HTTP handler with the provided CREST request handler.
      Parameters:
      application - The application.
      context - The parent context to use for all contexts.
      bufferFactory - The factory to create buffers to store temporary data.
      Returns:
      The handler
    • newRequestHandler

      public static RequestHandler newRequestHandler(Handler handler, URI uri)
      Creates a new RequestHandler that map back and forth JSON resource objects to CHF objects.
      Parameters:
      handler - HTTP Handler responsible for emitting the HTTP request build from JSON resource Requests.
      uri - base URI used to build the target URI for built HTTP message
      Returns:
      a JSON resource RequestHandler
    • newConnectionFactory

      public static ConnectionFactory newConnectionFactory(Handler handler, URI uri)
      Creates a new ConnectionFactory that map back and forth JSON resource objects to CHF objects.

      Convenience method. Note that ConnectionFactory is going to be removed soon, so you may not need this.

      Parameters:
      handler - HTTP Handler responsible for emitting the HTTP request build from JSON resource Requests.
      uri - base URI used to build the target URI for built HTTP message
      Returns:
      a JSON resource RequestHandler