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 ConnectionFactorynewConnectionFactory(org.forgerock.http.Handler handler, URI uri) Creates a newConnectionFactorythat map back and forth JSON resource objects to CHF objects.static org.forgerock.http.HandlernewHttpHandler(ConnectionFactory connectionFactory) Deprecated.static org.forgerock.http.HandlernewHttpHandler(ConnectionFactory connectionFactory, HttpContextFactory contextFactory) Deprecated.UsenewHttpHandler(CrestApplication)instead.static org.forgerock.http.HandlernewHttpHandler(ConnectionFactory connectionFactory, org.forgerock.services.context.Context parentContext) Deprecated.UsenewHttpHandler(CrestApplication)instead.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application) Deprecated.Since 25.0.0.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application, HttpContextFactory factory) Deprecated.Since 25.0.0.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application, HttpContextFactory factory, Factory<org.forgerock.http.io.Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application, org.forgerock.services.context.Context context) Deprecated.Since 25.0.0.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application, org.forgerock.services.context.Context context, Factory<org.forgerock.http.io.Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static org.forgerock.http.HandlernewHttpHandler(CrestApplication application, Factory<org.forgerock.http.io.Buffer> bufferFactory) Creates a new JSON resource HTTP handler with the provided CREST request handler.static org.forgerock.http.HandlernewHttpHandler(RequestHandler handler) Deprecated.UsenewHttpHandler(CrestApplication)instead.static RequestHandlernewRequestHandler(org.forgerock.http.Handler handler, URI uri) Creates a newRequestHandlerthat map back and forth JSON resource objects to CHF objects.
-
Method Details
-
newHttpHandler
@Deprecated public static org.forgerock.http.Handler newHttpHandler(ConnectionFactory connectionFactory) 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 org.forgerock.http.Handler newHttpHandler(ConnectionFactory connectionFactory, org.forgerock.services.context.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 org.forgerock.http.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
public static org.forgerock.http.Handler newHttpHandler(CrestApplication application, Factory<org.forgerock.http.io.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 org.forgerock.http.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 org.forgerock.http.Handler newHttpHandler(CrestApplication application, HttpContextFactory factory, Factory<org.forgerock.http.io.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 org.forgerock.http.Handler newHttpHandler(CrestApplication application, org.forgerock.services.context.Context context) 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 org.forgerock.http.Handler newHttpHandler(CrestApplication application, org.forgerock.services.context.Context context, Factory<org.forgerock.http.io.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 newRequestHandlerthat map back and forth JSON resource objects to CHF objects.- Parameters:
handler- HTTPHandlerresponsible for emitting the HTTP request build from JSON resourceRequests.uri- base URI used to build the target URI for built HTTP message- Returns:
- a JSON resource
RequestHandler
-
newConnectionFactory
Creates a newConnectionFactorythat 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- HTTPHandlerresponsible for emitting the HTTP request build from JSON resourceRequests.uri- base URI used to build the target URI for built HTTP message- Returns:
- a JSON resource
RequestHandler
-
newHttpHandler(CrestApplication)instead.