Package com.ocient.transport

# Class JavaNetOcientWireV1Transport

java.lang.Object
com.ocient.transport.JavaNetOcientWireV1Transport

All Implemented Interfaces:
  `com.ibm.asyncutil.util.AsyncCloseable`, `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`JavaNetOcientWireV1Transport.Factory`

## Nested classes/interfaces inherited from interface com.ocient.transport.SimplexTransport

`SimplexTransport.Ctx, SimplexTransport.StreamCtx<T>`

## Constructor Summary

Constructors
Constructor
Description
`JavaNetOcientWireV1Transport(Socket sock, BufferedInputStream in, BufferedOutputStream out)`

## Method Summary

Modifier and Type
Method
Description
`io.netty.buffer.ByteBuf`
`allocate(int capacity)`
Allocates an I/O capable `ByteBuf` with the specified capacity.
`CompletionStage<Void>`
`close()`
`BufferedInputStream`
`getInputStream()`
`Optional<SocketAddress>`
`getLocalAddress()`
`BufferedOutputStream`
`getOutputStream()`
`Optional<SocketAddress>`
`getRemoteAddress()`
`Socket`
`getSock()`
`boolean`
`isValid()`
`CompletionStage<TransportResult<io.netty.buffer.ByteBuf>>`
`sendAndReceive(io.netty.buffer.ByteBuf request, SimplexTransport.Ctx ctx)`
Sends a `SimplexTransport` to the server and returns a `CompletionStage` that completes with the `SimplexTransport` from the server.
`CompletionStage<TransportResult<Void>>`
`sendNoReceive(io.netty.buffer.ByteBuf request, SimplexTransport.Ctx ctx)`
Sends `SimplexTransport` to the server.
`String`
`toString()`

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

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

### Methods inherited from interface com.ocient.transport.SimplexTransport

`stream`

## Constructor Details

### JavaNetOcientWireV1Transport

public JavaNetOcientWireV1Transport(Socket sock, BufferedInputStream in, BufferedOutputStream out)

## Method Details

### getSock

public Socket getSock()

### getLocalAddress

public Optional<SocketAddress> getLocalAddress()

Specified by:
  `getLocalAddress` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`

### getRemoteAddress

public Optional<SocketAddress> getRemoteAddress()

Specified by:
  `getRemoteAddress` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`

### getInputStream

public BufferedInputStream getInputStream()

### getOutputStream

public BufferedOutputStream getOutputStream()

### sendAndReceive

public CompletionStage<TransportResult<io.netty.buffer.ByteBuf>> sendAndReceive(io.netty.buffer.ByteBuf request, SimplexTransport.Ctx ctx)
Description copied from interface: `SimplexTransport`
Sends a `SimplexTransport` to the server and returns a `CompletionStage` that completes with the `SimplexTransport` from the server.

Specified by:
  `sendAndReceive` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`
Parameters:
  `request` - the `SimplexTransport`
Returns:
  a `CompletionStage` that completes with a `SimplexTransport` from the server.

### sendNoReceive

public CompletionStage<TransportResult<Void>> sendNoReceive(io.netty.buffer.ByteBuf request, SimplexTransport.Ctx ctx)
Description copied from interface: `SimplexTransport`
Sends `SimplexTransport` to the server. notably, a response is NOT expected from the server.

Specified by:
  `sendNoReceive` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`
Parameters:
  `request` - the `SimplexTransport`

### allocate

public io.netty.buffer.ByteBuf allocate(int capacity)
Description copied from interface: `SimplexTransport`
Allocates an I/O capable `ByteBuf` with the specified capacity.

Specified by:
  `allocate` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`
Parameters:
  `capacity` - the desired capacity of the new buffer.
Returns:
  a new I/O capable `ByteBuf` with the specified capacity.

### close

public CompletionStage<Void> close()

Specified by:
  `close` in interface `com.ibm.asyncutil.util.AsyncCloseable`
Specified by:
  `close` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`

### isValid

public boolean isValid()

Specified by:
  `isValid` in interface `SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`