# Class GcpClientCall&lt;ReqT,RespT&gt; (1.11.0)

    public class GcpClientCall<ReqT,RespT> extends ClientCall<ReqT,RespT>

A wrapper of ClientCall that can fetch the affinitykey from the request/response message.

It stores the information such as method, calloptions, the ChannelRef which created it, etc to
facilitate creating new calls. It gets the affinitykey from the request/response message, and
defines the callback functions to manage the number of active streams and bind/unbind the
affinity key with the channel.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> io.grpc.ClientCall \> GcpClientCall\<ReqT,RespT\>

## Inherited Members

io.grpc.ClientCall.cancel(java.lang.String,java.lang.Throwable) io.grpc.ClientCall.getAttributes() io.grpc.ClientCall.halfClose() io.grpc.ClientCall.isReady() io.grpc.ClientCall.request(int) io.grpc.ClientCall.sendMessage(ReqT) io.grpc.ClientCall.setMessageCompression(boolean) io.grpc.ClientCall.start(io.grpc.ClientCall.Listener\<RespT\>,io.grpc.Metadata) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [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.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [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-)

| ## Type Parameters ||
|---|---|
| **Name** | **Description** |
| `ReqT` |   |
| `RespT` |   |

## Constructors

### GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor\<ReqT,RespT\> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)

    protected GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor<ReqT,RespT> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `delegateChannel` | `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.GcpManagedChannel` |
| `methodDescriptor` | `io.grpc.MethodDescriptor<ReqT,RespT>` |
| `callOptions` | `io.grpc.CallOptions` |
| `affinity` | `https://docs.cloud.google.com/java/docs/reference/grpc-gcp/latest/com.google.cloud.grpc.proto.AffinityConfig` |

## Methods

### cancel(String message, Throwable cause)

    public void cancel(String message, Throwable cause)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `message` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `cause` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html` |

**Overrides** io.grpc.ClientCall.cancel(java.lang.String,java.lang.Throwable)

### getAttributes()

    public Attributes getAttributes()

May only be called after Listener#onHeaders or Listener#onClose.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `io.grpc.Attributes` |   |

**Overrides** io.grpc.ClientCall.getAttributes()

### halfClose()

    public void halfClose()

**Overrides** io.grpc.ClientCall.halfClose()

### isReady()

    public boolean isReady()

Calls that send exactly one message should not check this method.

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

**Overrides** io.grpc.ClientCall.isReady()

### request(int numMessages)

    public void request(int numMessages)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `numMessages` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

**Overrides** io.grpc.ClientCall.request(int)

### sendMessage(ReqT message)

    public void sendMessage(ReqT message)

Delay executing operations until call.sendMessage() is called, switch the channel, start the
call, do previous operations, and finally do sendMessage().

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `message` | `ReqT` |

**Overrides** io.grpc.ClientCall.sendMessage(ReqT)

### setMessageCompression(boolean enabled)

    public void setMessageCompression(boolean enabled)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `enabled` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

**Overrides** io.grpc.ClientCall.setMessageCompression(boolean)

### start(ClientCall.Listener\<RespT\> responseListener, Metadata headers)

    public void start(ClientCall.Listener<RespT> responseListener, Metadata headers)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `responseListener` | `io.grpc.ClientCall.Listener<RespT>` |
| `headers` | `io.grpc.Metadata` |

**Overrides** io.grpc.ClientCall.start(io.grpc.ClientCall.Listener\<RespT\>,io.grpc.Metadata)

### toString()

    public String toString()

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

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)