Class ActivityService
java.lang.Object
org.exoplatform.timetracker.service.ActivityService
A Service to access and store Activities
- Version:
- $Id: $Id
- Author:
- medamine
-
Constructor Summary
ConstructorsConstructorDescriptionActivityService(ActivityStorage activitiestorage) Constructor for ActivityService. -
Method Summary
Modifier and TypeMethodDescriptioncreateActivity(Activity activity) Create new Activity that will be available for all users.voiddeleteActivity(Long activityId, String username) Delete Activity identified by its id and check if username has permission to delete it.getActivitiesforUser(List<String> teams) Retrieves the list of Activities with offset, limit and a keyword that can be emptyRetrieves the list of Activities with offset, limit and a keyword that can be emptyupdateActivity(Activity Activity, String username) Update an existing Activity on datasource.
-
Constructor Details
-
ActivityService
Constructor for ActivityService.
- Parameters:
activitiestorage- aActivityStorageobject.
-
-
Method Details
-
createActivity
Create new Activity that will be available for all users. If the Activity already exits anEntityExistsExceptionwill be thrown. -
updateActivity
Update an existing Activity on datasource. If the Activity doesn't exit anEntityNotFoundExceptionwill be thrown. -
deleteActivity
public void deleteActivity(Long activityId, String username) throws jakarta.persistence.EntityNotFoundException, IllegalAccessException Delete Activity identified by its id and check if username has permission to delete it.- Parameters:
activityId- technical identifier of Activityusername- user currently deleting Activity- Throws:
jakarta.persistence.EntityNotFoundException- if Activity wasn't foundIllegalAccessException- if user is not allowed to delete Activity
-
getActivitiesList
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Returns:
- List of
Activitythat contains the list of Activities
-
getActivitiesforUser
Retrieves the list of Activities with offset, limit and a keyword that can be empty
-