# Class ConnectionHandler (0.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.27.1 (latest)](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.27.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.26.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.25.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.24.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.23.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.22.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.21.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.20.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.19.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.18.4](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.17.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.16.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.9.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.8.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.7.0](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.6.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)
- [0.5.1](https://docs.cloud.google.com/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.ConnectionHandler)

    public class ConnectionHandler extends Thread

Handles a connection from a client to Spanner. This [ConnectionHandler](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler) uses [WireMessage](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage) to receive and send all messages from and to the client, using the intermediate
representation [IntermediateStatement](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement) that servers as a middle layer between Postgres and
Spanner.

Each [ConnectionHandler](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler) is also a [Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html). Although a TCP connection does not
necessarily need to have its own thread, this makes the implementation more straightforward.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html) \> ConnectionHandler

## Inherited Members

[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) [Thread.activeCount()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#activeCount--) [Thread.checkAccess()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#checkAccess--) [Thread.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#clone--) [Thread.countStackFrames()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#countStackFrames--) [Thread.currentThread()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#currentThread--) [Thread.destroy()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#destroy--) [Thread.dumpStack()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#dumpStack--) [Thread.enumerate(Thread\[\])](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#enumerate-java.lang.Thread[]-) [Thread.getAllStackTraces()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getAllStackTraces--) [Thread.getContextClassLoader()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getContextClassLoader--) [Thread.getDefaultUncaughtExceptionHandler()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getDefaultUncaughtExceptionHandler--) [Thread.getId()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getId--) [Thread.getName()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getName--) [Thread.getPriority()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getPriority--) [Thread.getStackTrace()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getStackTrace--) [Thread.getState()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getState--) [Thread.getThreadGroup()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getThreadGroup--) [Thread.getUncaughtExceptionHandler()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getUncaughtExceptionHandler--) [Thread.holdsLock(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#holdsLock-java.lang.Object-) [Thread.interrupt()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#interrupt--) [Thread.interrupted()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#interrupted--) [Thread.isAlive()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#isAlive--) [Thread.isDaemon()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#isDaemon--) [Thread.isInterrupted()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#isInterrupted--) [Thread.join()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#join--) [Thread.join(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#join-long-) [Thread.join(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#join-long-int-) [Thread.resume()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#resume--) [Thread.run()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#run--) [Thread.setContextClassLoader(ClassLoader)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setContextClassLoader-java.lang.ClassLoader-) [Thread.setDaemon(boolean)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-) [Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler-java.lang.Thread.UncaughtExceptionHandler-) [Thread.setName(String)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setName-java.lang.String-) [Thread.setPriority(int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setPriority-int-) [Thread.setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler-java.lang.Thread.UncaughtExceptionHandler-) [Thread.sleep(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#sleep-long-) [Thread.sleep(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#sleep-long-int-) [Thread.start()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#start--) [Thread.stop()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop--) [Thread.stop(Throwable)](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop-java.lang.Throwable-) [Thread.suspend()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#suspend--) [Thread.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#toString--) [Thread.yield()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#yield--)

## Methods

### cancelActiveStatement(int connectionId, int secret)

    public boolean cancelActiveStatement(int connectionId, int secret)

To be used by a cancellation command to cancel a currently running statement, as contained in a
specific connection identified by connectionId. Since cancellation is a flimsy contract at
best, it is not imperative that the cancellation run, but it should be attempted nonetheless.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connectionId` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The connection whose statement must be cancelled. |
| `secret` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The secret value linked to the connection that is being cancelled. If it does not match, we cannot cancel. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | true if the statement was cancelled. |

### cleanUp(IntermediateStatement statement)

    public void cleanUp(IntermediateStatement statement)

Closes portals and statements if the result of an execute was the end of a transaction.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `statement` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html` |   |

### clearActiveCopyStatement()

    public void clearActiveCopyStatement()

### clearInvalidMessageCount()

    public void clearInvalidMessageCount()

Clears the number of invalid messages that was received. This is called whenever a valid
message is encountered.

### closeAllPortals()

    public void closeAllPortals()

Closes all named and unnamed portals on this connection.

### closeAllStatements()

    public void closeAllStatements()

### closePortal(String portalName)

    public void closePortal(String portalName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `portalName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html` |   |

### closeStatement(String statementName)

    public void closeStatement(String statementName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `statementName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

### connectToSpanner(String database, Credentials credentials)

    public void connectToSpanner(String database, Credentials credentials)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `credentials` | `com.google.auth.Credentials` |

### getActiveCopyStatement()

    public CopyStatement getActiveCopyStatement()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.CopyStatement` |   |

### getAutoDescribedStatement(String sql)

    public Future<DescribeResult> getAutoDescribedStatement(String sql)

Returns the parameter types of a cached auto-described statement, or null if none is available
in the cache.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `sql` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html<https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.metadata.DescribeResult>` |   |

### getConnectionId()

    public int getConnectionId()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getConnectionMetadata()

    public ConnectionMetadata getConnectionMetadata()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.metadata.ConnectionMetadata` |   |

### getDatabaseId()

    public DatabaseId getDatabaseId()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.spanner.DatabaseId` |   |

### getExtendedQueryProtocolHandler()

    public ExtendedQueryProtocolHandler getExtendedQueryProtocolHandler()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler` |   |

### getInvalidMessageCount()

    public int getInvalidMessageCount()

Returns the number of invalid messages that this connection has received in a row. This can for
example happen if a client has initiated a COPY operation and the copy operation fails on the
server. The server will then respond with an error response, but if the client fails to read
that message and continues to send copy data messages, the server could get flooded. This value
is used to detect such a situation and breaks the connection if too many invalid messages in a
row are received.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getPortal(String portalName)

    public IntermediatePortalStatement getPortal(String portalName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `portalName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediatePortalStatement` |   |

### getSecret()

    public int getSecret()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getServer()

    public ProxyServer getServer()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ProxyServer` |   |

### getSpannerConnection()

    public Connection getSpannerConnection()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.connection.Connection` |   |

### getStatement(String statementName)

    public IntermediatePreparedStatement getStatement(String statementName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `statementName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediatePreparedStatement` |   |

### getStatus()

    public synchronized ConnectionHandler.ConnectionStatus getStatus()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler.ConnectionStatus` |   |

### getTraceConnectionId()

    public UUID getTraceConnectionId()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html` |   |

### getWellKnownClient()

    public ClientAutoDetector.WellKnownClient getWellKnownClient()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector.WellKnownClient` |   |

### handleMessages()

    public void handleMessages()

Reads and handles wire-protocol messages. This method is normally only called from this [ConnectionHandler](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler), but certain sub-protocols such as the COPY protocol also need to process
messages in line.

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html` |   |

### handleTerminate()

    public void handleTerminate()

Called when a Terminate message is received. This closes this [ConnectionHandler](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler).

### hasPortal(String portalName)

    public boolean hasPortal(String portalName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `portalName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### hasStatement(String statementName)

    public boolean hasStatement(String statementName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `statementName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### increaseInvalidMessageCount()

    public void increaseInvalidMessageCount()

Increases the number of invalid messages that was received in a row by 1.

### maybeDetermineWellKnownClient(Statement statement)

    public void maybeDetermineWellKnownClient(Statement statement)

This is called by the simple [com.google.cloud.spanner.pgadapter.wireprotocol.QueryMessage](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.QueryMessage) to give the connection the
opportunity to determine the client that is connected based on the SQL string that is being
executed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `statement` | `com.google.cloud.spanner.Statement` |

### maybeDetermineWellKnownClient(ParseMessage parseMessage)

    public void maybeDetermineWellKnownClient(ParseMessage parseMessage)

This is called by the extended query protocol [com.google.cloud.spanner.pgadapter.wireprotocol.ParseMessage](https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ParseMessage) to give the connection the
opportunity to determine the client that is connected based on the data in the (first) parse
messages.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parseMessage` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ParseMessage` |

### registerAutoDescribedStatement(String sql, Future\<DescribeResult\> describeResult)

    public void registerAutoDescribedStatement(String sql, Future<DescribeResult> describeResult)

Stores the parameter types of an auto-described statement in the cache.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `sql` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `describeResult` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html<https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.metadata.DescribeResult>` |

### registerPortal(String portalName, IntermediatePortalStatement portal)

    public void registerPortal(String portalName, IntermediatePortalStatement portal)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `portalName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `portal` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediatePortalStatement` |

### registerStatement(String statementName, IntermediatePreparedStatement statement)

    public void registerStatement(String statementName, IntermediatePreparedStatement statement)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `statementName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `statement` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediatePreparedStatement` |

### run()

    public void run()

Simple runner starts a loop which keeps taking inbound messages, processing them, sending them
to Spanner, getting a result, processing that result, and replying to the client (in that
order). Also instantiates input and output streams from the client and handles auth.
**Overrides** [Thread.run()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#run--)

### setActiveCopyStatement(CopyStatement copyStatement)

    public void setActiveCopyStatement(CopyStatement copyStatement)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `copyStatement` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.CopyStatement` |

### setMessageState(WireMessage message)

    public void setMessageState(WireMessage message)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `message` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage` |

### setStatus(ConnectionHandler.ConnectionStatus status)

    public synchronized void setStatus(ConnectionHandler.ConnectionStatus status)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `status` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.ConnectionHandler.ConnectionStatus` |

### setWellKnownClient(ClientAutoDetector.WellKnownClient wellKnownClient)

    public void setWellKnownClient(ClientAutoDetector.WellKnownClient wellKnownClient)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `wellKnownClient` | `https://docs.cloud.google.com/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector.WellKnownClient` |