Package org.apache.calcite.avatica.remote

# Class JsonHandler

java.lang.Object
org.apache.calcite.avatica.remote.AbstractHandler<String>
org.apache.calcite.avatica.remote.JsonHandler

All Implemented Interfaces:
  `Handler<String>`

public class JsonHandler extends AbstractHandler<String>
Implementation of `Handler` that decodes JSON requests, sends them to a `Service`, and encodes the responses into JSON.

See Also:
  - `JsonService`

## Nested Class Summary

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

`Handler.HandlerResponse<T>`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final com.fasterxml.jackson.databind.ObjectMapper`
`MAPPER`

### Fields inherited from class org.apache.calcite.avatica.remote.AbstractHandler

`service`

### Fields inherited from interface org.apache.calcite.avatica.remote.Handler

`HANDLER_SERIALIZATION_METRICS_NAME, HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, HTTP_UNAUTHENTICATED, HTTP_UNAUTHORIZED`

## Constructor Summary

Constructors
Constructor
Description
`JsonHandler(Service service, org.apache.calcite.avatica.metrics.MetricsSystem metrics)`

## Method Summary

Modifier and Type
Method
Description
`Handler.HandlerResponse<String>`
`apply(String jsonRequest)`
Compute a response for the given request, handling errors generated by that computation.

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

`convertToErrorResponse, setRpcMetadata, unauthenticatedErrorResponse, unauthorizedErrorResponse`

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

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

## Field Details

### MAPPER

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

## Constructor Details

### JsonHandler

public JsonHandler(Service service, org.apache.calcite.avatica.metrics.MetricsSystem metrics)

## Method Details

### apply

public Handler.HandlerResponse<String> apply(String jsonRequest)
Description copied from class: `AbstractHandler`
Compute a response for the given request, handling errors generated by that computation.

Specified by:
  `apply` in interface `Handler<String>`
Overrides:
  `apply` in class `AbstractHandler<String>`
Parameters:
  `jsonRequest` - The caller's request.
Returns:
  A `Service.Response` with additional context about that response.