Class GroupService

java.lang.Object
com.eurodyn.qlack.fuse.lexicon.service.GroupService

@Transactional @Service @Validated public class GroupService extends Object
A Service class for Group . It is used to implement the crud operations
Author:
European Dynamics SA
  • Constructor Details

  • Method Details

    • createGroup

      public String createGroup(GroupDTO group)
      Creates a group.
      Parameters:
      group - a DTO containing all information about the persisted group
      Returns:
      the id of the group
    • updateGroup

      public void updateGroup(GroupDTO group)
      Updates a group.
      Parameters:
      group - a DTO containing all the information to update a persisted group
    • deleteGroup

      public void deleteGroup(String groupID)
      Deletes a group.
      Parameters:
      groupID - the id of the group to delete
    • getGroup

      public GroupDTO getGroup(String groupID)
      Fetches a group by given id.
      Parameters:
      groupID - the id of the group
      Returns:
      a DTO containing the group that matches the specific id
    • getGroupByTitle

      public GroupDTO getGroupByTitle(String groupTitle)
      Fetches a group by given title.
      Parameters:
      groupTitle - the title of the group
      Returns:
      a DTO containing the group that matches the specific title
    • findAll

      public List<Group> findAll()
      Fetches all groups.
      Returns:
      a list containing all persisted groups
    • findByTitle

      public Group findByTitle(String title)
      Fetches a group by given title.
      Parameters:
      title - the title of the group
      Returns:
      a DTO containing the group that matches the specific title
    • getRemainingGroups

      public Set<GroupDTO> getRemainingGroups(List<String> excludedGroupNames)
      Fetches all included groups.
      Parameters:
      excludedGroupNames - a list containing the names of excluded groups
      Returns:
      a set of DTO containing all included groups
    • getGroups

      public Set<GroupDTO> getGroups()
      Fetches all groups.
      Returns:
      a set of DTO containing all groups
    • deleteLanguageTranslations

      public void deleteLanguageTranslations(String groupID, String languageID)
      Deletes all translations of a given group for given language.
      Parameters:
      groupID - the id of the group
      languageID - the id of the language
    • deleteLanguageTranslationsByLocale

      public void deleteLanguageTranslationsByLocale(String groupID, String locale)
      Deletes all translation of a given group by given locale.
      Parameters:
      groupID - the id of the group
      locale - the locale name
    • getLastUpdateDateForLocale

      public long getLastUpdateDateForLocale(String groupID, String locale)
      Finds when was the last update of any key in given group for given locale.
      Parameters:
      groupID - the group id
      locale - the locale name
      Returns:
      a number representing the date of last update. The default return date is 'now'