X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FCreateShard.java;h=8c5cbad33088c3beceb929fa5851fe29a882dee8;hb=609f0bd2646991335ab40a9a2265dcc928c0e6f7;hp=625153799c6a96f105858e4d4c24393087ba6731;hpb=30507b196fa240a4176ba12102ac0469280feff9;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java index 625153799c..8c5cbad330 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateShard.java @@ -7,11 +7,13 @@ */ package org.opendaylight.controller.cluster.datastore.messages; -import com.google.common.base.Preconditions; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import static java.util.Objects.requireNonNull; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.controller.cluster.datastore.DatastoreContext; -import org.opendaylight.controller.cluster.datastore.ShardPropsCreator; +import org.opendaylight.controller.cluster.datastore.Shard; +import org.opendaylight.controller.cluster.datastore.Shard.AbstractBuilder; import org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration; /** @@ -21,37 +23,37 @@ import org.opendaylight.controller.cluster.datastore.config.ModuleShardConfigura */ public class CreateShard { private final ModuleShardConfiguration moduleShardConfig; - private final ShardPropsCreator shardPropsCreator; + private final Shard.AbstractBuilder shardBuilder; private final DatastoreContext datastoreContext; /** * Constructor. * * @param moduleShardConfig the configuration of the new shard. - * @param shardPropsCreator used to obtain the Props for creating the shard actor instance. + * @param shardBuilder used to obtain the Props for creating the shard actor instance. * @param datastoreContext the DatastoreContext for the new shard. If null, the default is used. */ - public CreateShard(@Nonnull ModuleShardConfiguration moduleShardConfig, - @Nonnull ShardPropsCreator shardPropsCreator, @Nullable DatastoreContext datastoreContext) { - this.moduleShardConfig = Preconditions.checkNotNull(moduleShardConfig); - this.shardPropsCreator = Preconditions.checkNotNull(shardPropsCreator); + public CreateShard(@NonNull ModuleShardConfiguration moduleShardConfig, @NonNull AbstractBuilder shardBuilder, + @Nullable DatastoreContext datastoreContext) { + this.moduleShardConfig = requireNonNull(moduleShardConfig); + this.shardBuilder = requireNonNull(shardBuilder); this.datastoreContext = datastoreContext; } - @Nonnull public ModuleShardConfiguration getModuleShardConfig() { + public @NonNull ModuleShardConfiguration getModuleShardConfig() { return moduleShardConfig; } - @Nonnull public ShardPropsCreator getShardPropsCreator() { - return shardPropsCreator; + public @NonNull AbstractBuilder getShardBuilder() { + return shardBuilder; } - @Nullable public DatastoreContext getDatastoreContext() { + public @Nullable DatastoreContext getDatastoreContext() { return datastoreContext; } @Override public String toString() { - return "CreateShard [moduleShardConfig=" + moduleShardConfig + ", shardPropsCreator=" + shardPropsCreator + "]"; + return "CreateShard [moduleShardConfig=" + moduleShardConfig + ", shardPropsCreator=" + shardBuilder + "]"; } }