@Transactional(rollbackFor={GenieException.class,GenieRuntimeException.class,javax.validation.ConstraintViolationException.class}) public class JpaCommandPersistenceServiceImpl extends java.lang.Object implements CommandPersistenceService
CommandPersistenceService
interface.Constructor and Description |
---|
JpaCommandPersistenceServiceImpl(JpaTagPersistenceService tagPersistenceService,
JpaFilePersistenceService filePersistenceService,
JpaApplicationRepository applicationRepository,
JpaClusterRepository clusterRepository,
JpaCommandRepository commandRepository,
JpaCriterionRepository criterionRepository)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicationsForCommand(@NotBlank(message="No command id entered. Unable to add applications.") java.lang.String id,
@NotEmpty(message="No application ids entered. Unable to add applications.") java.util.List<java.lang.String> applicationIds)
Add applications for the command.
|
void |
addClusterCriterionForCommand(java.lang.String id,
@Valid Criterion criterion)
Add a new
Criterion to the existing list of cluster criteria for the command identified by id. |
void |
addClusterCriterionForCommand(java.lang.String id,
@Valid Criterion criterion,
@Min(value=0L) int priority)
Add a new
Criterion to the existing list of cluster criteria for the command identified by id. |
void |
addConfigsForCommand(@NotBlank(message="No command id entered. Unable to add configurations.") java.lang.String id,
@NotEmpty(message="No configuration files entered. Unable to add.") java.util.Set<java.lang.String> configs)
Add a configuration files to the command.
|
void |
addDependenciesForCommand(@NotBlank(message="No command id entered. Unable to add dependencies.") java.lang.String id,
@NotEmpty(message="No dependencies entered. Unable to add dependencies.") java.util.Set<java.lang.String> dependencies)
Add dependency files to the command.
|
void |
addTagsForCommand(@NotBlank(message="No command id entered. Unable to add tags.") java.lang.String id,
@NotEmpty(message="No tags entered. Unable to add.") java.util.Set<java.lang.String> tags)
Add tags to the command.
|
java.lang.String |
createCommand(@NotNull(message="No command entered. Unable to create.") @Valid CommandRequest request)
Create new command configuration.
|
void |
deleteAllCommands()
Delete all commands from database.
|
void |
deleteCommand(@NotBlank(message="No id entered. Unable to delete.") java.lang.String id)
Delete a command configuration from database.
|
long |
deleteUnusedCommands(java.util.Set<CommandStatus> deleteStatuses,
java.time.Instant commandCreatedThreshold)
Bulk delete commands from the database where their status is in deleteStatuses they were created
before commandCreatedThreshold and they aren't attached to any jobs still in the database.
|
java.util.Set<Command> |
findCommandsMatchingCriterion(@Valid Criterion criterion,
boolean addDefaultStatus)
|
java.util.List<Application> |
getApplicationsForCommand(@NotBlank(message="No command id entered. Unable to get applications.") java.lang.String id)
Get the applications for a given command.
|
java.util.List<Criterion> |
getClusterCriteriaForCommand(java.lang.String id)
For the given command id return the Cluster
Criterion in priority order that is currently
associated with this command if any. |
java.util.Set<Cluster> |
getClustersForCommand(@NotBlank(message="No command id entered. Unable to get clusters.") java.lang.String id,
java.util.Set<ClusterStatus> statuses)
Get all the clusters the command with given id is associated with.
|
Command |
getCommand(@NotBlank(message="No id entered unable to get.") java.lang.String id)
Gets command configuration for given id.
|
org.springframework.data.domain.Page<Command> |
getCommands(java.lang.String name,
java.lang.String user,
java.util.Set<CommandStatus> statuses,
java.util.Set<java.lang.String> tags,
org.springframework.data.domain.Pageable page)
Get command configurations for given filter criteria.
|
java.util.Set<java.lang.String> |
getConfigsForCommand(@NotBlank(message="No command id entered. Unable to get configs.") java.lang.String id)
Get the set of configuration files associated with the command with given
id.
|
java.util.Set<java.lang.String> |
getDependenciesForCommand(@NotBlank(message="No command id entered. Unable to get dependencies.") java.lang.String id)
Get the set of dependency files associated with the command with given id.
|
java.util.Set<java.lang.String> |
getTagsForCommand(@NotBlank(message="No command id sent. Cannot retrieve tags.") java.lang.String id)
Get the set of tags associated with the command with given
id.
|
void |
patchCommand(@NotBlank java.lang.String id,
@NotNull com.github.fge.jsonpatch.JsonPatch patch)
Patch a command with the given json patch.
|
void |
removeAllClusterCriteriaForCommand(java.lang.String id)
Remove all the
Criterion currently associated with the command identified by id. |
void |
removeAllConfigsForCommand(@NotBlank(message="No command id entered. Unable to remove configs.") java.lang.String id)
Remove all configuration files from the command.
|
void |
removeAllDependenciesForCommand(@NotBlank(message="No command id entered. Unable to remove dependencies.") java.lang.String id)
Remove all dependency files from the command.
|
void |
removeAllTagsForCommand(@NotBlank(message="No command id entered. Unable to remove tags.") java.lang.String id)
Remove all tags from the command.
|
void |
removeApplicationForCommand(@NotBlank(message="No command id entered. Unable to remove application.") java.lang.String id,
@NotBlank(message="No application id entered. Unable to remove application.") java.lang.String appId)
Remove the application from the command.
|
void |
removeApplicationsForCommand(@NotBlank(message="No command id entered. Unable to remove applications.") java.lang.String id)
Remove the applications from the command.
|
void |
removeClusterCriterionForCommand(java.lang.String id,
@Min(value=0L) int priority)
Remove the
Criterion with the given priority from the current list of cluster criteria
associated with the command identified by id. |
void |
removeConfigForCommand(@NotBlank(message="No command id entered. Unable to remove configuration.") java.lang.String id,
@NotBlank(message="No config entered. Unable to remove.") java.lang.String config)
Remove a configuration file from the command.
|
void |
removeDependencyForCommand(@NotBlank(message="No command id entered. Unable to remove dependency.") java.lang.String id,
@NotBlank(message="No dependency entered. Unable to remove dependency.") java.lang.String dependency)
Remove a dependency file from the command.
|
void |
removeTagForCommand(@NotBlank(message="No command id entered. Unable to remove tag.") java.lang.String id,
@NotBlank(message="No tag entered. Unable to remove.") java.lang.String tag)
Remove a tag from the command.
|
void |
setApplicationsForCommand(@NotBlank(message="No command id entered. Unable to set applications.") java.lang.String id,
@NotNull(message="No application ids entered. Unable to set applications.") java.util.List<java.lang.String> applicationIds)
Set the applications for the command.
|
void |
setClusterCriteriaForCommand(java.lang.String id,
java.util.List<Criterion> clusterCriteria)
For the command identified by id reset the entire list of cluster criteria to match the contents of
clusterCriteria.
|
void |
updateCommand(@NotBlank(message="No id entered. Unable to update.") java.lang.String id,
@NotNull(message="No command information entered. Unable to update.") @Valid Command updateCommand)
Update command configuration.
|
void |
updateConfigsForCommand(@NotBlank(message="No command id entered. Unable to update configurations.") java.lang.String id,
@NotEmpty(message="No configs entered. Unable to update.") java.util.Set<java.lang.String> configs)
Update the set of configuration files associated with the command with
given id.
|
void |
updateDependenciesForCommand(@NotBlank(message="No command id entered. Unable to update dependencies.") java.lang.String id,
@NotNull(message="No dependencies entered. Unable to update.") java.util.Set<java.lang.String> dependencies)
Update the set of dependency files associated with the command with given
id.
|
int |
updateStatusForUnusedCommands(CommandStatus desiredStatus,
java.time.Instant commandCreatedThreshold,
java.util.Set<CommandStatus> currentStatuses,
java.time.Instant jobCreatedThreshold)
Update the status of a command to the desiredStatus if its status is in currentStatuses,
it was created before commandCreatedThreshold and it hasn't been used in any job that was created
in the Genie system after jobCreatedThreshold.
|
void |
updateTagsForCommand(@NotBlank(message="No command id entered. Unable to update tags.") java.lang.String id,
@NotEmpty(message="No tags entered. Unable to update.") java.util.Set<java.lang.String> tags)
Update the set of tags associated with the command with
given id.
|
public JpaCommandPersistenceServiceImpl(JpaTagPersistenceService tagPersistenceService, JpaFilePersistenceService filePersistenceService, JpaApplicationRepository applicationRepository, JpaClusterRepository clusterRepository, JpaCommandRepository commandRepository, JpaCriterionRepository criterionRepository)
tagPersistenceService
- The JpaTagPersistenceService
to usefilePersistenceService
- The JpaFilePersistenceService
to useapplicationRepository
- The JpaApplicationRepository
to useclusterRepository
- The JpaClusterRepository
to usecommandRepository
- The JpaCommandRepository
to usecriterionRepository
- The JpaCriterionRepository
to usepublic java.lang.String createCommand(@NotNull(message="No command entered. Unable to create.") @Valid @NotNull(message="No command entered. Unable to create.") @Valid CommandRequest request) throws GenieException
createCommand
in interface CommandPersistenceService
request
- encapsulates the command configuration information to
create. Not null. Valid.GenieException
- if there is an error@Transactional(readOnly=true) public Command getCommand(@NotBlank(message="No id entered unable to get.") @NotBlank(message="No id entered unable to get.") java.lang.String id) throws GenieException
getCommand
in interface CommandPersistenceService
id
- unique id for command configuration to get. Not null/empty.GenieException
- if there is an error@Transactional(readOnly=true) public org.springframework.data.domain.Page<Command> getCommands(@Nullable java.lang.String name, @Nullable java.lang.String user, @Nullable java.util.Set<CommandStatus> statuses, @Nullable java.util.Set<java.lang.String> tags, org.springframework.data.domain.Pageable page)
getCommands
in interface CommandPersistenceService
name
- Name of command configuser
- The name of the user who created the configurationstatuses
- The status of the commands to get. Can be null.tags
- tags allocated to this commandpage
- The page of results to getpublic void updateCommand(@NotBlank(message="No id entered. Unable to update.") @NotBlank(message="No id entered. Unable to update.") java.lang.String id, @NotNull(message="No command information entered. Unable to update.") @Valid @NotNull(message="No command information entered. Unable to update.") @Valid Command updateCommand) throws GenieException
updateCommand
in interface CommandPersistenceService
id
- The id of the command configuration to update. Not null or
empty.updateCommand
- contains the information to update the command withGenieException
- if there is an errorpublic void patchCommand(@NotBlank @NotBlank java.lang.String id, @NotNull @NotNull com.github.fge.jsonpatch.JsonPatch patch) throws GenieException
patchCommand
in interface CommandPersistenceService
id
- The id of the command to updatepatch
- The json patch to use to update the given commandGenieException
- if there is an errorpublic void deleteAllCommands() throws GenieException
deleteAllCommands
in interface CommandPersistenceService
GenieException
- if there is an errorpublic void deleteCommand(@NotBlank(message="No id entered. Unable to delete.") @NotBlank(message="No id entered. Unable to delete.") java.lang.String id) throws GenieException
deleteCommand
in interface CommandPersistenceService
id
- unique if of the command configuration to deleteGenieException
- if there is an errorpublic void addConfigsForCommand(@NotBlank(message="No command id entered. Unable to add configurations.") @NotBlank(message="No command id entered. Unable to add configurations.") java.lang.String id, @NotEmpty(message="No configuration files entered. Unable to add.") @NotEmpty(message="No configuration files entered. Unable to add.") java.util.Set<java.lang.String> configs) throws GenieException
addConfigsForCommand
in interface CommandPersistenceService
id
- The id of the command to add the configuration file to. Not
null/empty/blank.configs
- The configuration files to add. Not null/empty.GenieException
- if there is an error@Transactional(readOnly=true) public java.util.Set<java.lang.String> getConfigsForCommand(@NotBlank(message="No command id entered. Unable to get configs.") @NotBlank(message="No command id entered. Unable to get configs.") java.lang.String id) throws GenieException
getConfigsForCommand
in interface CommandPersistenceService
id
- The id of the command to get the configuration files for. Not
null/empty/blank.GenieException
- if there is an errorpublic void updateConfigsForCommand(@NotBlank(message="No command id entered. Unable to update configurations.") @NotBlank(message="No command id entered. Unable to update configurations.") java.lang.String id, @NotEmpty(message="No configs entered. Unable to update.") @NotEmpty(message="No configs entered. Unable to update.") java.util.Set<java.lang.String> configs) throws GenieException
updateConfigsForCommand
in interface CommandPersistenceService
id
- The id of the command to update the configuration files for.
Not null/empty/blank.configs
- The configuration files to replace existing configurations
with. Not null/empty.GenieException
- if there is an errorpublic void removeAllConfigsForCommand(@NotBlank(message="No command id entered. Unable to remove configs.") @NotBlank(message="No command id entered. Unable to remove configs.") java.lang.String id) throws GenieException
removeAllConfigsForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the configuration file from.
Not null/empty/blank.GenieException
- if there is an errorpublic void removeConfigForCommand(@NotBlank(message="No command id entered. Unable to remove configuration.") @NotBlank(message="No command id entered. Unable to remove configuration.") java.lang.String id, @NotBlank(message="No config entered. Unable to remove.") @NotBlank(message="No config entered. Unable to remove.") java.lang.String config) throws GenieException
removeConfigForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the configuration file from.
Not null/empty/blank.config
- The configuration file to remove. Not null/empty/blank.GenieException
- if there is an errorpublic void addDependenciesForCommand(@NotBlank(message="No command id entered. Unable to add dependencies.") @NotBlank(message="No command id entered. Unable to add dependencies.") java.lang.String id, @NotEmpty(message="No dependencies entered. Unable to add dependencies.") @NotEmpty(message="No dependencies entered. Unable to add dependencies.") java.util.Set<java.lang.String> dependencies) throws GenieException
addDependenciesForCommand
in interface CommandPersistenceService
id
- The id of the command to add the dependency file to. Not
null/empty/blank.dependencies
- The dependency files to add. Not null.GenieException
- if there is an error@Transactional(readOnly=true) public java.util.Set<java.lang.String> getDependenciesForCommand(@NotBlank(message="No command id entered. Unable to get dependencies.") @NotBlank(message="No command id entered. Unable to get dependencies.") java.lang.String id) throws GenieException
getDependenciesForCommand
in interface CommandPersistenceService
id
- The id of the command to get the dependency files for. Not
null/empty/blank.GenieException
- if there is an errorpublic void updateDependenciesForCommand(@NotBlank(message="No command id entered. Unable to update dependencies.") @NotBlank(message="No command id entered. Unable to update dependencies.") java.lang.String id, @NotNull(message="No dependencies entered. Unable to update.") @NotNull(message="No dependencies entered. Unable to update.") java.util.Set<java.lang.String> dependencies) throws GenieException
updateDependenciesForCommand
in interface CommandPersistenceService
id
- The id of the command to update the dependency files for. Not
null/empty/blank.dependencies
- The dependency files to replace existing dependencies with. Not null/empty.GenieException
- if there is an errorpublic void removeAllDependenciesForCommand(@NotBlank(message="No command id entered. Unable to remove dependencies.") @NotBlank(message="No command id entered. Unable to remove dependencies.") java.lang.String id) throws GenieException
removeAllDependenciesForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the configuration file
from. Not null/empty/blank.GenieException
- if there is an errorpublic void removeDependencyForCommand(@NotBlank(message="No command id entered. Unable to remove dependency.") @NotBlank(message="No command id entered. Unable to remove dependency.") java.lang.String id, @NotBlank(message="No dependency entered. Unable to remove dependency.") @NotBlank(message="No dependency entered. Unable to remove dependency.") java.lang.String dependency) throws GenieException
removeDependencyForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the dependency file from. Not
null/empty/blank.dependency
- The dependency file to remove. Not null/empty/blank.GenieException
- if there is an errorpublic void addTagsForCommand(@NotBlank(message="No command id entered. Unable to add tags.") @NotBlank(message="No command id entered. Unable to add tags.") java.lang.String id, @NotEmpty(message="No tags entered. Unable to add.") @NotEmpty(message="No tags entered. Unable to add.") java.util.Set<java.lang.String> tags) throws GenieException
addTagsForCommand
in interface CommandPersistenceService
id
- The id of the command to add the tags to. Not
null/empty/blank.tags
- The tags to add. Not null/empty.GenieException
- if there is an error@Transactional(readOnly=true) public java.util.Set<java.lang.String> getTagsForCommand(@NotBlank(message="No command id sent. Cannot retrieve tags.") @NotBlank(message="No command id sent. Cannot retrieve tags.") java.lang.String id) throws GenieException
getTagsForCommand
in interface CommandPersistenceService
id
- The id of the command to get the tags for. Not
null/empty/blank.GenieException
- if there is an errorpublic void updateTagsForCommand(@NotBlank(message="No command id entered. Unable to update tags.") @NotBlank(message="No command id entered. Unable to update tags.") java.lang.String id, @NotEmpty(message="No tags entered. Unable to update.") @NotEmpty(message="No tags entered. Unable to update.") java.util.Set<java.lang.String> tags) throws GenieException
updateTagsForCommand
in interface CommandPersistenceService
id
- The id of the command to update the tags for.
Not null/empty/blank.tags
- The tags to replace existing tags
with. Not null/empty.GenieException
- if there is an errorpublic void removeAllTagsForCommand(@NotBlank(message="No command id entered. Unable to remove tags.") @NotBlank(message="No command id entered. Unable to remove tags.") java.lang.String id) throws GenieException
removeAllTagsForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the tags from.
Not null/empty/blank.GenieException
- if there is an errorpublic void removeTagForCommand(@NotBlank(message="No command id entered. Unable to remove tag.") @NotBlank(message="No command id entered. Unable to remove tag.") java.lang.String id, @NotBlank(message="No tag entered. Unable to remove.") @NotBlank(message="No tag entered. Unable to remove.") java.lang.String tag) throws GenieException
removeTagForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the tag from. Not
null/empty/blank.tag
- The tag to remove. Not null/empty/blank.GenieException
- if there is an errorpublic void addApplicationsForCommand(@NotBlank(message="No command id entered. Unable to add applications.") @NotBlank(message="No command id entered. Unable to add applications.") java.lang.String id, @NotEmpty(message="No application ids entered. Unable to add applications.") @NotEmpty(message="No application ids entered. Unable to add applications.") java.util.List<java.lang.String> applicationIds) throws GenieException
addApplicationsForCommand
in interface CommandPersistenceService
id
- The id of the command to add the application file to. Not
null/empty/blank.applicationIds
- The ids of the applications to add. Not null.GenieException
- if there is an errorpublic void setApplicationsForCommand(@NotBlank(message="No command id entered. Unable to set applications.") @NotBlank(message="No command id entered. Unable to set applications.") java.lang.String id, @NotNull(message="No application ids entered. Unable to set applications.") @NotNull(message="No application ids entered. Unable to set applications.") java.util.List<java.lang.String> applicationIds) throws GenieException
setApplicationsForCommand
in interface CommandPersistenceService
id
- The id of the command to add the application file to. Not
null/empty/blank.applicationIds
- The ids of the applications to set. Not null.GenieException
- if there is an error@Transactional(readOnly=true) public java.util.List<Application> getApplicationsForCommand(@NotBlank(message="No command id entered. Unable to get applications.") @NotBlank(message="No command id entered. Unable to get applications.") java.lang.String id) throws GenieException
getApplicationsForCommand
in interface CommandPersistenceService
id
- The id of the command to get the application for. Not
null/empty/blank.GenieException
- if there is an errorpublic void removeApplicationsForCommand(@NotBlank(message="No command id entered. Unable to remove applications.") @NotBlank(message="No command id entered. Unable to remove applications.") java.lang.String id) throws GenieException
removeApplicationsForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the application from. Not
null/empty/blank.GenieException
- if there is an errorpublic void removeApplicationForCommand(@NotBlank(message="No command id entered. Unable to remove application.") @NotBlank(message="No command id entered. Unable to remove application.") java.lang.String id, @NotBlank(message="No application id entered. Unable to remove application.") @NotBlank(message="No application id entered. Unable to remove application.") java.lang.String appId) throws GenieException
removeApplicationForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the application from. Not null/empty/blank.appId
- The id of the application to remove. Not null/empty/blankGenieException
- if there is an error@Transactional(readOnly=true) public java.util.Set<Cluster> getClustersForCommand(@NotBlank(message="No command id entered. Unable to get clusters.") @NotBlank(message="No command id entered. Unable to get clusters.") java.lang.String id, @Nullable java.util.Set<ClusterStatus> statuses) throws GenieException
getClustersForCommand
in interface CommandPersistenceService
id
- The id of the command to get the clusters for.statuses
- The status of the clusters returnedGenieException
- if there is an error@Transactional(readOnly=true) public java.util.List<Criterion> getClusterCriteriaForCommand(java.lang.String id) throws GenieNotFoundException
Criterion
in priority order that is currently
associated with this command if any.getClusterCriteriaForCommand
in interface CommandPersistenceService
id
- The id of the command to get the criteria forGenieNotFoundException
- If no command with id existspublic void addClusterCriterionForCommand(java.lang.String id, @Valid @Valid Criterion criterion) throws GenieNotFoundException
Criterion
to the existing list of cluster criteria for the command identified by id.
This new criterion will be the lowest priority criterion.addClusterCriterionForCommand
in interface CommandPersistenceService
id
- The id of the command to add tocriterion
- The new Criterion
to addGenieNotFoundException
- If no command with id existspublic void addClusterCriterionForCommand(java.lang.String id, @Valid @Valid Criterion criterion, @Min(value=0L) @Min(value=0L) int priority) throws GenieNotFoundException
Criterion
to the existing list of cluster criteria for the command identified by id.
The priority is the place in the list this new criterion should be placed. A value of 0
indicates it should be placed at the front of the list with the highest possible priority. 1 would be
second in the list etc. If priority is > the current size of the cluster criteria list
this new criterion will be placed at the end as the lowest priority item.addClusterCriterionForCommand
in interface CommandPersistenceService
id
- The id of the command to add tocriterion
- The new Criterion
to addpriority
- The place in the existing cluster criteria list this new criterion should be placed. Min 0.GenieNotFoundException
- If no command with id existspublic void setClusterCriteriaForCommand(java.lang.String id, java.util.List<Criterion> clusterCriteria) throws GenieNotFoundException
setClusterCriteriaForCommand
in interface CommandPersistenceService
id
- The id of the command to set the cluster criteria forclusterCriteria
- The priority list of Criterion
to setGenieNotFoundException
- If no command with id existspublic void removeClusterCriterionForCommand(java.lang.String id, @Min(value=0L) @Min(value=0L) int priority) throws GenieNotFoundException
Criterion
with the given priority from the current list of cluster criteria
associated with the command identified by id. A value of 0 for priority
will result in the first element in the list being removed, 1 the second element and so on.removeClusterCriterionForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the criterion frompriority
- The priority of the criterion to removeGenieNotFoundException
- If no command with id existspublic void removeAllClusterCriteriaForCommand(java.lang.String id) throws GenieNotFoundException
Criterion
currently associated with the command identified by id.removeAllClusterCriteriaForCommand
in interface CommandPersistenceService
id
- The id of the command to remove the criteria fromGenieNotFoundException
- If no command with id exists@Transactional(readOnly=true) public java.util.Set<Command> findCommandsMatchingCriterion(@Valid @Valid Criterion criterion, boolean addDefaultStatus)
findCommandsMatchingCriterion
in interface CommandPersistenceService
criterion
- The Criterion
supplied that each command needs to completely match to be returnedaddDefaultStatus
- true if a default status should be added to the supplied criterion if a
status isn't already presentCommand
's which matched the Criterion
@Transactional(isolation=READ_COMMITTED) public int updateStatusForUnusedCommands(CommandStatus desiredStatus, java.time.Instant commandCreatedThreshold, java.util.Set<CommandStatus> currentStatuses, java.time.Instant jobCreatedThreshold)
updateStatusForUnusedCommands
in interface CommandPersistenceService
desiredStatus
- The new status the matching commands should havecommandCreatedThreshold
- The instant in time which a command must have been created before to be
considered for update. ExclusivecurrentStatuses
- The set of current statuses a command must have to be considered for updatejobCreatedThreshold
- The instant in time after which a command must not have been used in a Genie job
for it to be considered for update. Inclusive.@Transactional(isolation=READ_COMMITTED) public long deleteUnusedCommands(java.util.Set<CommandStatus> deleteStatuses, java.time.Instant commandCreatedThreshold)
deleteUnusedCommands
in interface CommandPersistenceService
deleteStatuses
- The set of statuses a command must be in in order to be considered for deletioncommandCreatedThreshold
- The instant in time a command must have been created before to be considered for
deletion. Exclusive.