class MetaDataClientRest extends DefaultClient implements MetaDataClient {

    @Override
    public JsonNode updateUnitById(JsonNode updateQuery, String unitId)
        throws MetaDataExecutionException,
        MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException,
        MetaDataNotFoundException {
        if (Strings.isNullOrEmpty(unitId)) {
            throw new InvalidParseOperationException("unitId MUST NOT be empty.");
        }
        Response response = null;
        try {
            response = make(put().withJson().withPath("/units/" + unitId)
                .withBody(updateQuery, ErrorMessage.UPDATE_UNITS_QUERY_NULL.getMessage()));
            check(response);
            return response.readEntity(JsonNode.class);
        } catch (InvalidParseOperationException e) {
            JsonNode resp = response.readEntity(JsonNode.class);
            if (resp != null && resp.get("description") != null) {
                throw new InvalidParseOperationException(JsonHandler.unprettyPrint(resp.get("description")));
            }
            throw new InvalidParseOperationException(ErrorMessage.INVALID_PARSE_OPERATION.getMessage());
        } catch (VitamClientInternalException e) {
            throw new MetaDataClientServerException(e);
        } finally {
            if (response != null) {
                response.close();
            }
        }
    }

    public  MetaDataClientRest(VitamClientFactoryInterface factory);

}