Package com.couchbase.client.java.auth
Class ClassicAuthenticator
java.lang.Object
com.couchbase.client.java.auth.ClassicAuthenticator
- All Implemented Interfaces:
Authenticator
@Committed @Public public class ClassicAuthenticator extends Object implements Authenticator
An
Authenticator based on login/password credentials.- Since:
- 2.3
- Author:
- Simon Baslé
-
Constructor Summary
Constructors Constructor Description ClassicAuthenticator() -
Method Summary
Modifier and Type Method Description ClassicAuthenticatorbucket(String bucketName, String password)Sets theCredentialContext.BUCKET_KV/CredentialContext.BUCKET_N1QLcredential for the the *bucketName* specific.ClassicAuthenticatorcluster(String adminName, String adminPassword)Sets theCredentialContext.CLUSTER_MANAGEMENTcredential.List<Credential>getCredentials(CredentialContext context, String specific)Retrieve the credentials store by thisAuthenticatorfor the givenCredentialContextand optional specific.booleanisEmpty()
-
Constructor Details
-
ClassicAuthenticator
public ClassicAuthenticator()
-
-
Method Details
-
getCredentials
Description copied from interface:AuthenticatorRetrieve the credentials store by thisAuthenticatorfor the givenCredentialContextand 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.- Specified by:
getCredentialsin interfaceAuthenticator- 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.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceAuthenticator- Returns:
- true if this
Authenticatordoesn't have any credentials set.
-
bucket
Sets theCredentialContext.BUCKET_KV/CredentialContext.BUCKET_N1QLcredential for the the *bucketName* specific.- Parameters:
bucketName- the name of the bucket for which to set a password.password- the password for the bucket.- Returns:
- this
ClassicAuthenticatorfor chaining.
-
cluster
Sets theCredentialContext.CLUSTER_MANAGEMENTcredential. Specific is ignored in this context.- Parameters:
adminName- the administrative login to use.adminPassword- the administrative password to use.- Returns:
- this
ClassicAuthenticatorfor chaining.
-