class StandardFlowRetrievalService implements FlowRetrievalService {

    @Override
    public List<VersionedFlowSnapshotMetadata> getVersions(final FlowUri flowUri)
            throws IOException, FlowRetrievalException {
        if (flowUri == null) {
            throw new IllegalArgumentException("FlowUri cannot be null");
        }

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Getting flow versions for {}", new Object[] {flowUri});
        }

        final NiFiRegistryClient client = clientFactory.getClient();
        try {
            return client.getFlowSnapshotClient().getSnapshotMetadata(flowUri.getBucketId(), flowUri.getFlowId());
        } catch (IOException ioe) {
            throw ioe;
        } catch (NiFiRegistryException nre) {
            throw new FlowRetrievalException("Error retrieving flow versions for " + flowUri + ": " + nre.getMessage(), nre);
        }
    }

    @Autowired public  StandardFlowRetrievalService(final C2NiFiRegistryClient clientFactory);

}