Implement finding a primary based on the shard name and do basic wiring of Distribute...
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DistributedDataStore.java
index 1bc554f3ed653c3a50012044178e4a247489785a..c87f1abb21c74cf585d2fcfe6a4057b0c7143e99 100644 (file)
@@ -1,5 +1,15 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.controller.cluster.datastore;
 
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
@@ -15,29 +25,34 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  *
  */
 public class DistributedDataStore implements DOMStore {
+  private final ActorRef shardManager;
+
+  public DistributedDataStore(ActorSystem actorSystem, String type) {
+    shardManager = actorSystem.actorOf(ShardManager.props(type));
+  }
+
+  @Override
+  public <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(InstanceIdentifier path, L listener, AsyncDataBroker.DataChangeScope scope) {
+    return new ListenerRegistrationProxy();
+  }
+
+  @Override
+  public DOMStoreTransactionChain createTransactionChain() {
+    return new TransactionChainProxy();
+  }
+
+  @Override
+  public DOMStoreReadTransaction newReadOnlyTransaction() {
+    return new TransactionProxy();
+  }
+
+  @Override
+  public DOMStoreWriteTransaction newWriteOnlyTransaction() {
+    return new TransactionProxy();
+  }
 
-    @Override
-    public <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(InstanceIdentifier path, L listener, AsyncDataBroker.DataChangeScope scope) {
-        return new ListenerRegistrationProxy();
-    }
-
-    @Override
-    public DOMStoreTransactionChain createTransactionChain() {
-        return new TransactionChainProxy();
-    }
-
-    @Override
-    public DOMStoreReadTransaction newReadOnlyTransaction() {
-        return new TransactionProxy();
-    }
-
-    @Override
-    public DOMStoreWriteTransaction newWriteOnlyTransaction() {
-        return new TransactionProxy();
-    }
-
-    @Override
-    public DOMStoreReadWriteTransaction newReadWriteTransaction() {
-        return new TransactionProxy();
-    }
+  @Override
+  public DOMStoreReadWriteTransaction newReadWriteTransaction() {
+    return new TransactionProxy();
+  }
 }