summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/impl/src/main/java/io')
-rw-r--r--v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java21
-rw-r--r--v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java30
2 files changed, 9 insertions, 42 deletions
diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java
index 36eeb8598..8ed83d53a 100644
--- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java
+++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java
@@ -20,10 +20,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
-import io.fd.honeycomb.v3po.data.ModifiableDataTree;
-import io.fd.honeycomb.v3po.data.ReadableDataTree;
-import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
-import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -71,31 +67,22 @@ public class V3poProvider implements BindingAwareProvider, AutoCloseable, Broker
private static final Logger LOG = LoggerFactory.getLogger(V3poProvider.class);
private final Broker domBroker;
private final BindingNormalizedNodeSerializer serializer;
+ private final DOMDataBroker domDataBroker;
private RpcRegistration<V3poService> v3poService;
private VppIetfInterfaceListener vppInterfaceListener;
private VppBridgeDomainListener vppBridgeDomainListener;
private vppApi api;
- private ReaderRegistry readerRegistry;
- private WriterRegistry writerRegistry;
private DataBroker db;
VppPollOperDataImpl vppPollOperData;
private VppDataBrokerInitializationProvider vppDataBrokerInitializationProvider;
- private final ModifiableDataTree configDataTree;
- private final ReadableDataTree operationalDataTree;
public V3poProvider(@Nonnull final Broker domBroker, final vppApi vppJapi,
- @Nonnull final ReaderRegistry readerRegistry,
- @Nonnull final WriterRegistry writerRegistry,
@Nonnull final BindingNormalizedNodeSerializer serializer,
- @Nonnull final ModifiableDataTree configDataTree,
- @Nonnull final ReadableDataTree operationalDataTree) {
+ @Nonnull final DOMDataBroker domDataBroker) {
api = vppJapi;
- this.readerRegistry = Preconditions.checkNotNull(readerRegistry, "readerRegistry should not be null");
- this.writerRegistry = Preconditions.checkNotNull(writerRegistry, "writerRegistry should not be null");
this.domBroker = Preconditions.checkNotNull(domBroker, "domBroker should not be null");
this.serializer = Preconditions.checkNotNull(serializer, "serializer should not be null");
- this.configDataTree = Preconditions.checkNotNull(configDataTree, "configDataTree should not be null");
- this.operationalDataTree = Preconditions.checkNotNull(operationalDataTree, "operationalDataTree should not be null");
+ this.domDataBroker = Preconditions.checkNotNull(domDataBroker, "domDataBroker should not be null");
}
private void initializeVppConfig() {
@@ -206,7 +193,7 @@ public class V3poProvider implements BindingAwareProvider, AutoCloseable, Broker
startOperationalUpdateTimer();
// TODO make configurable:
- vppDataBrokerInitializationProvider = new VppDataBrokerInitializationProvider(db, readerRegistry, writerRegistry, serializer, configDataTree, operationalDataTree);
+ vppDataBrokerInitializationProvider = new VppDataBrokerInitializationProvider(db, serializer, domDataBroker);
// TODO pull the registration into Module
domBroker.registerProvider(vppDataBrokerInitializationProvider);
}
diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
index bbb004b73..c1d22f9da 100644
--- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
+++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
@@ -20,11 +20,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import io.fd.honeycomb.v3po.data.ModifiableDataTree;
-import io.fd.honeycomb.v3po.data.ReadableDataTree;
-import io.fd.honeycomb.v3po.data.impl.DataBroker;
-import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
-import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nonnull;
@@ -67,28 +62,18 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
private final TopologyId VPP_TOPOLOGY_ID = TopologyId.getDefaultInstance("vpp-topology");
private final NodeId VPP_TOPOLOGY_NODE_ID = NodeId.getDefaultInstance("vpp");
private final org.opendaylight.controller.md.sal.binding.api.DataBroker bindingBroker;
- private final ReaderRegistry readerRegistry;
private final InstanceIdentifier<Node> mountPointPath;
- private final WriterRegistry writerRegistry;
private final BindingNormalizedNodeSerializer serializer;
private ObjectRegistration<DOMMountPoint> mountPointRegistration;
- private DOMDataBroker broker;
- private final ModifiableDataTree configDataTree;
- private final ReadableDataTree operationalDataTree;
+ private final DOMDataBroker domDataBroker;
public VppDataBrokerInitializationProvider(
@Nonnull final org.opendaylight.controller.md.sal.binding.api.DataBroker bindingBroker,
- @Nonnull final ReaderRegistry readerRegistry,
- @Nonnull final WriterRegistry writerRegistry,
@Nonnull final BindingNormalizedNodeSerializer serializer,
- @Nonnull final ModifiableDataTree configDataTree,
- @Nonnull final ReadableDataTree operationalDataTree) {
+ @Nonnull final DOMDataBroker domDataBroker) {
this.bindingBroker = checkNotNull(bindingBroker, "bindingBroker should not be null");
- this.readerRegistry = checkNotNull(readerRegistry, "readerRegistry should not be null");
- this.writerRegistry = checkNotNull(writerRegistry, "writerRegistry should not be null");
this.serializer = checkNotNull(serializer, "serializer should not be null");
- this.configDataTree = checkNotNull(configDataTree, "configDataTree should not be null");
- this.operationalDataTree = checkNotNull(operationalDataTree, "configDataTree should not be null");
+ this.domDataBroker = checkNotNull(domDataBroker, "domDataBroker should not be null");
this.mountPointPath = getMountPointPath();
}
@@ -115,8 +100,7 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
final DOMMountPointService.DOMMountPointBuilder mountPointBuilder = mountPointService.createMountPoint(path);
mountPointBuilder.addInitialSchemaContext(globalContext);
- broker = new DataBroker(operationalDataTree, configDataTree);
- mountPointBuilder.addService(DOMDataBroker.class, broker);
+ mountPointBuilder.addService(DOMDataBroker.class, domDataBroker);
mountPointRegistration = mountPointBuilder.register();
final DOMMountPoint mountPoint = mountPointRegistration.getInstance();
@@ -164,7 +148,7 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
}
public Optional<DOMDataBroker> getBroker() {
- return Optional.fromNullable(broker);
+ return Optional.fromNullable(domDataBroker);
}
@Override
@@ -173,10 +157,6 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
mountPointRegistration.close();
}
- if (broker != null) {
- broker = null;
- }
-
// remove MD-SAL placeholder data for VPP mount point:
final WriteTransaction rwTx = bindingBroker.newWriteOnlyTransaction();
// does not fail if data is not present: