class MetaDataClientRest extends DefaultClient implements MetaDataClient {

    @Override
    public List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(String operationId)
        throws MetaDataClientServerException {
        try (Response response = make(get().withJson().withPath("/accession-registers/units/" + operationId))) {
            check(response);
            RequestResponse<JsonNode> requestResponse = RequestResponse.parseFromResponse(response);
            if (requestResponse.isOk()) {
                RequestResponseOK<JsonNode> requestResponseOK = (RequestResponseOK<JsonNode>) requestResponse;

                List<UnitPerOriginatingAgency> unitPerOriginatingAgencies = new ArrayList<>();
                for (JsonNode jsonNode : requestResponseOK.getResults()) {
                    unitPerOriginatingAgencies
                        .add(JsonHandler.getFromJsonNode(jsonNode, UnitPerOriginatingAgency.class));
                }

                return unitPerOriginatingAgencies;
            }
            VitamError vitamError = (VitamError) requestResponse;
            LOGGER
                .error("find accession register for unit failed, http code is {}, error is {}",
                    vitamError.getCode(),
                    vitamError.getErrors());
            throw new MetaDataClientServerException(vitamError.getDescription());
        } catch (InvalidParseOperationException | VitamClientInternalException | MetaDataExecutionException | MetaDataDocumentSizeException | MetaDataNotFoundException e) {
            throw new MetaDataClientServerException(e);
        }
    }

    public  MetaDataClientRest(VitamClientFactoryInterface factory);

}