Package org.apache.calcite.avatica.remote

## Class ProtobufService

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

All Implemented Interfaces:
  `Service`

Direct Known Subclasses:
  `LocalProtobufService`, `MockProtobufService`, `RemoteProtobufService`

    public abstract class ProtobufService
    extends AbstractService

Service implementation that encodes requests and responses as protocol buffers.

### 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`

### Constructor Summary

Constructors
`ProtobufService()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`abstract Service.Response` `_apply​(Service.Request request)` Derived class should implement this method to transport requests and responses to and from the peer service.
`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)`
`static <T extends com.google.protobuf.Message> T` `castProtobufMessage​(com.google.protobuf.Message msg, java.lang.Class<T> expectedType)` Checks if the provided `Message` is an instance of the Class given by `expectedType`.
`(package private) AbstractService.SerializationType` `getSerializationType()`

### 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`

### Constructor Detail

#### ProtobufService

    public ProtobufService()

### Method Detail

#### _apply

    public abstract Service.Response _apply​(Service.Request 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.

#### 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.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.ExecuteResponse apply​(Service.ExecuteRequest 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)

#### castProtobufMessage

    public static <T extends com.google.protobuf.Message> T castProtobufMessage​(com.google.protobuf.Message msg,
                                                                                java.lang.Class<T> expectedType)

Checks if the provided `Message` is an instance of the Class given by `expectedType`. Throws an IllegalArgumentException if the message is not of the expected type, otherwise, it returns the message cast as the expected type.

Parameters:
  `msg` - A Protocol Buffer message.
  `expectedType` - The expected type of the Protocol Buffer message.
Returns:
  The msg cast to the concrete Message type.
Throws:
  `java.lang.IllegalArgumentException` - If the type of the message is not the expectedType.