class SimpleCatalogManager implements CatalogManager {

    @Override
    public void addVersionedDistribution(Resource catalogId, Resource versionedRecordId, Resource versionId,
                                         Distribution distribution) {
        try (RepositoryConnection conn = configProvider.getRepository().getConnection()) {
            Version version = utils.getVersion(catalogId, versionedRecordId, versionId, versionFactory, conn);
            if (conn.containsContext(distribution.getResource())) {
                throw utils.throwAlreadyExists(distribution.getResource(), distributionFactory);
            }
            Set<Distribution> distributions = version.getVersionedDistribution_resource().stream()
                    .map(distributionFactory::createNew)
                    .collect(Collectors.toSet());
            distributions.add(distribution);
            version.setVersionedDistribution(distributions);
            conn.begin();
            utils.updateObject(version, conn);
            utils.addObject(distribution, conn);
            conn.commit();
        }
    }

    public  SimpleCatalogManager();

}