Class ClientService

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

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

    • ClientService

      public ClientService(ClientStorage clientStorage)

      Constructor for ClientService.

      Parameters:
      clientStorage - a ClientStorage object.
  • Method Details

    • createClient

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

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

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

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