Bootstrap migration strategies

This commit is contained in:
René Pfeuffer
2019-05-22 14:28:53 +02:00
parent 3d28f800be
commit 1674bc2e7d
11 changed files with 335 additions and 10 deletions

View File

@@ -95,10 +95,17 @@ public class XmlRepositoryDAO implements RepositoryDAO {
@Override
public void add(Repository repository) {
add(repository, repositoryLocationResolver.create(repository.getId()));
}
public void add(Repository repository, Object location) {
if (!(location instanceof Path)) {
throw new IllegalArgumentException("can only handle locations of type " + Path.class.getName() + ", not of type " + location.getClass().getName());
}
Repository clone = repository.clone();
synchronized (this) {
Path repositoryPath = repositoryLocationResolver.create(repository.getId());
Path repositoryPath = (Path) location;
try {
Path metadataPath = resolveDataPath(repositoryPath);
@@ -111,10 +118,8 @@ public class XmlRepositoryDAO implements RepositoryDAO {
byId.put(repository.getId(), clone);
byNamespaceAndName.put(repository.getNamespaceAndName(), clone);
}
}
@Override
public boolean contains(Repository repository) {
return byId.containsKey(repository.getId());