Class GroupServiceImpl

java.lang.Object
com.foreach.across.modules.user.services.GroupServiceImpl
All Implemented Interfaces:
GroupService, org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>

@Service public class GroupServiceImpl extends Object implements GroupService
Author:
Arne Vandamme
  • Constructor Details

    • GroupServiceImpl

      public GroupServiceImpl()
  • Method Details

    • getGroups

      public Collection<Group> getGroups()
      Specified by:
      getGroups in interface GroupService
    • getGroupById

      @Cacheable(value="securityPrincipalCache", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupById(long id)
      Specified by:
      getGroupById in interface GroupService
    • getGroupByName

      @Cacheable(value="groupCache", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupByName(String name)
      Description copied from interface: GroupService
      Get the group with a given name in the default directory.
      Specified by:
      getGroupByName in interface GroupService
      Parameters:
      name - of the group
      Returns:
      instance or null if not found
    • getGroupByName

      @Cacheable(value="groupCache", key="#p0 + \':\' + #p1.id", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupByName(String name, UserDirectory directory)
      Description copied from interface: GroupService
      Get the group with a given name in the specified directory.
      Specified by:
      getGroupByName in interface GroupService
      Parameters:
      name - of the group
      directory - the group should belong to
      Returns:
      instance or null if not found
    • save

      public Group save(Group groupDto)
      Specified by:
      save in interface GroupService
    • delete

      @Transactional("jpaTransactionManager") public void delete(long groupId)
      Specified by:
      delete in interface GroupService
    • getProperties

      public GroupProperties getProperties(Group group)
      Specified by:
      getProperties in interface GroupService
    • saveProperties

      public void saveProperties(GroupProperties groupProperties)
      Specified by:
      saveProperties in interface GroupService
    • deleteProperties

      public void deleteProperties(Group group)
      Specified by:
      deleteProperties in interface GroupService
    • deleteProperties

      public void deleteProperties(long groupId)
      Specified by:
      deleteProperties in interface GroupService
    • getGroupsWithPropertyValue

      @Transactional(readOnly=true, value="jpaTransactionManager") public Collection<Group> getGroupsWithPropertyValue(String propertyName, Object propertyValue)
      Description copied from interface: GroupService
      Returns all groups having a specific property value. Will return all matching groups across all user directories.
      Specified by:
      getGroupsWithPropertyValue in interface GroupService
      Parameters:
      propertyName - name of the property
      propertyValue - value the property should have
      Returns:
      groups
    • findAll

      public Collection<Group> findAll(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findAll in interface GroupService
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findAll

      public Iterable<Group> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findAll

      public Collection<Group> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
      Specified by:
      findAll in interface GroupService
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findAll

      public Iterable<Group> findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findAll

      public org.springframework.data.domain.Page<Group> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable)
      Specified by:
      findAll in interface GroupService
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • count

      public long count(com.querydsl.core.types.Predicate predicate)
      Specified by:
      count in interface GroupService
      Specified by:
      count in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • exists

      public boolean exists(com.querydsl.core.types.Predicate predicate)
      Specified by:
      exists in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findBy

      public <S extends Group, R> R findBy(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
      Specified by:
      findBy in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
    • findOne

      public Optional<Group> findOne(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findOne in interface GroupService
      Specified by:
      findOne in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>