Modifier and Type | Method and Description |
---|---|
static RequestHandler |
asRequestHandler(SynchronousRequestHandler syncHandler)
Adapts the provided
SynchronousRequestHandler as a
RequestHandler . |
static JsonValue |
filterResource(JsonValue resource,
Collection<JsonPointer> fields)
Returns a JSON object containing only the specified fields from the
provided JSON value.
|
static ResourceResponse |
filterResource(ResourceResponse resource,
Collection<JsonPointer> fields)
Returns a JSON object containing only the specified fields from the
provided resource.
|
static RequestHandler |
newAnnotatedRequestHandler(Object provider)
Returns a new request handler which will forward requests on to the
provided annotated request handler.
|
static RequestHandler |
newCollection(Object provider)
Returns a new request handler which will forward requests on to the
provided collection resource provider.
|
static Connection |
newInternalConnection(RequestHandler handler)
Creates a new connection to a
RequestHandler . |
static ConnectionFactory |
newInternalConnectionFactory(RequestHandler handler)
Creates a new connection factory which binds internal client connections
to
RequestHandler s. |
static RequestHandler |
newSingleton(Object provider)
Returns a new request handler which will forward requests on to the
provided singleton resource provider.
|
static Connection |
uncloseable(Connection connection)
Returns an uncloseable view of the provided connection.
|
static ConnectionFactory |
uncloseable(ConnectionFactory factory)
Returns an uncloseable view of the provided connection factory.
|
public static RequestHandler asRequestHandler(SynchronousRequestHandler syncHandler)
SynchronousRequestHandler
as a
RequestHandler
.syncHandler
- The synchronous request handler to be adapted.public static JsonValue filterResource(JsonValue resource, Collection<JsonPointer> fields)
NOTE: this method only performs a shallow copy of extracted fields, so changes to the filtered JSON value may impact the original JSON value, and vice-versa.
resource
- The JSON value whose fields are to be filtered.fields
- The list of fields to be extracted.public static ResourceResponse filterResource(ResourceResponse resource, Collection<JsonPointer> fields)
NOTE: this method only performs a shallow copy of extracted fields, so changes to the filtered resource may impact the original resource, and vice-versa.
resource
- The resource whose fields are to be filtered.fields
- The list of fields to be extracted.public static RequestHandler newCollection(Object provider)
provider
- The collection resource provider. Either an implementation of CollectionResourceProvider
or
a POJO annotated with annotations from org.forgerock.json.resource.annotations
.public static Connection newInternalConnection(RequestHandler handler)
RequestHandler
.handler
- The request handler to which client requests should be
forwarded.NullPointerException
- If handler
was null
.public static ConnectionFactory newInternalConnectionFactory(RequestHandler handler)
RequestHandler
s.handler
- The request handler to which client requests should be
forwarded.NullPointerException
- If handler
was null
.public static RequestHandler newSingleton(Object provider)
provider
- The singleton resource provider. Either an implementation of SingletonResourceProvider
or
a POJO annotated with annotations from org.forgerock.json.resource.annotations
.public static RequestHandler newAnnotatedRequestHandler(Object provider)
provider
- The POJO annotated with annotations from org.forgerock.json.resource.annotations
.public static Connection uncloseable(Connection connection)
Connection.close()
will be ignored.connection
- The connection whose close
method is to be disabled.public static ConnectionFactory uncloseable(ConnectionFactory factory)
ConnectionFactory.close()
will be ignored.factory
- The connection factory whose close
method is to be
disabled.Copyright 2010-2017 ForgeRock AS.