BUG-8327: deprecate sal.core.api.model.SchemaService
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / AddPrefixShardReplica.java
1 /*
2  * Copyright (c) 2017 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.messages;
10
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14
15 /**
16  * A message sent to the ShardManager to dynamically add a new local shard
17  *  that is a replica for an existing prefix shard that is already available
18  *  in the cluster.
19  */
20 public class AddPrefixShardReplica {
21
22     private final YangInstanceIdentifier prefix;
23
24     /**
25      * Constructor.
26      *
27      * @param prefix prefix of the shard that is to be locally replicated.
28      */
29
30     public AddPrefixShardReplica(@Nonnull final YangInstanceIdentifier prefix) {
31         this.prefix = Preconditions.checkNotNull(prefix, "prefix should not be null");
32     }
33
34     public YangInstanceIdentifier getShardPrefix() {
35         return this.prefix;
36     }
37
38     @Override
39     public String toString() {
40         return "AddPrefixShardReplica[prefix=" + prefix + "]";
41     }
42 }