Class FeatureService

java.lang.Object
org.exoplatform.timetracker.service.FeatureService

public class FeatureService extends Object
A Service to access and store Activities
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

    • FeatureService

      public FeatureService(FeatureStorage featureStorage)

      Constructor for FeatureService.

      Parameters:
      featureStorage - a FeatureStorage object.
  • Method Details

    • createFeature

      public Feature createFeature(Feature feature) throws Exception
      Create new Feature that will be available for all users. If the Feature already exits an EntityExistsException will be thrown.
      Parameters:
      feature - Feature to create
      Returns:
      stored Feature in datasource
      Throws:
      Exception - when Feature already exists or an error occurs while creating Feature or its attached image
    • updateFeature

      public Feature updateFeature(Feature Feature, String username) throws Exception
      Update an existing Feature on datasource. If the Feature doesn't exit an EntityNotFoundException will be thrown.
      Parameters:
      Feature - dto to update on store
      username - username storing Feature
      Returns:
      stored Feature in datasource
      Throws:
      Exception - when Exception is thrown or an error occurs while saving Feature
    • deleteFeature

      public void deleteFeature(Long featureId, String username) throws javax.persistence.EntityNotFoundException, IllegalAccessException
      Delete Feature identified by its id and check if username has permission to delete it.
      Parameters:
      featureId - technical identifier of Feature
      username - user currently deleting Feature
      Throws:
      javax.persistence.EntityNotFoundException - if Feature wasn't found
      IllegalAccessException - if user is not allowed to delete Feature
    • getFeaturesList

      public List<Feature> getFeaturesList()
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      Returns:
      List of Feature that contains the list of Activities