Bug 4564: Add Shard Builder class
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / CreateShard.java
index 625153799c6a96f105858e4d4c24393087ba6731..6b4fd7c204a194d1c2edf7f80ede8557e16a6eb7 100644 (file)
@@ -11,7 +11,7 @@ import com.google.common.base.Preconditions;
 import javax.annotation.Nonnull;
 import javax.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.config.ModuleShardConfiguration;
 
 /**
@@ -21,7 +21,7 @@ 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;
 
     /**
@@ -32,26 +32,29 @@ public class CreateShard {
      * @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) {
+            @Nonnull Shard.AbstractBuilder<?, ?> shardBuilder, @Nullable DatastoreContext datastoreContext) {
         this.moduleShardConfig = Preconditions.checkNotNull(moduleShardConfig);
-        this.shardPropsCreator = Preconditions.checkNotNull(shardPropsCreator);
+        this.shardBuilder = Preconditions.checkNotNull(shardBuilder);
         this.datastoreContext = datastoreContext;
     }
 
-    @Nonnull public ModuleShardConfiguration getModuleShardConfig() {
+    @Nonnull
+    public ModuleShardConfiguration getModuleShardConfig() {
         return moduleShardConfig;
     }
 
-    @Nonnull public ShardPropsCreator getShardPropsCreator() {
-        return shardPropsCreator;
+    @Nonnull
+    public Shard.AbstractBuilder<?, ?> getShardBuilder() {
+        return shardBuilder;
     }
 
-    @Nullable public DatastoreContext getDatastoreContext() {
+    @Nullable
+    public DatastoreContext getDatastoreContext() {
         return datastoreContext;
     }
 
     @Override
     public String toString() {
-        return "CreateShard [moduleShardConfig=" + moduleShardConfig + ", shardPropsCreator=" + shardPropsCreator + "]";
+        return "CreateShard [moduleShardConfig=" + moduleShardConfig + ", shardPropsCreator=" + shardBuilder + "]";
     }
 }