Class TaskStorageImpl
- java.lang.Object
-
- org.exoplatform.task.storage.impl.TaskStorageImpl
-
- All Implemented Interfaces:
TaskStorage
public class TaskStorageImpl extends Object implements TaskStorage
-
-
Constructor Summary
Constructors Constructor Description TaskStorageImpl(DAOHandler daoHandler, UserService userService, ProjectStorage projectStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeLogEntryaddTaskLog(ChangeLogEntry changeLogEntry)Create a log associated with a task with givenchangeLogEntry.voidaddWatcherToTask(String username, TaskDto task)LongcountAssignedTasks(String user)LongcountCollaboratedTasks(String user)intcountIncomingTasks(String user)LongcountOverdueTasks(String user)longcountTasks(String user, String query)Count tasks assigned to a user using a search term to find in title or description of the taskintcountTasks(TaskQuery query)intcountTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy)List<Object[]>countTaskStatusByProject(long projectId)LongcountUncompletedTasks(String user)LongcountWatchedTasks(String user)TaskDtocreateTask(TaskDto task)Create a new task.voiddelete(TaskDto task)Delete the provided task.voiddeleteWatcherOfTask(String username, TaskDto task)List<TaskDto>findByUser(String user)TaskDtofindTaskByActivityId(String activityId)List<TaskDto>findTasks(String user, String query, int limit)Find tasks assigned to a user using a term to find in title or description of the taskList<TaskDto>findTasks(TaskQuery query, int offset, int limit)List<TaskDto>findTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy, int offset, int limit)List<TaskDto>getAssignedTasks(String user, int limit)List<TaskDto>getCollaboratedTasks(String user, int limit)Set<String>getCoworker(long taskid)List<TaskDto>getIncomingTasks(String user, int offset, int limit)List<TaskDto>getOverdueTasks(String user, int limit)TaskDtogetTaskById(long id)Find task by its idList<ChangeLogEntry>getTaskLogs(long taskId, int offset, int limit)TaskDtogetTaskWithCoworkers(long id)List<TaskDto>getUncompletedTasks(String user, int limit)List<TaskDto>getWatchedTasks(String user, int limit)Set<String>getWatchersOfTask(TaskDto task)<T> List<T>selectTaskField(TaskQuery query, String fieldName)TaskDtoupdate(TaskDto task)Update the provided task.voidupdateStatus(Status stOld, Status stNew)voidupdateTaskOrder(long currentTaskId, Status newStatus, long[] orders)
-
-
-
Constructor Detail
-
TaskStorageImpl
public TaskStorageImpl(DAOHandler daoHandler, UserService userService, ProjectStorage projectStorage)
-
-
Method Detail
-
getTaskById
public TaskDto getTaskById(long id)
Description copied from interface:TaskStorageFind task by its id- Specified by:
getTaskByIdin interfaceTaskStorage- Parameters:
id- the given id.- Returns:
TaskDto
-
createTask
public TaskDto createTask(TaskDto task)
Description copied from interface:TaskStorageCreate a new task.- Specified by:
createTaskin interfaceTaskStorage- Parameters:
task- the given task- Returns:
TaskDto
-
update
public TaskDto update(TaskDto task)
Description copied from interface:TaskStorageUpdate the provided task.- Specified by:
updatein interfaceTaskStorage- Parameters:
task- the given task.- Returns:
TaskDto
-
delete
public void delete(TaskDto task)
Description copied from interface:TaskStorageDelete the provided task.- Specified by:
deletein interfaceTaskStorage- Parameters:
task- the provided task.
-
findTasksByLabel
public List<TaskDto> findTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy, int offset, int limit) throws Exception
- Specified by:
findTasksByLabelin interfaceTaskStorage- Throws:
Exception
-
countTasksByLabel
public int countTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy) throws Exception
- Specified by:
countTasksByLabelin interfaceTaskStorage- Throws:
Exception
-
findByUser
public List<TaskDto> findByUser(String user)
- Specified by:
findByUserin interfaceTaskStorage
-
findTasks
public List<TaskDto> findTasks(TaskQuery query, int offset, int limit) throws Exception
- Specified by:
findTasksin interfaceTaskStorage- Throws:
Exception
-
countTasks
public int countTasks(TaskQuery query) throws Exception
- Specified by:
countTasksin interfaceTaskStorage- Throws:
Exception
-
selectTaskField
public <T> List<T> selectTaskField(TaskQuery query, String fieldName)
- Specified by:
selectTaskFieldin interfaceTaskStorage
-
findTaskByActivityId
public TaskDto findTaskByActivityId(String activityId)
- Specified by:
findTaskByActivityIdin interfaceTaskStorage
-
updateStatus
public void updateStatus(Status stOld, Status stNew)
- Specified by:
updateStatusin interfaceTaskStorage
-
updateTaskOrder
public void updateTaskOrder(long currentTaskId, Status newStatus, long[] orders)- Specified by:
updateTaskOrderin interfaceTaskStorage
-
getCoworker
public Set<String> getCoworker(long taskid)
- Specified by:
getCoworkerin interfaceTaskStorage
-
getTaskWithCoworkers
public TaskDto getTaskWithCoworkers(long id)
- Specified by:
getTaskWithCoworkersin interfaceTaskStorage
-
getUncompletedTasks
public List<TaskDto> getUncompletedTasks(String user, int limit)
- Specified by:
getUncompletedTasksin interfaceTaskStorage
-
countUncompletedTasks
public Long countUncompletedTasks(String user)
- Specified by:
countUncompletedTasksin interfaceTaskStorage
-
getAssignedTasks
public List<TaskDto> getAssignedTasks(String user, int limit)
- Specified by:
getAssignedTasksin interfaceTaskStorage
-
countAssignedTasks
public Long countAssignedTasks(String user)
- Specified by:
countAssignedTasksin interfaceTaskStorage
-
getWatchedTasks
public List<TaskDto> getWatchedTasks(String user, int limit)
- Specified by:
getWatchedTasksin interfaceTaskStorage
-
countWatchedTasks
public Long countWatchedTasks(String user)
- Specified by:
countWatchedTasksin interfaceTaskStorage
-
getCollaboratedTasks
public List<TaskDto> getCollaboratedTasks(String user, int limit)
- Specified by:
getCollaboratedTasksin interfaceTaskStorage
-
countCollaboratedTasks
public Long countCollaboratedTasks(String user)
- Specified by:
countCollaboratedTasksin interfaceTaskStorage
-
getIncomingTasks
public List<TaskDto> getIncomingTasks(String user, int offset, int limit) throws Exception
- Specified by:
getIncomingTasksin interfaceTaskStorage- Throws:
Exception
-
countIncomingTasks
public int countIncomingTasks(String user) throws Exception
- Specified by:
countIncomingTasksin interfaceTaskStorage- Throws:
Exception
-
getOverdueTasks
public List<TaskDto> getOverdueTasks(String user, int limit)
- Specified by:
getOverdueTasksin interfaceTaskStorage
-
countOverdueTasks
public Long countOverdueTasks(String user)
- Specified by:
countOverdueTasksin interfaceTaskStorage
-
addWatcherToTask
public void addWatcherToTask(String username, TaskDto task)
- Specified by:
addWatcherToTaskin interfaceTaskStorage
-
deleteWatcherOfTask
public void deleteWatcherOfTask(String username, TaskDto task) throws Exception
- Specified by:
deleteWatcherOfTaskin interfaceTaskStorage- Throws:
Exception
-
getWatchersOfTask
public Set<String> getWatchersOfTask(TaskDto task)
- Specified by:
getWatchersOfTaskin interfaceTaskStorage
-
findTasks
public List<TaskDto> findTasks(String user, String query, int limit)
Find tasks assigned to a user using a term to find in title or description of the task- Specified by:
findTasksin interfaceTaskStorage- Parameters:
user- usernamequery- term to search in title or descriptionlimit- term to limit results.- Returns:
ListofTask
-
countTasks
public long countTasks(String user, String query)
Count tasks assigned to a user using a search term to find in title or description of the task- Specified by:
countTasksin interfaceTaskStorage- Parameters:
user- usernamequery- term to search in title or description- Returns:
- tasks count
-
addTaskLog
public ChangeLogEntry addTaskLog(ChangeLogEntry changeLogEntry) throws EntityNotFoundException
Description copied from interface:TaskStorageCreate a log associated with a task with givenchangeLogEntry.- Specified by:
addTaskLogin interfaceTaskStorage- Parameters:
changeLogEntry- changeLogEntry- Returns:
- Create a log associated
- Throws:
EntityNotFoundException- when user is not authorized to add taskLog.
-
getTaskLogs
public List<ChangeLogEntry> getTaskLogs(long taskId, int offset, int limit) throws Exception
- Specified by:
getTaskLogsin interfaceTaskStorage- Throws:
Exception
-
countTaskStatusByProject
public List<Object[]> countTaskStatusByProject(long projectId)
- Specified by:
countTaskStatusByProjectin interfaceTaskStorage
-
-