Class FeatureService
- java.lang.Object
-
- org.exoplatform.timetracker.service.FeatureService
-
public class FeatureService extends java.lang.ObjectA Service to access and store Activities- Version:
- $Id: $Id
- Author:
- medamine
-
-
Constructor Summary
Constructors Constructor Description FeatureService(FeatureStorage featureStorage)Constructor for FeatureService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeaturecreateFeature(Feature feature)Create new Feature that will be available for all users.voiddeleteFeature(java.lang.Long featureId, java.lang.String username)Delete Feature identified by its id and check if username has permission to delete it.java.util.List<Feature>getFeaturesList()Retrieves the list of Activities with offset, limit and a keyword that can be emptyFeatureupdateFeature(Feature Feature, java.lang.String username)Update an existing Feature on datasource.
-
-
-
Constructor Detail
-
FeatureService
public FeatureService(FeatureStorage featureStorage)
Constructor for FeatureService.
- Parameters:
featureStorage- aFeatureStorageobject.
-
-
Method Detail
-
createFeature
public Feature createFeature(Feature feature) throws java.lang.Exception
Create new Feature that will be available for all users. If the Feature already exits anEntityExistsExceptionwill be thrown.- Parameters:
feature- Feature to create- Returns:
- stored
Featurein datasource - Throws:
java.lang.Exception- when Feature already exists or an error occurs while creating Feature or its attached image
-
updateFeature
public Feature updateFeature(Feature Feature, java.lang.String username) throws java.lang.Exception
Update an existing Feature on datasource. If the Feature doesn't exit anEntityNotFoundExceptionwill be thrown.- Parameters:
Feature- dto to update on storeusername- username storing Feature- Returns:
- stored
Featurein datasource - Throws:
java.lang.Exception- whenExceptionis thrown or an error occurs while saving Feature
-
deleteFeature
public void deleteFeature(java.lang.Long featureId, java.lang.String username) throws javax.persistence.EntityNotFoundException, java.lang.IllegalAccessExceptionDelete Feature identified by its id and check if username has permission to delete it.- Parameters:
featureId- technical identifier of Featureusername- user currently deleting Feature- Throws:
javax.persistence.EntityNotFoundException- if Feature wasn't foundjava.lang.IllegalAccessException- if user is not allowed to delete Feature
-
-