org.apache.cassandra.service
Class ClientState

java.lang.Object
  extended by org.apache.cassandra.service.ClientState

public class ClientState
extends java.lang.Object

A container for per-client, thread-local state that Avro/Thrift threads must hold. TODO: Kill thrift exceptions


Constructor Summary
ClientState()
          Construct a new, empty ClientState: can be reused after logout() or reset().
 
Method Summary
 java.lang.String getKeyspace()
           
 java.lang.String getRawKeyspace()
           
 java.lang.String getSchedulingValue()
           
 long getTimestamp()
          This clock guarantees that updates from a given client will be ordered in the sequence seen, even if multiple updates happen in the same millisecond.
 void hasColumnFamilyAccess(java.lang.String columnFamily, Permission perm)
          Confirms that the client thread has the given Permission in the context of the given ColumnFamily and the current keyspace.
 void hasColumnFamilyAccess(java.lang.String keyspace, java.lang.String columnFamily, Permission perm)
           
 void hasColumnFamilySchemaAccess(Permission perm)
          Confirms that the client thread has the given Permission for the ColumnFamily list of the current keyspace.
 void hasKeyspaceSchemaAccess(Permission perm)
          Confirms that the client thread has the given Permission for the Keyspace list.
 void login(java.util.Map<? extends java.lang.CharSequence,? extends java.lang.CharSequence> credentials)
          Attempts to login this client with the given credentials map.
 void logout()
           
 void reset()
           
 void setKeyspace(java.lang.String ks)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientState

public ClientState()
Construct a new, empty ClientState: can be reused after logout() or reset().

Method Detail

getRawKeyspace

public java.lang.String getRawKeyspace()

getKeyspace

public java.lang.String getKeyspace()
                             throws org.apache.cassandra.thrift.InvalidRequestException
Throws:
org.apache.cassandra.thrift.InvalidRequestException

setKeyspace

public void setKeyspace(java.lang.String ks)

getSchedulingValue

public java.lang.String getSchedulingValue()

login

public void login(java.util.Map<? extends java.lang.CharSequence,? extends java.lang.CharSequence> credentials)
           throws org.apache.cassandra.thrift.AuthenticationException
Attempts to login this client with the given credentials map.

Throws:
org.apache.cassandra.thrift.AuthenticationException

logout

public void logout()

reset

public void reset()

hasKeyspaceSchemaAccess

public void hasKeyspaceSchemaAccess(Permission perm)
                             throws org.apache.cassandra.thrift.InvalidRequestException
Confirms that the client thread has the given Permission for the Keyspace list.

Throws:
org.apache.cassandra.thrift.InvalidRequestException

hasColumnFamilySchemaAccess

public void hasColumnFamilySchemaAccess(Permission perm)
                                 throws org.apache.cassandra.thrift.InvalidRequestException
Confirms that the client thread has the given Permission for the ColumnFamily list of the current keyspace.

Throws:
org.apache.cassandra.thrift.InvalidRequestException

hasColumnFamilyAccess

public void hasColumnFamilyAccess(java.lang.String columnFamily,
                                  Permission perm)
                           throws org.apache.cassandra.thrift.InvalidRequestException
Confirms that the client thread has the given Permission in the context of the given ColumnFamily and the current keyspace.

Throws:
org.apache.cassandra.thrift.InvalidRequestException

hasColumnFamilyAccess

public void hasColumnFamilyAccess(java.lang.String keyspace,
                                  java.lang.String columnFamily,
                                  Permission perm)
                           throws org.apache.cassandra.thrift.InvalidRequestException
Throws:
org.apache.cassandra.thrift.InvalidRequestException

getTimestamp

public long getTimestamp()
This clock guarantees that updates from a given client will be ordered in the sequence seen, even if multiple updates happen in the same millisecond. This can be useful when a client wants to perform multiple updates to a single column.



Copyright © 2011 The Apache Software Foundation