public class WorkbasketServiceImpl extends Object implements WorkbasketService
| Constructor and Description |
|---|
WorkbasketServiceImpl() |
WorkbasketServiceImpl(TaskanaEngine taskanaEngine,
WorkbasketMapper workbasketMapper,
DistributionTargetMapper distributionTargetMapper,
WorkbasketAccessMapper workbasketAccessMapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDistributionTarget(String sourceWorkbasketId,
String targetWorkbasketId)
Add a distribution target to a workbasket.
|
void |
checkAuthorization(String workbasketKey,
WorkbasketAuthorization workbasketAuthorization)
This method checks the authorization with the saved one for the actual User.
|
Workbasket |
createWorkbasket(Workbasket newWorkbasket)
Create a new Workbasket.
|
WorkbasketAccessItem |
createWorkbasketAuthorization(WorkbasketAccessItem workbasketAccessItem)
Create and persist a new Workbasket Authorization with a Workbasket and a AccessId.
|
WorkbasketQuery |
createWorkbasketQuery()
This method provides a query builder for querying the database.
|
void |
deleteWorkbasket(String workbasketId)
Deletes the workbasket by the given ID of it.
|
void |
deleteWorkbasketAuthorization(String id)
Deletes a specific authorization.
|
List<WorkbasketSummary> |
getDistributionTargets(String workbasketId)
Returns the distribution targets for a given workbasket.
|
List<WorkbasketAuthorization> |
getPermissionsForWorkbasket(String workbasketKey)
Returns a set with all permissions of the current user at this workbasket.
|
Workbasket |
getWorkbasket(String workbasketId)
Get Workbasket for a given id.
|
List<WorkbasketAccessItem> |
getWorkbasketAuthorizations(String workbasketKey)
Get all authorizations for a Workbasket.
|
Workbasket |
getWorkbasketByKey(String workbasketKey)
Get Workbasket for a given key.
|
List<WorkbasketSummary> |
getWorkbaskets()
Get all available Workbaskets without checking any permission.
|
List<WorkbasketSummary> |
getWorkbaskets(List<WorkbasketAuthorization> permissions)
This method returns the workbaskets for which the current user has all permissions specified in the permissions
list.
|
Workbasket |
newWorkbasket(String key)
Returns a new workbasket which is not persisted.
|
WorkbasketAccessItem |
newWorkbasketAccessItem(String workbasketKey,
String accessId)
Returns a new WorkbasketAccessItem which is not persisted.
|
void |
removeDistributionTarget(String sourceWorkbasketId,
String targetWorkbasketId)
Remove a distribution target from a workbasket.
|
void |
setDistributionTargets(String sourceWorkbasketId,
List<String> targetWorkbasketIds)
Set the distribution targets for a workbasket.
|
Workbasket |
updateWorkbasket(Workbasket workbasketToUpdate)
Update a Workbasket.
|
WorkbasketAccessItem |
updateWorkbasketAuthorization(WorkbasketAccessItem workbasketAccessItem)
This method updates an Workbasket Authorization.
|
public WorkbasketServiceImpl()
public WorkbasketServiceImpl(TaskanaEngine taskanaEngine, WorkbasketMapper workbasketMapper, DistributionTargetMapper distributionTargetMapper, WorkbasketAccessMapper workbasketAccessMapper)
public Workbasket getWorkbasket(String workbasketId) throws WorkbasketNotFoundException, NotAuthorizedException
WorkbasketServicegetWorkbasket in interface WorkbasketServiceworkbasketId - the Id of the Workbasket requestedWorkbasketNotFoundException - If the Workbasket with workbasketId is not foundNotAuthorizedException - If the current user or group does not have the permissions for interactions.public Workbasket getWorkbasketByKey(String workbasketKey) throws WorkbasketNotFoundException, NotAuthorizedException
WorkbasketServicegetWorkbasketByKey in interface WorkbasketServiceworkbasketKey - the Key of the Workbasket requestedWorkbasketNotFoundException - If the Workbasket with workbasketId is not foundNotAuthorizedException - If the current user or group does not have the permissions for interactions.public List<WorkbasketSummary> getWorkbaskets(List<WorkbasketAuthorization> permissions)
WorkbasketServicegetWorkbaskets in interface WorkbasketServicepermissions - a List of WorkbasketAuthorization enumspublic List<WorkbasketSummary> getWorkbaskets()
WorkbasketServicegetWorkbaskets in interface WorkbasketServicepublic Workbasket createWorkbasket(Workbasket newWorkbasket) throws InvalidWorkbasketException
WorkbasketServicecreateWorkbasket in interface WorkbasketServicenewWorkbasket - The Workbasket to createInvalidWorkbasketException - If a required property of the Workbasket is not set.public Workbasket updateWorkbasket(Workbasket workbasketToUpdate) throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException
WorkbasketServiceupdateWorkbasket in interface WorkbasketServiceworkbasketToUpdate - The Workbasket to updateNotAuthorizedException - if the current user is not authorized to update the work basketWorkbasketNotFoundException - if the updated work basket references a distribution target that does not existInvalidWorkbasketException - if a required property of the workbasket is not setpublic WorkbasketAccessItem newWorkbasketAccessItem(String workbasketKey, String accessId)
WorkbasketServicenewWorkbasketAccessItem in interface WorkbasketServiceworkbasketKey - the workbasket key used to identify the referenced workbasketaccessId - the group id or user id for which access is controlledpublic WorkbasketAccessItem createWorkbasketAuthorization(WorkbasketAccessItem workbasketAccessItem)
WorkbasketServicecreateWorkbasketAuthorization in interface WorkbasketServiceworkbasketAccessItem - the new workbasketAccessItempublic void deleteWorkbasketAuthorization(String id)
WorkbasketServicedeleteWorkbasketAuthorization in interface WorkbasketServiceid - the id of the WorbasketAccessItem to be deletedpublic void checkAuthorization(String workbasketKey, WorkbasketAuthorization workbasketAuthorization) throws NotAuthorizedException
WorkbasketServicecheckAuthorization in interface WorkbasketServiceworkbasketKey - the key of the workbasket we want to accessworkbasketAuthorization - the needed AuthorizationNotAuthorizedException - if the current user has not the requested authorization for the specified workbasketpublic WorkbasketAccessItem updateWorkbasketAuthorization(WorkbasketAccessItem workbasketAccessItem) throws InvalidArgumentException
WorkbasketServiceupdateWorkbasketAuthorization in interface WorkbasketServiceworkbasketAccessItem - the AuthorizationInvalidArgumentException - if accessid or workbasketkey is changed in the workbasketAccessItempublic List<WorkbasketAccessItem> getWorkbasketAuthorizations(String workbasketKey)
WorkbasketServicegetWorkbasketAuthorizations in interface WorkbasketServiceworkbasketKey - the key of the Workbasketpublic List<WorkbasketAuthorization> getPermissionsForWorkbasket(String workbasketKey)
WorkbasketServicegetPermissionsForWorkbasket in interface WorkbasketServiceworkbasketKey - the key of the referenced workbasketpublic WorkbasketQuery createWorkbasketQuery()
WorkbasketServicecreateWorkbasketQuery in interface WorkbasketServiceWorkbasketQuerypublic Workbasket newWorkbasket(String key)
WorkbasketServicenewWorkbasket in interface WorkbasketServicekey - the workbasket key used to identify the workbasketpublic List<WorkbasketSummary> getDistributionTargets(String workbasketId) throws NotAuthorizedException, WorkbasketNotFoundException
WorkbasketServicegetDistributionTargets in interface WorkbasketServiceworkbasketId - the id of the referenced workbasketNotAuthorizedException - if the current user has no read permission for the specified workbasketWorkbasketNotFoundException - if the workbasket doesn't existpublic void setDistributionTargets(String sourceWorkbasketId, List<String> targetWorkbasketIds) throws WorkbasketNotFoundException, NotAuthorizedException
WorkbasketServicesetDistributionTargets in interface WorkbasketServicesourceWorkbasketId - the id of the source workbasket for which the distribution targets are to be settargetWorkbasketIds - a list of the ids of the target workbasketsWorkbasketNotFoundException - if either the source workbasket or any of the target workbaskets don't existNotAuthorizedException - if the current used doesn't have READ permission for the source workbasketpublic void addDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId) throws NotAuthorizedException, WorkbasketNotFoundException
WorkbasketServiceaddDistributionTarget in interface WorkbasketServicesourceWorkbasketId - the id of the source workbaskettargetWorkbasketId - the id of the target workbasketNotAuthorizedException - if the current user doesn't have READ permission for the source workbasketWorkbasketNotFoundException - if either the source workbasket or the target workbasket doesn't existpublic void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId) throws NotAuthorizedException
WorkbasketServiceremoveDistributionTarget in interface WorkbasketServicesourceWorkbasketId - The id of the source workbaskettargetWorkbasketId - The id of the target workbasketNotAuthorizedException - If the current user doesn't have READ permission for the source workbasketpublic void deleteWorkbasket(String workbasketId) throws NotAuthorizedException, WorkbasketNotFoundException, WorkbasketInUseException, InvalidArgumentException
WorkbasketServicedeleteWorkbasket in interface WorkbasketServiceworkbasketId - Id of the workbasket which should be deleted.NotAuthorizedException - if the current user got no permissions for this interaction.WorkbasketNotFoundException - if the workbasket does not exist.WorkbasketInUseException - if the workbasket does contain task-content.InvalidArgumentException - if the workbasketId is NULL or EMPTYCopyright © 2018. All rights reserved.