Interface LifeCycleDatabaseService
- All Known Implementing Classes:
LifeCycleDatabaseServiceImpl
public interface LifeCycleDatabaseService
API that defines persistent storage of lifecycle elements
-
Method Summary
Modifier and TypeMethodDescriptioncreateLifeCyclePolicy(LifeCyclePolicy policy, String orgId) Creates a single life cycle policy in the database.createLifeCycleTask(LifeCycleTask task, String orgId) Creates a single life cycle task.voidRemove all life cycle policies that were created through configuration files from the databasebooleandeleteLifeCyclePolicy(LifeCyclePolicy policy, String orgId) Removes a single life cycle policy in the database.booleandeleteLifeCycleTask(LifeCycleTask task, String orgId) Removes a single life cycle task.getActiveLifeCyclePolicies(String orgId) Get currently active life cycle policiesgetLifeCyclePolicies(int limit, int offset, SortCriterion sortCriterion) Get several life cycle policies based on their order in the databaselonggetLifeCyclePoliciesTotal(String orgId) Get the total number of policiesGets a single life cycle policy in the current organization context by its identifier.getLifeCyclePolicy(String id, String orgId) Gets a single life cycle policy by its identifier.Gets a single life cycle task in the current organization context by its identifier.getLifeCycleTaskByTargetId(String targetId) Gets a single life cycle task in the current organization context by its target identifier.getLifeCycleTasksWithStatus(Status status, String orgId) Get several life cycle policies based on their statusbooleanupdateLifeCyclePolicy(LifeCyclePolicy policy, String orgId) Updates a single life cycle policy in the database.booleanupdateLifeCycleTask(LifeCycleTask task, String orgId) Updates a single life cycle task.
-
Method Details
-
getLifeCyclePolicy
Gets a single life cycle policy in the current organization context by its identifier.- Parameters:
id- the life cycle policy identifier- Returns:
- the
LifeCyclePolicywith the given identifier - Throws:
NotFoundException- if there is no life cycle policy with this identifierLifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
getLifeCyclePolicy
LifeCyclePolicy getLifeCyclePolicy(String id, String orgId) throws NotFoundException, LifeCycleDatabaseException Gets a single life cycle policy by its identifier.- Parameters:
id- the life cycle policy identifierorgId- the organisation identifier- Returns:
- the
LifeCyclePolicywith the given identifier - Throws:
NotFoundException- if there is no life cycle policy with this identifierLifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
getLifeCyclePoliciesTotal
Get the total number of policies- Parameters:
orgId- the organisation identifier- Returns:
- the total number of policies
- Throws:
LifeCycleDatabaseException
-
getLifeCyclePolicies
List<LifeCyclePolicy> getLifeCyclePolicies(int limit, int offset, SortCriterion sortCriterion) throws LifeCycleDatabaseException Get several life cycle policies based on their order in the database- Parameters:
limit- Maximum amount of life cycle policys to returnoffset- The index of the first result to return- Returns:
- a list of
LifeCyclePolicys - Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
getActiveLifeCyclePolicies
Get currently active life cycle policies- Parameters:
orgId- the organisation identifier- Returns:
- a list of
LifeCyclePolicys - Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
createLifeCyclePolicy
LifeCyclePolicy createLifeCyclePolicy(LifeCyclePolicy policy, String orgId) throws LifeCycleDatabaseException Creates a single life cycle policy in the database.- Parameters:
policy- TheLifeCyclePolicyorgId- the organisation identifier- Returns:
- The created
LifeCyclePolicy - Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
updateLifeCyclePolicy
boolean updateLifeCyclePolicy(LifeCyclePolicy policy, String orgId) throws LifeCycleDatabaseException Updates a single life cycle policy in the database.- Parameters:
policy- TheLifeCyclePolicyorgId- the organisation identifier- Returns:
- If the life cycle policy was successfully updated
- Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
deleteLifeCyclePolicy
boolean deleteLifeCyclePolicy(LifeCyclePolicy policy, String orgId) throws LifeCycleDatabaseException Removes a single life cycle policy in the database.- Parameters:
policy- TheLifeCyclePolicyorgId- the organisation identifier- Returns:
- If the life cycle policy was successfully updated
- Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
deleteAllLifeCyclePoliciesCreatedByConfig
Remove all life cycle policies that were created through configuration files from the database- Parameters:
orgId-- Throws:
LifeCycleDatabaseException
-
getLifeCycleTask
Gets a single life cycle task in the current organization context by its identifier.- Parameters:
id- the life cycle task identifier- Returns:
- the
LifeCycleTaskwith the given identifier - Throws:
NotFoundException- if there is no life cycle task with this identifierLifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
getLifeCycleTaskByTargetId
LifeCycleTask getLifeCycleTaskByTargetId(String targetId) throws NotFoundException, LifeCycleDatabaseException Gets a single life cycle task in the current organization context by its target identifier.- Parameters:
targetId- the id of the entity the task will act on- Returns:
- the
LifeCycleTaskwith the given identifier - Throws:
NotFoundException- if there is no life cycle task with this identifierLifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
getLifeCycleTasksWithStatus
List<LifeCycleTask> getLifeCycleTasksWithStatus(Status status, String orgId) throws LifeCycleDatabaseException Get several life cycle policies based on their status- Parameters:
status- The state the tasks should be inorgId- the organisation identifier- Returns:
- a list of
LifeCycleTasks - Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
createLifeCycleTask
LifeCycleTask createLifeCycleTask(LifeCycleTask task, String orgId) throws LifeCycleDatabaseException Creates a single life cycle task.- Parameters:
task- TheLifeCycleTaskorgId- the organisation identifier- Returns:
- The created
LifeCycleTask - Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
updateLifeCycleTask
Updates a single life cycle task.- Parameters:
task- TheLifeCycleTaskorgId- the organisation identifier- Returns:
- If the life cycle task was successfully updated
- Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-
deleteLifeCycleTask
Removes a single life cycle task.- Parameters:
task- TheLifeCycleTaskorgId- the organisation identifier- Returns:
- If the life cycle task was successfully updated
- Throws:
LifeCycleDatabaseException- if there is a problem communicating with the underlying data store
-