first attempt to load and store a TracTrac connectivity params object with service finder approach

Change-Id: I8a42e772a31ab074b561154ec42fa1ac28e79bb9
This commit is contained in:
Axel Uhl committed 2016-12-28 11:49:22 +01:00
1 parent 48ffb76e11
commit c949c21450
13 files changed
+238 -39

No files matched your search

@@ -1,5 +1,7 @@
package com.sap.sailing.domain.persistence;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collection;
import java.util.Map;
@@ -153,5 +155,5 @@ public interface DomainObjectFactory {
* @see MongoObjectFactory#addConnectivityParametersForRaceToRestore(RaceTrackingConnectivityParameters)
* @see MongoObjectFactory#removeConnectivityParametersForRaceToRestore(RaceTrackingConnectivityParameters)
*/
Iterable<RaceTrackingConnectivityParameters> loadConnectivityParametersForRacesToRestore();
Iterable<RaceTrackingConnectivityParameters> loadConnectivityParametersForRacesToRestore() throws MalformedURLException, URISyntaxException;
}
@@ -2,6 +2,7 @@ package com.sap.sailing.domain.persistence.impl;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
@@ -2283,7 +2284,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
}
@Override
public Iterable<RaceTrackingConnectivityParameters> loadConnectivityParametersForRacesToRestore() {
public Iterable<RaceTrackingConnectivityParameters> loadConnectivityParametersForRacesToRestore() throws MalformedURLException, URISyntaxException {
Set<RaceTrackingConnectivityParameters> result = new HashSet<>();
final DBCollection collection = database.getCollection(CollectionNames.CONNECTIVITY_PARAMS_FOR_RACES_TO_BE_RESTORED.name());
for (final DBObject o : collection.find()) {
@@ -2296,7 +2297,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
map.put(key, o.get(key));
}
}
connectivityParamsPersistenceService.mapTo(map);
result.add(connectivityParamsPersistenceService.mapTo(map));
}
}
return result;