Class JpaCustomizedAdminRoleRepository<D extends JpaAdminRole>

java.lang.Object
com.broadleafcommerce.adminuser.user.provider.jpa.repository.JpaCustomizedAdminRoleRepository<D>
All Implemented Interfaces:
CustomizedAdminRoleRepository<D>, com.broadleafcommerce.common.extension.DomainTypeAware, com.broadleafcommerce.common.messaging.notification.NotificationStateRepository, com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment

@Deprecated public class JpaCustomizedAdminRoleRepository<D extends JpaAdminRole> extends Object implements CustomizedAdminRoleRepository<D>, com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment
Deprecated.
since 1.7.0. Roles and permissions are managed in auth.
Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • JpaCustomizedAdminRoleRepository

      public JpaCustomizedAdminRoleRepository(com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment notificationStateRepository, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser, cz.jirutka.rsql.parser.ast.RSQLVisitor<jakarta.persistence.criteria.Predicate,Class<?>> rsqlVisitor)
      Deprecated.
  • Method Details

    • save

      @Transactional("adminUserTransactionManager") public Object save(Object entity)
      Deprecated.
    • saveAll

      @Transactional("adminUserTransactionManager") public List<Object> saveAll(Iterable<?> entities)
      Deprecated.
    • getDomainType

      public Class<D> getDomainType()
      Deprecated.
      Specified by:
      getDomainType in interface com.broadleafcommerce.common.extension.DomainTypeAware
    • existsByNameAndIdNot

      public boolean existsByNameAndIdNot(@NonNull @NonNull String name, @Nullable String id)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reports whether there exists a role in the data store whose AdminRole.name is equal to the given name and whose AdminRole.id is not equal to the given id.

      Similar to CustomizedAdminRoleRepository.existsByNameAndIdNotInTenantOrGlobal(String, String, String) but without any tenant-discrimination.

      Specified by:
      existsByNameAndIdNot in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      name - the value that role name must equal in order to match
      id - (optional) the value that the role's id must not equal in order to match. If this value is null, then results will not be filtered by their id.
      Returns:
      true if there exists a role matching the given name and not matching the given id, false otherwise
      See Also:
    • existsByNameAndIdNotInTenantOrGlobal

      public boolean existsByNameAndIdNotInTenantOrGlobal(@NonNull @NonNull String name, @Nullable String id, @Nullable String tenantId)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reports whether there exists a role in the data store whose AdminRole.name is equal to the given name and whose AdminRole.id is not equal to the given id.

      Results are restricted to only the roles accessible from the given context as described in the class-level javadocs.

      Similar to CustomizedAdminRoleRepository.existsByNameAndIdNot(String, String) but with tenant-discrimination.

      Specified by:
      existsByNameAndIdNotInTenantOrGlobal in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      name - the value that role name must equal in order to match
      id - (optional) the value that the role's id must not equal in order to match. If this value is null, then results will not be filtered by their id.
      tenantId - the ID of the tenant to restrict the results by. If this is also null, then only roles with a null tenant ID will be returned.
      Returns:
      true if there exists a role with a matching or null tenant ID, a matching name, and a not matching id, false otherwise
      See Also:
    • existsByNameAndIdNotInternal

      protected boolean existsByNameAndIdNotInternal(@NonNull @NonNull String name, @Nullable String id, boolean filterOnTenantId, @Nullable String tenantId)
      Deprecated.
      Implements behavior for existsByNameAndIdNot(String, String) and existsByNameAndIdNotInTenantOrGlobal(String, String, String), as they have very similar requirements. They differ only in whether they filter on tenant ID.
      Parameters:
      name - the value that role name must equal in order to match
      id - (optional) the value that the role's id must not equal in order to match. If this value is null, then results will not be filtered by their id.
      filterOnTenantId - used to determine whether the given tenantId should be considered at all in the criteria. Distinguishes between the existsByNameAndIdNot(String, String) use-case and existsByNameAndIdNotInTenantOrGlobal(String, String, String).
      tenantId - the ID of the tenant to restrict the results by. If this is also null, then only roles with a null tenant ID will be returned. Filtration is only done on tenantId if filterOnTenantId is true.
      Returns:
      true if a record exists matching the given criteria, false otherwise
    • findByIdsInTenantOrGlobal

      public List<D> findByIdsInTenantOrGlobal(Collection<String> ids, @Nullable String tenantId)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reads the roles in the data store which have the given IDs. The roles must either have a tenant ID matching the given value or a null tenant ID (global).
      Specified by:
      findByIdsInTenantOrGlobal in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      ids - the IDs of the roles to find
      tenantId - the ID of the tenant to restrict the results by. If this is also null, then only roles with a null tenant ID will be returned.
      Returns:
      roles that match the given IDs with either a null tenant ID or the given tenant ID
    • findByNameContainingIgnoreCaseInTenantOrGlobal

      public org.springframework.data.domain.Page<D> findByNameContainingIgnoreCaseInTenantOrGlobal(String name, @Nullable String tenantId, org.springframework.data.domain.Pageable pageable)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reads roles in the data store, filtering to those whose name contains the given value. Results are also restricted to only the roles that have a tenant ID matching the given value or a null tenant ID (global).
      Specified by:
      findByNameContainingIgnoreCaseInTenantOrGlobal in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      name - the value that role names must contain in order to match
      tenantId - the ID of the tenant to filter results by. If this is also null, then only roles with null tenant IDs will be returned.
      pageable - describes the page of results to return
      Returns:
      roles that match the given name with either a null tenant ID or the given tenant ID
    • findByNameContainingIgnoreCase

      public org.springframework.data.domain.Page<D> findByNameContainingIgnoreCase(String name, org.springframework.data.domain.Pageable pageable)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reads roles in the data store, filtering to those whose name contains the given value. Results are also restricted to only the roles that have a tenant ID matching the given value or a null tenant ID (global).
      Specified by:
      findByNameContainingIgnoreCase in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      name - the value that role names must contain in order to match
      pageable - describes the page of results to return
      Returns:
      roles that match the given name with either a null tenant ID or the given tenant ID
    • findByIdInTenantOrGlobal

      public Optional<D> findByIdInTenantOrGlobal(String id, String tenantId)
      Deprecated.
      Description copied from interface: CustomizedAdminRoleRepository
      Reads the role in the data store which has the given ID. The role must either have a tenant ID matching the given value or a null tenant ID (global).
      Specified by:
      findByIdInTenantOrGlobal in interface CustomizedAdminRoleRepository<D extends JpaAdminRole>
      Parameters:
      id - the ID of the role to find
      tenantId - the ID of the tenant to restrict the result by. If this is also null, then only a role with a null tenant ID will be returned.
      Returns:
      an Optional containing the role if found, or Optional.empty()
    • setNotificationAcknowledged

      public boolean setNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType)
      Deprecated.
      Specified by:
      setNotificationAcknowledged in interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
    • setFailedNotificationAttempt

      public boolean setFailedNotificationAttempt(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped)
      Deprecated.
      Specified by:
      setFailedNotificationAttempt in interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
    • findNotificationReadyMembers

      public Stream<com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware> findNotificationReadyMembers(@Nullable Object lastProcessedNativeId, int pageSize, String messageType, Duration faultThreshold, Class<?> entityType)
      Deprecated.
      Specified by:
      findNotificationReadyMembers in interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
    • getNotificationStateRepository

      protected com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment getNotificationStateRepository()
      Deprecated.