2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy;
11 import java.util.Collection;
12 import javax.annotation.Nullable;
15 * An EntityOwnerSelectionStrategy is to be used by the EntityOwnershipShard to select a new owner from a collection
18 public interface EntityOwnerSelectionStrategy {
21 * @return the time in millis owner selection should be delayed
23 long getSelectionDelayInMillis();
27 * @param currentOwner the current owner of the entity if any, null otherwise
28 * @param viableCandidates the available candidates from which to choose the new owner
29 * @return the new owner
31 String newOwner(@Nullable String currentOwner, Collection<String> viableCandidates);