com.twitter.common.zookeeper
Interface ZooKeeperClient.Credentials

Enclosing class:
ZooKeeperClient

public static interface ZooKeeperClient.Credentials

Encapsulates a user's credentials and has the ability to authenticate them through a ZooKeeper client.


Field Summary
static ZooKeeperClient.Credentials NONE
          A set of Credentials that performs no authentication.
 
Method Summary
 void authenticate(org.apache.zookeeper.ZooKeeper zooKeeper)
          Authenticates these credentials against the given ZooKeeper client.
 byte[] authToken()
          Returns the authentication token.
 String scheme()
          Returns the authentication scheme these credentials are for.
 

Field Detail

NONE

static final ZooKeeperClient.Credentials NONE
A set of Credentials that performs no authentication.

Method Detail

authenticate

void authenticate(org.apache.zookeeper.ZooKeeper zooKeeper)
Authenticates these credentials against the given ZooKeeper client.

Parameters:
zooKeeper - the client to authenticate

scheme

@Nullable
String scheme()
Returns the authentication scheme these credentials are for.

Returns:
the scheme these credentials are for or null if no authentication is intended.

authToken

@Nullable
byte[] authToken()
Returns the authentication token.

Returns:
the authentication token or null if no authentication is intended.