Class UserDirectoryConnectionServiceImpl

    • Constructor Detail

      • UserDirectoryConnectionServiceImpl

        public UserDirectoryConnectionServiceImpl​(com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService,
                                                  com.atlassian.crowd.directory.loader.DirectoryInstanceLoader directoryInstanceLoader,
                                                  Clock clock)
    • Method Detail

      • getConnectionState

        public boolean getConnectionState​(com.atlassian.crowd.embedded.api.Directory directory)
        Checks connection state of a user directory.
        Specified by:
        getConnectionState in interface UserDirectoryConnectionService
        Parameters:
        directory - directory to check
        Returns:
        true if connection can be established, false otherwise
      • getLatency

        public Optional<Duration> getLatency​(com.atlassian.crowd.embedded.api.Directory directory)
        Checks latency of a user directory. Returns empty optional if connection cannot be established or directory cannot be found.
        Specified by:
        getLatency in interface UserDirectoryConnectionService
        Parameters:
        directory - directory to check
        Returns:
        Optional of latency duration. Empty if connection cannot be established or directory cannot be found.
      • findAllActiveExternalDirectories

        public Stream<com.atlassian.crowd.embedded.api.Directory> findAllActiveExternalDirectories()
        Returns all external and active directories.
        Specified by:
        findAllActiveExternalDirectories in interface UserDirectoryConnectionService
        Returns:
        Stream of user directories that are not internal and are active.