Package com.couchbase.client.java.auth
Interface Authenticator
- All Known Implementing Classes:
CertAuthenticator
,ClassicAuthenticator
,PasswordAuthenticator
@Committed @Private public interface Authenticator
An Authenticator abstracts credential management for various couchbase operations
(all of which fall into one
CredentialContext
). The interface allows SDK
classes to retrieve credentials corresponding to both a context and a specific
(wich can be optional for some contexts).- Since:
- 2.3
- Author:
- Simon Baslé
-
Method Summary
Modifier and Type Method Description List<Credential>
getCredentials(CredentialContext context, String specific)
Retrieve the credentials store by thisAuthenticator
for the givenCredentialContext
and optional specific.boolean
isEmpty()
-
Method Details
-
getCredentials
Retrieve the credentials store by thisAuthenticator
for the givenCredentialContext
and optional specific. If no corresponding credential can be found, an empty list is returned. If the context / specific cannot be processed by this Authenticator, throws anIllegalArgumentException
.- Parameters:
context
- the context for which the credential(s) will be used.specific
- a more restrictive sub-context specific to the context.- Returns:
- a list of credentials that can be used for the context/operation, or empty list if none was set for this context+specific combination.
- Throws:
IllegalArgumentException
- when the context+specific combination is not supported by an Authenticator implementation.
-
isEmpty
boolean isEmpty()- Returns:
- true if this
Authenticator
doesn't have any credentials set.
-