Package org.forgerock.json.resource.http
Class CrestHttp
java.lang.Object
org.forgerock.json.resource.http.CrestHttp
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 Summary
Modifier and TypeMethodDescriptionstatic ConnectionFactory
newConnectionFactory
(Handler handler, URI uri) Creates a newConnectionFactory
that map back and forth JSON resource objects to CHF objects.static Handler
newHttpHandler
(ConnectionFactory connectionFactory) Deprecated.static Handler
newHttpHandler
(ConnectionFactory connectionFactory, HttpContextFactory contextFactory) Deprecated.UsenewHttpHandler(CrestApplication)
instead.static Handler
newHttpHandler
(ConnectionFactory connectionFactory, Context parentContext) Deprecated.UsenewHttpHandler(CrestApplication)
instead.static Handler
newHttpHandler
(CrestApplication application) Deprecated.Since 25.0.0.static Handler
newHttpHandler
(CrestApplication application, HttpContextFactory factory) Deprecated.Since 25.0.0.static Handler
newHttpHandler
(CrestApplication application, HttpContextFactory factory, Factory<Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static Handler
newHttpHandler
(CrestApplication application, Context context) Deprecated.Since 25.0.0.static Handler
newHttpHandler
(CrestApplication application, Context context, Factory<Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static Handler
newHttpHandler
(CrestApplication application, Factory<Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static Handler
newHttpHandler
(RequestHandler handler) Deprecated.UsenewHttpHandler(CrestApplication)
instead.static RequestHandler
newRequestHandler
(Handler handler, URI uri) Creates a newRequestHandler
that map back and forth JSON resource objects to CHF objects.
-
Method Details
-
newHttpHandler
Deprecated.UsenewHttpHandler(CrestApplication)
instead.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.UsenewHttpHandler(CrestApplication)
instead.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.UsenewHttpHandler(CrestApplication)
instead.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.UsenewHttpHandler(CrestApplication)
instead.Creates a new JSON resource HTTP handler with the provided CREST request handler.- Parameters:
handler
- TheRequestHandler
.- Returns:
- A HTTP Handler.
-
newHttpHandler
Deprecated.Since 25.0.0. Prefer to usenewHttpHandler(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
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 usenewHttpHandler(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.Since 25.0.0. Prefer to usenewHttpHandler(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
Creates a newRequestHandler
that map back and forth JSON resource objects to CHF objects.- Parameters:
handler
- HTTPHandler
responsible for emitting the HTTP request build from JSON resourceRequest
s.uri
- base URI used to build the target URI for built HTTP message- Returns:
- a JSON resource
RequestHandler
-
newConnectionFactory
Creates a newConnectionFactory
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
- HTTPHandler
responsible for emitting the HTTP request build from JSON resourceRequest
s.uri
- base URI used to build the target URI for built HTTP message- Returns:
- a JSON resource
RequestHandler
-
newHttpHandler(CrestApplication)
instead.