Fix warnings/javadocs in sal-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / messages / SelectOwner.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.datastore.entityownership.messages;
10
11 import com.google.common.base.Preconditions;
12 import java.util.Collection;
13 import org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.EntityOwnerSelectionStrategy;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15
16 /**
17  * Message sent when a new owner needs to be selected.
18  */
19 public class SelectOwner {
20     private final YangInstanceIdentifier entityPath;
21     private final Collection<String> allCandidates;
22     private final EntityOwnerSelectionStrategy ownerSelectionStrategy;
23
24     public SelectOwner(YangInstanceIdentifier entityPath, Collection<String> allCandidates,
25                        EntityOwnerSelectionStrategy ownerSelectionStrategy) {
26
27         this.entityPath = Preconditions.checkNotNull(entityPath, "entityPath should not be null");
28         this.allCandidates = Preconditions.checkNotNull(allCandidates, "allCandidates should not be null");
29         this.ownerSelectionStrategy = Preconditions.checkNotNull(ownerSelectionStrategy,
30                 "ownerSelectionStrategy should not be null");
31     }
32
33     public YangInstanceIdentifier getEntityPath() {
34         return entityPath;
35     }
36
37     public Collection<String> getAllCandidates() {
38         return allCandidates;
39     }
40
41     public EntityOwnerSelectionStrategy getOwnerSelectionStrategy() {
42         return ownerSelectionStrategy;
43     }
44
45     @Override
46     public String toString() {
47         return "SelectOwner [entityPath=" + entityPath + ", allCandidates=" + allCandidates
48                 + ", ownerSelectionStrategy=" + ownerSelectionStrategy + "]";
49     }
50 }