Migrate nullness annotations
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / RemoteFindPrimary.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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 package org.opendaylight.controller.cluster.datastore.messages;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.util.Collection;
13 import java.util.HashSet;
14 import java.util.Set;
15 import org.eclipse.jdt.annotation.NonNull;
16
17 /**
18  * A remote message sent to locate the primary shard.
19  *
20  * @author Thomas Pantelis
21  */
22 public class RemoteFindPrimary extends FindPrimary {
23     private static final long serialVersionUID = 1L;
24
25     private final Set<String> visitedAddresses;
26
27     public RemoteFindPrimary(String shardName, boolean waitUntilReady, @NonNull Collection<String> visitedAddresses) {
28         super(shardName, waitUntilReady);
29         this.visitedAddresses = new HashSet<>(requireNonNull(visitedAddresses));
30     }
31
32     public @NonNull Set<String> getVisitedAddresses() {
33         return visitedAddresses;
34     }
35 }