BUG-2138: Create DistributedShardFrontend
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / sharding / messages / CreatePrefixShard.java
1 /*
2  * Copyright (c) 2016 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.sharding.messages;
10
11 import com.google.common.annotations.Beta;
12 import com.google.common.base.Preconditions;
13 import java.io.Serializable;
14 import org.opendaylight.controller.cluster.datastore.config.PrefixShardConfiguration;
15 import org.opendaylight.controller.cluster.sharding.ShardedDataTreeActor;
16
17 /**
18  * Sent to the local {@link ShardedDataTreeActor} when there was a shard created
19  * on the local node. The local actor should notify the remote actors with {@link PrefixShardCreated} which should
20  * create the required frontend/backend shards.
21  */
22 @Beta
23 public class CreatePrefixShard implements Serializable {
24     private static final long serialVersionUID = 1L;
25
26     private final PrefixShardConfiguration configuration;
27
28     public CreatePrefixShard(final PrefixShardConfiguration configuration) {
29         this.configuration = Preconditions.checkNotNull(configuration);
30     }
31
32     public PrefixShardConfiguration getConfiguration() {
33         return configuration;
34     }
35
36
37     @Override
38     public String toString() {
39         return "CreatePrefixShard{"
40                 + "configuration="
41                 + configuration
42                 + '}';
43     }
44 }