org.scale7.cassandra.pelops
Class Connection

java.lang.Object
  extended by org.scale7.cassandra.pelops.Connection
All Implemented Interfaces:
IConnection
Direct Known Subclasses:
CachePerNodePool.PooledConnection, CommonsBackedPool.PooledConnection, DebuggingPool.PooledConnection

public class Connection
extends Object
implements IConnection


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.scale7.cassandra.pelops.IConnection
IConnection.Config
 
Constructor Summary
Connection(Cluster.Node node, String keyspace)
           
 
Method Summary
 void close()
          Close the connection.
 org.apache.cassandra.thrift.Cassandra.Client getAPI()
          Get a reference to the Cassandra Thrift API
 Cluster.Node getNode()
          Get a string identifying the node
 boolean isOpen()
          Used to determine if the connection is open.
 boolean open()
          Opens a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection(Cluster.Node node,
                  String keyspace)
           throws SocketException,
                  org.apache.thrift.TException,
                  org.apache.cassandra.thrift.InvalidRequestException
Throws:
SocketException
org.apache.thrift.TException
org.apache.cassandra.thrift.InvalidRequestException
Method Detail

getAPI

public org.apache.cassandra.thrift.Cassandra.Client getAPI()
Get a reference to the Cassandra Thrift API

Specified by:
getAPI in interface IConnection
Returns:
The raw Thrift interface

getNode

public Cluster.Node getNode()
Get a string identifying the node

Specified by:
getNode in interface IConnection
Returns:
The IP or DNS address of the node

isOpen

public boolean isOpen()
Description copied from interface: IConnection
Used to determine if the connection is open.

Specified by:
isOpen in interface IConnection
Returns:
true if the connection is open, otherwise false

open

public boolean open()
Opens a connection.

Specified by:
open in interface IConnection
Returns:
true if the connection was opened, otherwise false

close

public void close()
Close the connection.

Specified by:
close in interface IConnection


Copyright © 2011. All Rights Reserved.