Modifier and Type | Field and Description |
---|---|
static String |
ACTION_ID_CREATE
The name of the action which is reserved for performing "create" operations.
|
static String |
FIELD_CONTENT
The name of the field which contains the resource content in the JSON representation.
|
static String |
FIELD_NEW_RESOURCE_ID
The name of the field which contains the new resource ID in the JSON representation.
|
FIELD_ADDITIONAL_PARAMETERS, FIELD_FIELDS, FIELD_RESOURCE_PATH, FIELD_VALUE_ALL
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(RequestVisitor<R,P> v,
P p)
Applies a
RequestVisitor to this Request . |
CreateRequest |
addField(JsonPointer... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
CreateRequest |
addField(String... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
String |
getAdditionalParameter(String name)
Returns the additional parameter which should be used to control the behavior of this action request.
|
Map<String,String> |
getAdditionalParameters()
Returns the additional parameters which should be used to control the behavior of this action request.
|
JsonValue |
getContent()
Returns the content of the JSON resource to be created.
|
List<JsonPointer> |
getFields()
Returns the list of fields which should be included with each JSON resource returned by this request.
|
String |
getNewResourceId()
Returns the client provided ID of the resource to be created.
|
PreferredLocales |
getPreferredLocales()
Get the locale preference for the request.
|
RequestType |
getRequestType()
Returns the type of this request.
|
String |
getResourcePath()
Returns the path of the JSON resource container beneath which the new resource should be created.
|
ResourcePath |
getResourcePathObject()
Returns the non-
null path of the JSON resource to which this request should be targeted. |
Version |
getResourceVersion()
Gets the requested API version of the resource.
|
CreateRequest |
setAdditionalParameter(String name,
String value)
Sets an additional parameter which should be used to control the behavior of this action request.
|
CreateRequest |
setContent(JsonValue content)
Sets the content of the JSON resource to be created.
|
CreateRequest |
setNewResourceId(String id)
Sets the client provided ID of the resource to be created.
|
CreateRequest |
setPreferredLocales(PreferredLocales preferredLocales)
Set the locale preference for the request.
|
CreateRequest |
setResourcePath(ResourcePath path)
Sets the non-
null path of the JSON resource to which this request should be targeted. |
CreateRequest |
setResourcePath(String path)
Sets the path of the JSON resource container beneath which the new resource should be created.
|
CreateRequest |
setResourceVersion(Version resourceVersion)
Sets the requested API version of the resource.
|
JsonValue |
toJsonValue()
Return a JsonValue representation of this request.
|
static final String ACTION_ID_CREATE
static final String FIELD_CONTENT
static final String FIELD_NEW_RESOURCE_ID
<R,P> R accept(RequestVisitor<R,P> v, P p)
Request
RequestVisitor
to this Request
.CreateRequest addField(JsonPointer... fields)
Request
CreateRequest addField(String... fields)
Request
String getAdditionalParameter(String name)
Request
getAdditionalParameter
in interface Request
name
- The name of the additional parameter.Map<String,String> getAdditionalParameters()
Request
getAdditionalParameters
in interface Request
null
).JsonValue getContent()
List<JsonPointer> getFields()
Request
NOTE: field filtering alters the structure of a JSON resource and MUST only be performed once while processing a request. It is therefore the responsibility of front-end implementations (e.g. HTTP listeners, Servlets, etc) to perform field filtering. Request handler and resource provider implementations SHOULD NOT filter fields, but MAY choose to optimise their processing in order to return a resource containing only the fields targeted by the field filters.
String getNewResourceId()
The new resource ID is optional and should be used in cases where the client wishes to determine the path of the resource to be created. If the new resource ID is not provided then the server will be responsible for generating the ID of the new resource.
null
if the server should be responsible
for generating the resource ID.CreateRequest.getResourcePath()
PreferredLocales getPreferredLocales()
Request
getPreferredLocales
in interface Request
PreferredLocales
instance for the request.RequestType getRequestType()
Request
getRequestType
in interface Request
String getResourcePath()
The path of the newly created resource will be the concatenation of the resource path and either the client provided resource ID, if provided, or a server generated resource ID.
getResourcePath
in interface Request
CreateRequest.getNewResourceId()
ResourcePath getResourcePathObject()
Request
null
path of the JSON resource to which this request should be targeted. The resource
path is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
getResourcePathObject
in interface Request
null
path of the JSON resource to which this request should be targeted, which may be the
empty string.Version getResourceVersion()
Request
getResourceVersion
in interface Request
CreateRequest setAdditionalParameter(String name, String value) throws BadRequestException
Request
setAdditionalParameter
in interface Request
name
- The name of the additional parameter.value
- The additional parameter's value.BadRequestException
- If this request does not permit the additional parameter to be set.CreateRequest setContent(JsonValue content)
content
- The content of the JSON resource to be created.UnsupportedOperationException
- If this create request does not permit changes to the content.CreateRequest setNewResourceId(String id)
The new resource ID is optional and should be used in cases where the client wishes to determine the path of the resource to be created. If the new resource ID is not provided then the server will be responsible for generating the ID of the new resource.
id
- The client provided ID of the resource to be created, or null
if the server should be responsible
for generating the resource ID.UnsupportedOperationException
- If this create request does not permit changes to the new resource ID.CreateRequest.setResourcePath(String)
CreateRequest setPreferredLocales(PreferredLocales preferredLocales)
Request
setPreferredLocales
in interface Request
preferredLocales
- The PreferredLocales
instance for the request.CreateRequest setResourcePath(String path)
The path of the newly created resource will be the concatenation of the resource path and either the client provided resource ID, if provided, or a server generated resource ID.
setResourcePath
in interface Request
path
- The path of the JSON resource container beneath which the new resource should be created.UnsupportedOperationException
- If this create request does not permit changes to the resource path.CreateRequest.setNewResourceId(String)
CreateRequest setResourcePath(ResourcePath path)
Request
null
path of the JSON resource to which this request should be targeted. The resource path
is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
setResourcePath
in interface Request
path
- The non-null
path of the JSON resource to which this request should be targeted, which may be the
empty string.CreateRequest setResourceVersion(Version resourceVersion)
Request
setResourceVersion
in interface Request
resourceVersion
- The requested API version of the resource.JsonValue toJsonValue()
Request
toJsonValue
in interface Request
Copyright © 2010-2018, ForgeRock All Rights Reserved.