org.apache.calcite.avatica.remote

## Class JsonService

- java.lang.Object
- - org.apache.calcite.avatica.remote.AbstractService
  - - org.apache.calcite.avatica.remote.JsonService

All Implemented Interfaces:
  Service

Direct Known Subclasses:
  LocalJsonService, MockJsonService, RemoteService

    public abstract class JsonService
    extends AbstractService

Implementation of `Service` that encodes requests and responses as JSON.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.calcite.avatica.remote.AbstractService

`AbstractService.SerializationType`

### Nested classes/interfaces inherited from interface org.apache.calcite.avatica.remote.Service

`Service.Base, Service.CatalogsRequest, Service.CloseConnectionRequest, Service.CloseConnectionResponse, Service.CloseStatementRequest, Service.CloseStatementResponse, Service.ColumnsRequest, Service.CommitRequest, Service.CommitResponse, Service.ConnectionSyncRequest, Service.ConnectionSyncResponse, Service.CreateStatementRequest, Service.CreateStatementResponse, Service.DatabasePropertyRequest, Service.DatabasePropertyResponse, Service.ErrorResponse, Service.ExecuteBatchRequest, Service.ExecuteBatchResponse, Service.ExecuteRequest, Service.ExecuteResponse, Service.Factory, Service.FetchRequest, Service.FetchResponse, Service.OpenConnectionRequest, Service.OpenConnectionResponse, Service.PrepareAndExecuteBatchRequest, Service.PrepareAndExecuteRequest, Service.PrepareRequest, Service.PrepareResponse, Service.Request, Service.Response, Service.ResultSetResponse, Service.RollbackRequest, Service.RollbackResponse, Service.RpcMetadataResponse, Service.SchemasRequest, Service.SyncResultsRequest, Service.SyncResultsResponse, Service.TablesRequest, Service.TableTypesRequest, Service.TypeInfoRequest`

### Field Summary

Fields
`static com.fasterxml.jackson.databind.ObjectMapper` `MAPPER`

### Constructor Summary

Constructors
Constructor and Description
`JsonService()`

### Method Summary

Methods
`Service.ResultSetResponse` `apply(Service.CatalogsRequest request)`
`Service.CloseConnectionResponse` `apply(Service.CloseConnectionRequest request)`
`Service.CloseStatementResponse` `apply(Service.CloseStatementRequest request)`
`Service.ResultSetResponse` `apply(Service.ColumnsRequest request)`
`Service.CommitResponse` `apply(Service.CommitRequest request)`
`Service.ConnectionSyncResponse` `apply(Service.ConnectionSyncRequest request)`
`Service.CreateStatementResponse` `apply(Service.CreateStatementRequest request)`
`Service.DatabasePropertyResponse` `apply(Service.DatabasePropertyRequest request)`
`Service.ExecuteBatchResponse` `apply(Service.ExecuteBatchRequest request)`
`Service.ExecuteResponse` `apply(Service.ExecuteRequest request)`
`Service.FetchResponse` `apply(Service.FetchRequest request)`
`Service.OpenConnectionResponse` `apply(Service.OpenConnectionRequest request)`
`Service.ExecuteBatchResponse` `apply(Service.PrepareAndExecuteBatchRequest request)`
`Service.ExecuteResponse` `apply(Service.PrepareAndExecuteRequest request)`
`Service.PrepareResponse` `apply(Service.PrepareRequest request)`
`Service.RollbackResponse` `apply(Service.RollbackRequest request)`
`Service.ResultSetResponse` `apply(Service.SchemasRequest request)`
`Service.SyncResultsResponse` `apply(Service.SyncResultsRequest request)`
`Service.ResultSetResponse` `apply(Service.TablesRequest request)`
`Service.ResultSetResponse` `apply(Service.TableTypesRequest request)`
`Service.ResultSetResponse` `apply(Service.TypeInfoRequest request)`
`abstract String` `apply(String request)` Derived class should implement this method to transport requests and responses to and from the peer service.
`protected static <T> T` `decode(String response, Class<T> expectedType)`
`protected static <T> String` `encode(T request)`
`(package private) AbstractService.SerializationType` `getSerializationType()`
`protected RuntimeException` `handle(IOException e)`

### Methods inherited from class org.apache.calcite.avatica.remote.AbstractService

`finagle, finagle, finagle, finagle, finagle, finagle, setRpcMetadata`

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

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

### Field Detail

#### MAPPER

    public static final com.fasterxml.jackson.databind.ObjectMapper MAPPER

### Constructor Detail

#### JsonService

    public JsonService()

### Method Detail

#### apply

    public abstract String apply(String request)

Derived class should implement this method to transport requests and responses to and from the peer service.

#### getSerializationType

    AbstractService.SerializationType getSerializationType()

Specified by:
  `getSerializationType` in class `AbstractService`
Returns:
  The manner in which the data is serialized.

#### decode

    protected static <T> T decode(String response,
               Class<T> expectedType)
                       throws IOException

Throws:
  `IOException`

#### encode

    protected static <T> String encode(T request)
                            throws IOException

Throws:
  `IOException`

#### handle

    protected RuntimeException handle(IOException e)

#### apply

    public Service.ResultSetResponse apply(Service.CatalogsRequest request)

#### apply

    public Service.ResultSetResponse apply(Service.SchemasRequest request)

#### apply

    public Service.ResultSetResponse apply(Service.TablesRequest request)

#### apply

    public Service.ResultSetResponse apply(Service.TableTypesRequest request)

#### apply

    public Service.ResultSetResponse apply(Service.TypeInfoRequest request)

#### apply

    public Service.ResultSetResponse apply(Service.ColumnsRequest request)

#### apply

    public Service.PrepareResponse apply(Service.PrepareRequest request)

#### apply

    public Service.ExecuteResponse apply(Service.PrepareAndExecuteRequest request)

#### apply

    public Service.FetchResponse apply(Service.FetchRequest request)

#### apply

    public Service.ExecuteResponse apply(Service.ExecuteRequest request)

#### apply

    public Service.CreateStatementResponse apply(Service.CreateStatementRequest request)

#### apply

    public Service.CloseStatementResponse apply(Service.CloseStatementRequest request)

#### apply

    public Service.OpenConnectionResponse apply(Service.OpenConnectionRequest request)

#### apply

    public Service.CloseConnectionResponse apply(Service.CloseConnectionRequest request)

#### apply

    public Service.ConnectionSyncResponse apply(Service.ConnectionSyncRequest request)

#### apply

    public Service.DatabasePropertyResponse apply(Service.DatabasePropertyRequest request)

#### apply

    public Service.SyncResultsResponse apply(Service.SyncResultsRequest request)

#### apply

    public Service.CommitResponse apply(Service.CommitRequest request)

#### apply

    public Service.RollbackResponse apply(Service.RollbackRequest request)

#### apply

    public Service.ExecuteBatchResponse apply(Service.PrepareAndExecuteBatchRequest request)

#### apply

    public Service.ExecuteBatchResponse apply(Service.ExecuteBatchRequest request)