Class SettingsStorage

java.lang.Object
org.exoplatform.timetracker.storage.SettingsStorage

public class SettingsStorage extends Object
Storage service to access / load and save Codes. This service will be used , as well, to convert from JPA entity to DTO.
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

  • Method Details

    • createWorkTime

      public WorkTime createWorkTime(WorkTime workTime) throws Exception

      createWorkTime.

      Parameters:
      workTime - a WorkTime object.
      Returns:
      a WorkTime object.
      Throws:
      Exception - if any.
    • updateWorkTime

      public WorkTime updateWorkTime(WorkTime workTime) throws Exception

      updateWorkTime.

      Parameters:
      workTime - a WorkTime object.
      Returns:
      a WorkTime object.
      Throws:
      Exception - if any.
    • deleteWorkTime

      public void deleteWorkTime(long workTimeId) throws org.gatein.api.EntityNotFoundException

      deleteWorkTime.

      Parameters:
      workTimeId - a long.
      Throws:
      org.gatein.api.EntityNotFoundException - if any.
    • getWorkTimeById

      public WorkTime getWorkTimeById(long WorkTimeId)

      getWorkTimeById.

      Parameters:
      WorkTimeId - a long.
      Returns:
      a WorkTime object.
    • getWorkTimes

      public List<WorkTime> getWorkTimes()

      getWorkTimes.

      Returns:
      a List object.
    • countWorkTimes

      public long countWorkTimes()

      countWorkTimes.

      Returns:
      a long.
    • toWorkTimeDTO

      public WorkTime toWorkTimeDTO(WorkTimeEntity workTimeEntity)

      toWorkTimeDTO.

      Parameters:
      workTimeEntity - a WorkTimeEntity object.
      Returns:
      a WorkTime object.
    • toWorkTimeEntity

      public WorkTimeEntity toWorkTimeEntity(WorkTime workTime)

      toWorkTimeEntity.

      Parameters:
      workTime - a WorkTime object.
      Returns:
      a WorkTimeEntity object.
    • createLocation

      public Location createLocation(Location location) throws Exception

      createLocation.

      Parameters:
      location - a Location object.
      Returns:
      a Location object.
      Throws:
      Exception - if any.
    • updateLocation

      public Location updateLocation(Location location) throws Exception

      updateLocation.

      Parameters:
      location - a Location object.
      Returns:
      a Location object.
      Throws:
      Exception - if any.
    • deleteLocation

      public void deleteLocation(String code) throws org.gatein.api.EntityNotFoundException

      deleteLocation.

      Parameters:
      code - a String.
      Throws:
      org.gatein.api.EntityNotFoundException - if any.
    • getLocationByCode

      public Location getLocationByCode(String code)

      getLocationById.

      Parameters:
      code - a String.
      Returns:
      a Location object.
    • getLocations

      public List<Location> getLocations()

      getLocations.

      Returns:
      a List object.
    • countLocations

      public long countLocations()

      countLocations.

      Returns:
      a long.
    • toLocationDTO

      public Location toLocationDTO(LocationEntity locationEntity)

      toLocationDTO.

      Parameters:
      locationEntity - a LocationEntity object.
      Returns:
      a Location object.
    • toLocationEntity

      public LocationEntity toLocationEntity(Location location)

      toLocationEntity.

      Parameters:
      location - a Location object.
      Returns:
      a LocationEntity object.
    • createOffice

      public Office createOffice(Office office) throws Exception

      createOffice.

      Parameters:
      office - a Office object.
      Returns:
      a Office object.
      Throws:
      Exception - if any.
    • updateOffice

      public Office updateOffice(Office office) throws Exception

      updateOffice.

      Parameters:
      office - a Office object.
      Returns:
      a Office object.
      Throws:
      Exception - if any.
    • deleteOffice

      public void deleteOffice(String code) throws org.gatein.api.EntityNotFoundException

      deleteOffice.

      Parameters:
      code - a String.
      Throws:
      org.gatein.api.EntityNotFoundException - if any.
    • getOfficeByCode

      public Office getOfficeByCode(String code)

      getOfficeById.

      Parameters:
      code - a long.
      Returns:
      a Office object.
    • getOffices

      public List<Office> getOffices()

      getOffices.

      Returns:
      a List object.
    • countOffices

      public long countOffices()

      countOffices.

      Returns:
      a long.
    • toOfficeDTO

      public Office toOfficeDTO(OfficeEntity officeEntity)

      toOfficeDTO.

      Parameters:
      officeEntity - a OfficeEntity object.
      Returns:
      a Office object.
    • toOfficeEntity

      public OfficeEntity toOfficeEntity(Office office)

      toOfficeEntity.

      Parameters:
      office - a Office object.
      Returns:
      a OfficeEntity object.