class PrivNewFilter implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext request) {
    final String privacyGroupId = request.getRequiredParameter(0, String.class);
    final FilterParameter filter = request.getRequiredParameter(1, FilterParameter.class);
    final String enclavePublicKey = enclavePublicKeyProvider.getEnclaveKey(request.getUser());

    // no need to pass blockNumber. To create a filter, you need to be a current member of the group
    checkIfPrivacyGroupMatchesAuthenticatedEnclaveKey(enclavePublicKey, privacyGroupId);

    if (!filter.isValid()) {
      return new JsonRpcErrorResponse(request.getRequest().getId(), JsonRpcError.INVALID_PARAMS);
    }

    final String logFilterId =
        filterManager.installPrivateLogFilter(
            privacyGroupId,
            enclavePublicKey,
            filter.getFromBlock(),
            filter.getToBlock(),
            filter.getLogsQuery());

    return new JsonRpcSuccessResponse(request.getRequest().getId(), logFilterId);
  }

  public  PrivNewFilter(
      final FilterManager filterManager,
      final PrivacyController privacyController,
      final EnclavePublicKeyProvider enclavePublicKeyProvider);

}