public class RecordmActionPack extends Object
com.cultofbits.integrationm.service.properties
file
with the recordm
key;
for example:
action.names=...,<recordm-ap-name> action.<recordm-ap-name>=recordm action.<recordm-ap-name>.recordm.base-url=<url form RecordM service> (Optional. Defaults to "http://localhost:40280" )
Recomended recordm-ap-name: recordm
In case <recordm-ap-name> is recordm, in the IntegrationM scripts, you can refer to it only by `recordm.create(...)` otherwise you have to refer to it using `actionpacks.<recordm-ap-name>.create(...)`
Constructor and Description |
---|
RecordmActionPack(String url,
com.cultofbits.integrationm.service.internal.security.UserCookiesGenerator userCookiesGenerator) |
Modifier and Type | Method and Description |
---|---|
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
byte[] base64encodedContent)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
byte[] base64encodedContent,
Map<String,Object> options)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
byte[] base64encodedContent,
String runAsUser)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
File file)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
File file,
Map<String,Object> options)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
File file,
String runAsUser)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
InputStream content)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
InputStream content,
Map<String,Object> options)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<String> |
attach(int instanceId,
String field,
String filename,
InputStream content,
String runAsUser)
Attaches a file to the specified instance and
$file field. |
ReusableResponse<RecordmInstance> |
create(String definition,
Map<String,Object> values)
Creates a new instance of a record based on the provided definition and values.
|
void |
create(String definition,
Map<String,Object> values,
Consumer<javax.ws.rs.core.Response> processor,
Map<String,Object> options)
Deprecated.
|
ReusableResponse<RecordmInstance> |
create(String definition,
Map<String,Object> values,
Map<String,Object> options)
Creates a new instance of a record based on the provided definition and values.
|
void |
create(String definition,
Map<String,Object> values,
Map<String,Object> options,
Consumer<javax.ws.rs.core.Response> processor)
Creates a new instance of a record based on the provided definition, values, and options, and processes the response
using the specified consumer.
|
ReusableResponse<RecordmInstance> |
create(String definition,
Map<String,Object> values,
String runAsUser)
Creates a new instance of a record based on the provided definition and values.
|
ReusableResponse<RecordmStats> |
delete(String definition,
int instanceId)
Deletes an instance of a record with the specified instance ID.
|
ReusableResponse<RecordmStats> |
delete(String definition,
String condition)
Deletes multiple instances of records that match the specified condition.
|
ReusableResponse<RecordmStats> |
delete(String definition,
String condition,
Map<String,Object> options)
Deletes multiple instances of records that match the specified condition.
|
ReusableResponse<RecordmInstance> |
get(int instanceId)
Retrieves the instance of a record with the specified instance ID.
|
ReusableResponse<RecordmInstance> |
get(int instanceId,
String runAsUser)
Retrieves the instance of a record with the specified instance ID.
|
ReusableResponse<RecordmInstance> |
get(String instanceId)
Retrieves the instance of a record with the specified instance ID.
|
ReusableResponse<RecordmInstance> |
get(String instanceId,
String runAsUser)
Retrieves the instance of a record with the specified instance ID.
|
ReusableResponse<Definition> |
getDefinition(String name)
Retrieves the definition with the specified name.
|
SearchResult<RecordmSearchHit> |
search(String definition,
String query)
Searches for instances of records that match the provided query in the specified definition.
|
void |
search(String definition,
String query,
Consumer<javax.ws.rs.core.Response> processor)
Searches for instances of records that match the provided query in the specified definition and processes
the search response with the specified response processor.
|
SearchResult<RecordmSearchHit> |
search(String definition,
String query,
Map<String,String> options)
Searches for instances of records that match the provided query in the specified definition.
|
void |
search(String definition,
String query,
Map<String,String> options,
Consumer<javax.ws.rs.core.Response> processor)
Searches for instances of records that match the provided query in the specified definition and processes
the search response with the specified response processor and additional options.
|
void |
stream(String definition,
String query,
Consumer<RecordmSearchHit> hitConsumer)
Streams instances of records that match the provided query in the specified definition to the consumer.
|
void |
stream(String definition,
String query,
Map<String,String> options,
Consumer<RecordmSearchHit> hitConsumer)
Streams instances of records that match the provided query in the specified definition to the consumer,
using the provided search options.
|
void |
streamUntil(String definition,
String query,
Map<String,String> options,
Function<RecordmSearchHit,Boolean> hitConsumer)
Streams instances of records that match the provided query in the specified definition to the consumer,
using the provided search options, until the consumer's function returns false.
|
ReusableResponse<RecordmStats> |
update(String definition,
int instanceId,
Map<String,Object> updates)
Updates an instance of a Definition with the specified instance ID using the provided updates.
|
ReusableResponse<RecordmStats> |
update(String definition,
int instanceId,
Map<String,Object> updates,
Map<String,Object> options)
Updates an instance of a Definition with the specified instance ID using the provided updates.
|
ReusableResponse<RecordmStats> |
update(String definition,
int instanceId,
Map<String,Object> updates,
String runAsUser)
Updates an instance of a Definition with the specified instance ID using the provided updates.
|
void |
update(String definition,
int instanceId,
Map<String,Object> updates,
String runAsUser,
Consumer<javax.ws.rs.core.Response> processor)
Updates an instance of a Definition with the specified instance ID using the provided updates and runs the update operation with the specified user context.
|
ReusableResponse<RecordmStats> |
update(String definition,
String condition,
Map<String,Object> updates)
Updates multiple instances of records that match the specified condition using the provided updates.
|
ReusableResponse<RecordmStats> |
update(String definition,
String condition,
Map<String,Object> updates,
Map<String,Object> options)
Updates multiple instances of records that match the specified condition using the provided updates.
|
void |
update(String definition,
String condition,
Map<String,Object> updates,
Map<String,Object> options,
Consumer<javax.ws.rs.core.Response> processor)
Updates multiple instances of records that match the specified condition using the provided updates and additional options.
|
ReusableResponse<RecordmStats> |
update(String definition,
String condition,
Map<String,Object> updates,
String runAsUser)
Updates multiple instances of records that match the specified condition using the provided updates.
|
void |
update(String definition,
String condition,
Map<String,Object> updates,
String runAsUser,
Consumer<javax.ws.rs.core.Response> processor)
Updates multiple instances of records that match the specified condition using the provided updates and runs the update operation with the specified user context.
|
public RecordmActionPack(String url, com.cultofbits.integrationm.service.internal.security.UserCookiesGenerator userCookiesGenerator)
public ReusableResponse<String> attach(int instanceId, String field, String filename, byte[] base64encodedContent)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.base64encodedContent
- The content of the file in Base64-encoded format.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, byte[] base64encodedContent, Map<String,Object> options)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.base64encodedContent
- The content of the file in Base64-encoded format.options
- Additional options for customizing the attachment operation. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The list of available options are:
runAs
: The user under which the attachment operation should be performed.substituting
: the optional substitute value for the update operation.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, byte[] base64encodedContent, String runAsUser)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.base64encodedContent
- The content of the file in Base64-encoded format.runAsUser
- the username of the user running the operation, or null if not applicable.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, File file)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.file
- The File
object representing the file to be attached.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, File file, Map<String,Object> options)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.file
- The File
object representing the file to be attached.options
- Additional options for customizing the attachment operation. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The list of available options are:
runAs
: The user under which the attachment operation should be performed.substituting
: the optional substitute value for the update operation.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, File file, String runAsUser)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.file
- The File
object representing the file to be attached.runAsUser
- the username of the user running the operation, or null if not applicable.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, InputStream content)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.content
- The InputStream
containing the content of the file to be attached.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, InputStream content, Map<String,Object> options)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.content
- The InputStream
containing the content of the file to be attached.options
- Additional options for customizing the attachment operation. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The list of available options are:
runAs
: The user under which the attachment operation should be performed.substituting
: the optional substitute value for the update operation.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<String> attach(int instanceId, String field, String filename, InputStream content, String runAsUser)
Attaches a file to the specified instance and $file
field.
Note: to make the file available in the instance, the field value must be set to the file name. This should be done on a separate update.
instanceId
- The identifier of the instance to which the file will be attached.field
- The field to which the file will be attached. It can be the field name or the field definition ID
to ensure unambiguity when there are multiple fields with the same name.filename
- The name of the file being attached.content
- The InputStream
containing the content of the file to be attached.runAsUser
- the username of the user running the operation, or null if not applicable.ReusableResponse
containing a String response representing the result of the attachment operation.public ReusableResponse<RecordmInstance> create(String definition, Map<String,Object> values)
definition
- the definition of the record, specifying its structure and fields.values
- a Map containing the field names and corresponding values for the new instance.ReusableResponse
object containing the result of the instance creation operation. The response
includes information about the success or failure of the operation, any error messages,
and a RecordmInstance
object representing the created instance if the operation was successful.@Deprecated public void create(String definition, Map<String,Object> values, Consumer<javax.ws.rs.core.Response> processor, Map<String,Object> options)
create(String, Map, Map, Consumer)
public ReusableResponse<RecordmInstance> create(String definition, Map<String,Object> values, Map<String,Object> options)
definition
- the definition of the record, specifying its structure and fields.values
- a Map containing the field names and corresponding values for the new instance.options
- a Map containing additional options for the instance creation.
The list of options are:
ReusableResponse
object containing the result of the instance creation operation. The response
includes information about the success or failure of the operation, any error messages,
and a RecordmInstance
object representing the created instance if the operation was successful.public void create(String definition, Map<String,Object> values, Map<String,Object> options, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record, specifying its structure and fields.values
- a Map containing the field names and corresponding values for the new instance.options
- a Map containing additional options for the instance creation.
The list of options are:
processor
- a Consumer that processes the response of the instance creation operation.public ReusableResponse<RecordmInstance> create(String definition, Map<String,Object> values, String runAsUser)
definition
- the definition of the record, specifying its structure and fields.values
- a Map containing the field names and corresponding values for the new instance.runAsUser
- the username of the user running the operation, or null if not applicable.ReusableResponse
object containing the result of the instance creation operation. The response
includes information about the success or failure of the operation, any error messages,
and a RecordmInstance
object representing the created instance if the operation was successful.public ReusableResponse<RecordmStats> delete(String definition, int instanceId)
definition
- the definition of the record to which the instance belongs.instanceId
- the ID of the instance to be deleted.ReusableResponse
object containing the result of the instance delete operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic ReusableResponse<RecordmStats> delete(String definition, String condition)
definition
- the definition of the record to which the instances belong.condition
- the condition to filter instances that should be deleted. Instances that satisfy this condition
will be deleted.ReusableResponse
object containing the result of the delete operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmStats
object representing statistics on the delete operation.public ReusableResponse<RecordmStats> delete(String definition, String condition, Map<String,Object> options)
definition
- the definition of the record to which the instances belong.condition
- the condition to filter instances that should be deleted. Instances that satisfy this condition
will be deleted.options
- additional options for customizing the instance update. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
ignoreRefs
: if true, instances will be deleted even if they have other instances with $ref
fields pointing to them.tz
: a string with the time zone to use for the condition queryrunAs
: the user username under which the update operation should be performed.substituting
: the username of a user being substituted by the runAsUser.ReusableResponse
object containing the result of the delete operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmStats
object representing statistics on the delete operation.public ReusableResponse<RecordmInstance> get(int instanceId)
instanceId
- the ID of the instance to be retrieved.ReusableResponse
object containing the result of the retrieve operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmInstance
object representing the retrieved instance if the operation was successful.public ReusableResponse<RecordmInstance> get(int instanceId, String runAsUser)
instanceId
- the ID of the instance to be retrieved.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.ReusableResponse
object containing the result of the retrieve operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmInstance
object representing the retrieved instance if the operation was successful.public ReusableResponse<RecordmInstance> get(String instanceId)
instanceId
- the ID of the instance to be retrieved.ReusableResponse
object containing the result of the retrieve operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmInstance
object representing the retrieved instance if the operation was successful.public ReusableResponse<RecordmInstance> get(String instanceId, String runAsUser)
instanceId
- the ID of the instance to be retrieved.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.ReusableResponse
object containing the result of the retrieve operation. The response
includes information about the success or failure of the operation, any error messages, and a RecordmInstance
object representing the retrieved instance if the operation was successful.public ReusableResponse<Definition> getDefinition(String name)
name
- the name of the definition to be retrieved.ReusableResponse
object containing the result of the retrieve operation. The response
includes information about the success or failure of the operation, any error messages, and a Definition
object representing the retrieved record definition if the operation was successful.public SearchResult<RecordmSearchHit> search(String definition, String query)
stream(String, String, Consumer)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.SearchResult
object containing the result of the search operation. The SearchResult
includes a list of RecordmSearchHit
objects that represent the matching instances and additional information
such as the total count of matching instances.public void search(String definition, String query, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.processor
- a Consumer
to process the Response
of the update operation. This allows
the caller to perform additional actions with the response, such as handling success or failure
scenarios.public SearchResult<RecordmSearchHit> search(String definition, String query, Map<String,String> options)
stream(String, String, Map, Consumer)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.options
- additional options for customizing the search. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
size
: the number of results to return. Defaults to 30.sort
: a comma-separated list of fields and sort directions. E.g. field1:asc,field2:desc
tz
: a string with the time zone to use for the queryrunAs
: the user under which the search operation should be performed.SearchResult
object containing the result of the search operation. The SearchResult
includes a list of RecordmSearchHit
objects that represent the matching instances and additional information
such as the total count of matching instances.public void search(String definition, String query, Map<String,String> options, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.options
- additional options for customizing the search. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
size
: the number of results to return. Defaults to 30.sort
: a comma-separated list of fields and sort directions. E.g. field1:asc,field2:desc
tz
: a string with the time zone to use for the queryrunAs
: the user under which the search operation should be performed.processor
- a Consumer
to process the Response
of the update operation. This allows
the caller to perform additional actions with the response, such as handling success or failure
scenarios.public void stream(String definition, String query, Consumer<RecordmSearchHit> hitConsumer)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.hitConsumer
- a Consumer
to consume the matching instances of RecordmSearchHit
as they are streamed. This allows
the caller to process the instances in real-time without loading all of them into memory at once.public void stream(String definition, String query, Map<String,String> options, Consumer<RecordmSearchHit> hitConsumer)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.options
- additional options for customizing the search. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
size
: the number of results to return. Defaults to 30.sort
: a comma-separated list of fields and sort directions. E.g. field1:asc,field2:desc
tz
: a string with the time zone to use for the queryrunAs
: the user under which the search operation should be performed.hitConsumer
- a Consumer
to consume the matching instances of RecordmSearchHit
as they are streamed. This allows
the caller to process the instances in real-time without loading all of them into memory at once.public void streamUntil(String definition, String query, Map<String,String> options, Function<RecordmSearchHit,Boolean> hitConsumer)
definition
- the definition of the record to search.query
- the search query to be used for finding instances.options
- additional options for customizing the search. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
size
: the number of results to return. Defaults to 30.sort
: a comma-separated list of fields and sort directions. E.g. field1:asc,field2:desc
tz
: a string with the time zone to use for the queryrunAs
: the user under which the search operation should be performed.hitConsumer
- a Function
that receives a RecordmSearchHit
and returns a Boolean
that will consume the matching instances as they are streamed.
This allows the caller to process the instances in real-time until the consumer's condition is met.
The function should return true
to continue streaming more instances, or false
to stop
further streaming.public ReusableResponse<RecordmStats> update(String definition, int instanceId, Map<String,Object> updates)
definition
- the definition of the record to which the instance belongs.instanceId
- the ID of the instance to be updated.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.ReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic ReusableResponse<RecordmStats> update(String definition, int instanceId, Map<String,Object> updates, Map<String,Object> options)
definition
- the definition of the record to which the instance belongs.instanceId
- the ID of the instance to be updated.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.options
- additional options for customizing the instance update. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
runAs
: the user username under which the update operation should be performed.substituting
: the username of a user being substituted by the runAsUser.ReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic ReusableResponse<RecordmStats> update(String definition, int instanceId, Map<String,Object> updates, String runAsUser)
definition
- the definition of the record to which the instance belongs.instanceId
- the ID of the instance to be updated.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.ReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic void update(String definition, int instanceId, Map<String,Object> updates, String runAsUser, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record to which the instance belongs.instanceId
- the ID of the instance to be updated.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.processor
- a Consumer
to process the Response
of the update operation. This allows
the caller to perform additional actions with the response, such as handling success or failure
scenarios.public ReusableResponse<RecordmStats> update(String definition, String condition, Map<String,Object> updates)
definition
- the definition of the record to which the instance belongs.condition
- the condition (an ES query_string query) to filter instances that should be updated. Instances that satisfy this condition
will be updated with the provided updates.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.ReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic ReusableResponse<RecordmStats> update(String definition, String condition, Map<String,Object> updates, Map<String,Object> options)
definition
- the definition of the record to which the instance belongs.condition
- the condition (an ES query_string query) to filter instances that should be updated. Instances that satisfy this condition
will be updated with the provided updates.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.options
- additional options for customizing the instance update. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
runAs
: the user username under which the update operation should be performed.substituting
: the username of a user being substituted by the runAsUser.tz
: a string with the time zone to use for the condition queryReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic void update(String definition, String condition, Map<String,Object> updates, Map<String,Object> options, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record to which the instances belong.condition
- the condition to filter instances that should be updated. Instances that satisfy this condition
will be updated with the provided updates.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.options
- additional options for customizing the instance update. The options are provided as a map
where the keys represent the option names, and the values contain the corresponding option values.
The available options are:
runAsUser
: the user under which the update operation should be performed.substituting
: the optional substitute value for the update operation.tz
: a string with the time zone to use for the condition queryprocessor
- a Consumer
to process the Response
of the update operation. This allows the caller
to perform additional actions with the response, such as handling success or failure scenarios.public ReusableResponse<RecordmStats> update(String definition, String condition, Map<String,Object> updates, String runAsUser)
definition
- the definition of the record to which the instance belongs.condition
- the condition (an ES query_string query) to filter instances that should be updated. Instances that satisfy this condition
will be updated with the provided updates.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.ReusableResponse
object containing the result of the instance update operation. The response includes
information about the success or failure of the operation, any error messages, and an RecordmStats
object with the statistics associated to the operationpublic void update(String definition, String condition, Map<String,Object> updates, String runAsUser, Consumer<javax.ws.rs.core.Response> processor)
definition
- the definition of the record to which the instances belong.condition
- the condition (an ES query_string query) to filter instances that should be updated. Instances that satisfy this condition
will be updated with the provided updates.updates
- a Map
containing the updates to be applied to the instance. The keys represent the name of the fields
to be updated, and the corresponding values contain the new values for those fields.runAsUser
- the user under which the creation operation should be performed, or null if not applicable.processor
- a Consumer
to process the Response
of the update operation. This allows
the caller to perform additional actions with the response, such as handling success or failure
scenarios.Copyright © 2021 Cult Of Bits, lda