Class CachingApplicationService

java.lang.Object
com.atlassian.crowd.manager.application.AbstractDelegatingApplicationService
com.atlassian.crowd.manager.application.CachingApplicationService
All Implemented Interfaces:
ApplicationService

@Transactional public class CachingApplicationService extends AbstractDelegatingApplicationService
Implementation of ApplicationService which caches the result of ApplicationService methods.
Since:
v2.2
  • Constructor Details

    • CachingApplicationService

      public CachingApplicationService(ApplicationService applicationService, UserAuthorisationCache userAuthorisationCache, com.atlassian.event.api.EventPublisher eventPublisher)
  • Method Details

    • registerListener

      @PostConstruct public void registerListener()
    • unregisterListener

      @PreDestroy public void unregisterListener()
    • isUserAuthorised

      public boolean isUserAuthorised(Application application, String username)
      Description copied from interface: ApplicationService
      Returns true if the user is permitted to attempt authentication with the application. If the user could not be found, then false is returned.

      For a user to have access to an application:

      1. the Application must be active.
      2. and either:
        • the User is stored in a directory which is associated to the Application and the "allow all to authenticate" flag is true.
        • the User is a member of a Group that is allowed to authenticate with the Application and both the User and Group are from the same RemoteDirectory.
      Specified by:
      isUserAuthorised in interface ApplicationService
      Overrides:
      isUserAuthorised in class AbstractDelegatingApplicationService
      Parameters:
      application - application user is authenticating against
      username - username
      Returns:
      true</tt> if the user is permitted to attempt authentication with the application, otherwise <tt>false. If the user could not be found, false will be returned.
    • isUserAuthorised

      public boolean isUserAuthorised(Application application, User user)
      Description copied from interface: ApplicationService
      Returns true if the user is permitted to attempt authentication with the application. If the user could not be found, then false is returned.

      For a user to have access to an application:

      1. the Application must be active.
      2. and either:
        • the User is stored in a directory which is associated to the Application and the "allow all to authenticate" flag is true.
        • the User is a member of a Group that is allowed to authenticate with the Application and both the User and Group are from the same RemoteDirectory.
      Specified by:
      isUserAuthorised in interface ApplicationService
      Overrides:
      isUserAuthorised in class AbstractDelegatingApplicationService
      Parameters:
      application - application user is authenticating against
      user - the user that will be checked
      Returns:
      true</tt> if the user is permitted to attempt authentication with the application, otherwise <tt>false. If the user could not be found, false will be returned.
    • onApplicationUpdated

      @EventListener public void onApplicationUpdated(ApplicationUpdatedEvent event)
    • onDirectoryUpdated

      @EventListener public void onDirectoryUpdated(DirectoryUpdatedEvent event)
    • onDirectoryDeleted

      @EventListener public void onDirectoryDeleted(DirectoryDeletedEvent event)
    • onBackupRestored

      @EventListener public void onBackupRestored(XMLRestoreFinishedEvent event)