Clean up DistributedEntityOwnershipService instantiation
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / selectionstrategy / FirstCandidateSelectionStrategy.java
index a619035f35f9fc6963ab89e65579391bb7fc94c5..d86fcbd24967b59282bb3788c5ad53a6f6dbaa3d 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.controller.cluster.datastore.entityownership.selections
 
 import com.google.common.base.Preconditions;
 import java.util.Collection;
+import java.util.Map;
 
 /**
  * The FirstCandidateSelectionStrategy always selects the first viable candidate from the list of candidates
  */
-public class FirstCandidateSelectionStrategy implements EntityOwnerSelectionStrategy {
+public class FirstCandidateSelectionStrategy extends AbstractEntityOwnerSelectionStrategy {
 
-    public static final FirstCandidateSelectionStrategy INSTANCE = new FirstCandidateSelectionStrategy();
+    public static final FirstCandidateSelectionStrategy INSTANCE = new FirstCandidateSelectionStrategy(0L);
 
-    @Override
-    public long selectionDelayInMillis() {
-        return 0;
+    public FirstCandidateSelectionStrategy(long selectionDelayInMillis) {
+        super(selectionDelayInMillis);
     }
 
     @Override
-    public String newOwner(Collection<String> viableCandidates) {
+    public String newOwner(Collection<String> viableCandidates, Map<String, Long> statistics) {
         Preconditions.checkArgument(viableCandidates.size() > 0, "No viable candidates provided");
         return viableCandidates.iterator().next();
     }