SimpleClient (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.transport

## Class SimpleClient

- java.lang.Object
- - org.apache.cassandra.transport.SimpleClient

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
  Direct Known Subclasses:
    Client

      public class SimpleClient
      extends java.lang.Object
      implements java.io.Closeable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `SimpleClient.EventHandler`
    `static class` | `SimpleClient.SimpleEventHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected io.netty.bootstrap.Bootstrap` | `bootstrap`
    `protected io.netty.channel.Channel` | `channel`
    `protected Connection` | `connection`
    `java.lang.String` | `host`
    `protected io.netty.channel.ChannelFuture` | `lastWriteFuture`
    `int` | `port`
    `protected org.apache.cassandra.transport.SimpleClient.ResponseHandler` | `responseHandler`
    `protected Connection.Tracker` | `tracker`
    `protected ProtocolVersion` | `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleClient(java.lang.String host, int port)`
    `SimpleClient(java.lang.String host, int port, EncryptionOptions.ClientEncryptionOptions encryptionOptions)`
    `SimpleClient(java.lang.String host, int port, ProtocolVersion version)`
    `SimpleClient(java.lang.String host, int port, ProtocolVersion version, boolean useBeta, EncryptionOptions.ClientEncryptionOptions encryptionOptions)`
    `SimpleClient(java.lang.String host, int port, ProtocolVersion version, EncryptionOptions.ClientEncryptionOptions encryptionOptions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `connect(boolean useCompression)`
    `protected void` | `establishConnection()`
    `Message.Response` | `execute(Message.Request request)`
    `ResultMessage` | `execute(java.lang.String query, ConsistencyLevel consistency)`
    `ResultMessage` | `execute(java.lang.String query, java.util.List<java.nio.ByteBuffer> values, ConsistencyLevel consistencyLevel)`
    `ResultMessage` | `executePrepared(byte[] statementId, java.util.List<java.nio.ByteBuffer> values, ConsistencyLevel consistency)`
    `void` | `login(java.util.Map<java.lang.String,java.lang.String> credentials)`
    `ResultMessage.Prepared` | `prepare(java.lang.String query)`
    `void` | `setEventHandler(SimpleClient.EventHandler eventHandler)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### host

          public final java.lang.String host

    - #### port

          public final int port

    - #### responseHandler

          protected final org.apache.cassandra.transport.SimpleClient.ResponseHandler responseHandler

    - #### tracker

          protected final Connection.Tracker tracker

    - #### version

          protected final ProtocolVersion version

    - #### connection

          protected Connection connection

    - #### bootstrap

          protected io.netty.bootstrap.Bootstrap bootstrap

    - #### channel

          protected io.netty.channel.Channel channel

    - #### lastWriteFuture

          protected io.netty.channel.ChannelFuture lastWriteFuture

  - ### Constructor Detail

    - #### SimpleClient

          public SimpleClient(java.lang.String host,
                              int port,
                              ProtocolVersion version,
                              EncryptionOptions.ClientEncryptionOptions encryptionOptions)

    - #### SimpleClient

          public SimpleClient(java.lang.String host,
                              int port,
                              EncryptionOptions.ClientEncryptionOptions encryptionOptions)

    - #### SimpleClient

          public SimpleClient(java.lang.String host,
                              int port,
                              ProtocolVersion version)

    - #### SimpleClient

          public SimpleClient(java.lang.String host,
                              int port,
                              ProtocolVersion version,
                              boolean useBeta,
                              EncryptionOptions.ClientEncryptionOptions encryptionOptions)

    - #### SimpleClient

          public SimpleClient(java.lang.String host,
                              int port)

  - ### Method Detail

    - #### connect

          public void connect(boolean useCompression)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### setEventHandler

          public void setEventHandler(SimpleClient.EventHandler eventHandler)

    - #### establishConnection

          protected void establishConnection()
                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### login

          public void login(java.util.Map<java.lang.String,java.lang.String> credentials)

    - #### execute

          public ResultMessage execute(java.lang.String query,
                                       ConsistencyLevel consistency)

    - #### execute

          public ResultMessage execute(java.lang.String query,
                                       java.util.List<java.nio.ByteBuffer> values,
                                       ConsistencyLevel consistencyLevel)

    - #### prepare

          public ResultMessage.Prepared prepare(java.lang.String query)

    - #### executePrepared

          public ResultMessage executePrepared(byte[] statementId,
                                               java.util.List<java.nio.ByteBuffer> values,
                                               ConsistencyLevel consistency)

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

    - #### execute

          public Message.Response execute(Message.Request request)

Copyright © 2018 The Apache Software Foundation