Package com.ocient.util

# Class MockOcientCluster

java.lang.Object
com.ocient.util.MockOcientCluster

All Implemented Interfaces:
  `SimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>`

public class MockOcientCluster extends Object implements SimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`MockOcientCluster.IdempotentResultSetProvider`
Provides a mechanism for simulating result set production with minimal overhead.
`class`
`MockOcientCluster.Transport`
Represents a TCP connection to the backing server instance.

## Constructor Summary

Constructors
Constructor
Description
`MockOcientCluster()`

## Method Summary

Modifier and Type
Method
Description
`CompletionStage<TransportResult<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>>`
`connect(String host, int port, XGConnection.Tls tls, int connectTimeout)`
Connects to a remote host using the specified transport and configuration.
`static io.netty.buffer.ByteBuf`
`demBuffer()`
`static ClientWireProtocol.ConfirmationResponse`
`error(SQLException ex)`
`static MockOcientCluster`
`getInstance()`
`static ClientWireProtocol.ConfirmationResponse`
`ok()`
`static io.netty.buffer.ByteBuf`
`pingBuffer()`
`void`
`registerQuery(String sql, MockOcientCluster.IdempotentResultSetProvider provider)`
Registers a SQL query with an associated `MockOcientCluster.IdempotentResultSetProvider` to ensure performant, replayable operations.
`void`
`setVersion(String version)`
Assign the version to this server.

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

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

## Constructor Details

### MockOcientCluster

public MockOcientCluster()

## Method Details

### getInstance

public static MockOcientCluster getInstance()

### connect

public CompletionStage<TransportResult<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> connect(String host, int port, XGConnection.Tls tls, int connectTimeout)
Description copied from interface: `SimplexTransportFactory`
Connects to a remote host using the specified transport and configuration.

Specified by:
  `connect` in interface `SimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>`
Parameters:
  `host` - the hostname or IP address of the remote host
  `port` - the port number of the remote host
  `tls` - the TLS configuration to use for the connection, or null if TLS is not required
  `connectTimeout` - the maximum time to wait for the connection to be established, in milliseconds
Returns:
  a new `SimplexTransport` object representing the connection to the remote host

### registerQuery

public void registerQuery(String sql, MockOcientCluster.IdempotentResultSetProvider provider)
Registers a SQL query with an associated `MockOcientCluster.IdempotentResultSetProvider` to ensure performant, replayable operations.

### setVersion

public void setVersion(String version)
Assign the version to this server.

### ok

public static ClientWireProtocol.ConfirmationResponse ok()

### error

public static ClientWireProtocol.ConfirmationResponse error(SQLException ex)

### pingBuffer

public static io.netty.buffer.ByteBuf pingBuffer()

### demBuffer

public static io.netty.buffer.ByteBuf demBuffer()