Class UserDirectoryConnectionServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.internal.diagnostics.ipd.userdirectory.service.UserDirectoryConnectionServiceImpl
-
- All Implemented Interfaces:
UserDirectoryConnectionService
public class UserDirectoryConnectionServiceImpl extends Object implements UserDirectoryConnectionService
- Since:
- 8.7
-
-
Constructor Summary
Constructors Constructor Description UserDirectoryConnectionServiceImpl(com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService, com.atlassian.crowd.directory.loader.DirectoryInstanceLoader directoryInstanceLoader, Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<com.atlassian.crowd.embedded.api.Directory>
findAllActiveExternalDirectories()
Returns all external and active directories.boolean
getConnectionState(com.atlassian.crowd.embedded.api.Directory directory)
Checks connection state of a user directory.Optional<Duration>
getLatency(com.atlassian.crowd.embedded.api.Directory directory)
Checks latency of a user directory.
-
-
-
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 interfaceUserDirectoryConnectionService
- 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 interfaceUserDirectoryConnectionService
- 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 interfaceUserDirectoryConnectionService
- Returns:
- Stream of user directories that are not internal and are active.
-
-