public class ClientState
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static CassandraVersion |
DEFAULT_CQL_VERSION |
boolean |
isInternal |
Modifier | Constructor and Description |
---|---|
protected |
ClientState(java.net.InetSocketAddress remoteAddress) |
Modifier and Type | Method and Description |
---|---|
void |
ensureHasPermission(Permission permission,
Function function) |
void |
ensureHasPermission(Permission perm,
IResource resource) |
void |
ensureIsSuper(java.lang.String message) |
void |
ensureNotAnonymous() |
static ClientState |
forExternalCalls(java.net.SocketAddress remoteAddress) |
static ClientState |
forInternalCalls() |
static QueryHandler |
getCQLQueryHandler() |
static CassandraVersion[] |
getCQLSupportedVersion() |
java.lang.String |
getKeyspace() |
java.lang.String |
getRawKeyspace() |
java.net.InetSocketAddress |
getRemoteAddress() |
long |
getTimestamp()
This clock guarantees that updates for the same ClientState will be ordered
in the sequence seen, even if multiple updates happen in the same millisecond.
|
AuthenticatedUser |
getUser() |
void |
hasAllKeyspacesAccess(Permission perm) |
void |
hasColumnFamilyAccess(java.lang.String keyspace,
java.lang.String columnFamily,
Permission perm) |
void |
hasKeyspaceAccess(java.lang.String keyspace,
Permission perm) |
void |
login(AuthenticatedUser user)
Attempts to login the given user.
|
void |
setKeyspace(java.lang.String ks) |
void |
updateLastTimestamp(long tstampMicros)
Can be use when a timestamp has been assigned by a query, but that timestamp is
not directly one returned by getTimestamp() (see SP.beginAndRepairPaxos()).
|
void |
validateLogin() |
public static final CassandraVersion DEFAULT_CQL_VERSION
public final boolean isInternal
public static ClientState forInternalCalls()
public static ClientState forExternalCalls(java.net.SocketAddress remoteAddress)
public long getTimestamp()
public void updateLastTimestamp(long tstampMicros)
public static QueryHandler getCQLQueryHandler()
public java.net.InetSocketAddress getRemoteAddress()
public java.lang.String getRawKeyspace()
public java.lang.String getKeyspace() throws InvalidRequestException
InvalidRequestException
public void setKeyspace(java.lang.String ks) throws InvalidRequestException
InvalidRequestException
public void login(AuthenticatedUser user) throws AuthenticationException
AuthenticationException
public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException
UnauthorizedException
public void hasKeyspaceAccess(java.lang.String keyspace, Permission perm) throws UnauthorizedException, InvalidRequestException
public void hasColumnFamilyAccess(java.lang.String keyspace, java.lang.String columnFamily, Permission perm) throws UnauthorizedException, InvalidRequestException
public void ensureHasPermission(Permission perm, IResource resource) throws UnauthorizedException
UnauthorizedException
public void ensureHasPermission(Permission permission, Function function)
public void validateLogin() throws UnauthorizedException
UnauthorizedException
public void ensureNotAnonymous() throws UnauthorizedException
UnauthorizedException
public void ensureIsSuper(java.lang.String message) throws UnauthorizedException
UnauthorizedException
public AuthenticatedUser getUser()
public static CassandraVersion[] getCQLSupportedVersion()
Copyright © 2015 The Apache Software Foundation