X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcompatibility%2Fsal-compatibility%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcompatibility%2FNodeDataChangeListener.java;fp=opendaylight%2Fmd-sal%2Fcompatibility%2Fsal-compatibility%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcompatibility%2FNodeDataChangeListener.java;h=0000000000000000000000000000000000000000;hp=cdb26162c0a776b3f934fdb699752c7a11ad9bf2;hb=8644c0d5f1b10c02f68702f023c07ea939885176;hpb=fdda2ebadfe3729e21448fe8f44a506aa67b5da9 diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java deleted file mode 100644 index cdb26162c0..0000000000 --- a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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.sal.compatibility; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NodeDataChangeListener extends AbstractDataChangeListener { - private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class); - - - public NodeDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) { - super(adapter,db,Node.class); - } - - protected void add(InstanceIdentifier createKeyIdent, Node node) { - FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class); - if(fcn != null) { - FlowCapableNodeUpdatedBuilder fcbnu = new FlowCapableNodeUpdatedBuilder(fcn); - NodeUpdatedBuilder builder = new NodeUpdatedBuilder(); - builder.setId(node.getId()); - builder.setNodeRef(new NodeRef(createKeyIdent)); - builder.setNodeConnector(node.getNodeConnector()); - builder.addAugmentation(FlowCapableNodeUpdated.class, fcbnu.build()); - adapter.onNodeUpdatedInternal(builder.build()); - } - } - - protected void update(InstanceIdentifier updateKeyIdent, Node original, - Node update) { - this.add(updateKeyIdent, update); - } - - protected void remove(InstanceIdentifier ident, Node removeValue) { - NodeRemovedBuilder builder = new NodeRemovedBuilder(); - builder.setNodeRef(new NodeRef(ident)); - adapter.onNodeRemovedInternal(builder.build()); - } - - protected InstanceIdentifier getWildCardPath() { - return InstanceIdentifier.create(Nodes.class).child(Node.class); - } - -}