Merge "Bug 499: Initial implementation of data tree modifications"
authorEd Warnicke <eaw@cisco.com>
Mon, 31 Mar 2014 20:13:53 +0000 (20:13 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 31 Mar 2014 20:13:53 +0000 (20:13 +0000)
19 files changed:
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/FRMRuntimeDataProvider.xtend
opendaylight/md-sal/compatibility/flow-management-compatibility/src/main/java/org/opendaylight/controller/md/frm/compatibility/SampleConsumer.java
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topology/TopologyReader.xtend
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/topologymanager/AdSalTopologyMapping.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryMapping.java
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyProvider.xtend
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-port.yang
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/UnionSerializationTest.java
opendaylight/md-sal/sal-netconf-connector/pom.xml
opendaylight/md-sal/sal-rest-connector/pom.xml
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/config/yang/config/toaster_consumer/impl/ToasterConsumerModule.java
opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/config/yang/config/toaster_provider/impl/ToasterProviderModule.java

index dd510a1..fb0718a 100644 (file)
@@ -161,6 +161,8 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
 
         Map<String, Map.Entry<ModuleFactory, BundleContext>> allCurrentFactories = Collections.unmodifiableMap(
                 resolver.getAllFactories());
+
+        // closed by transaction controller
         ConfigTransactionLookupRegistry txLookupRegistry = new ConfigTransactionLookupRegistry(new TransactionIdentifier(
                 transactionName), factory, allCurrentFactories);
         ServiceReferenceWritableRegistry writableRegistry = ServiceReferenceRegistryImpl.createSRWritableRegistry(
index 84f76c9..6b7251c 100644 (file)
@@ -407,12 +407,14 @@ class ConfigTransactionControllerImpl implements
     }
 
     private void internalAbort() {
+        logger.trace("Aborting {}", this);
         transactionStatus.setAborted();
         close();
     }
 
     public void close() {
         dependencyResolverManager.close();
+        txLookupRegistry.close();
     }
 
     @Override
index 28408ab..9852a45 100644 (file)
@@ -326,26 +326,18 @@ public class SimpleConfigurationTest extends AbstractConfigTest {
     }
 
     @Test
-    public void testAbort() throws InstanceAlreadyExistsException, ValidationException {
+    public void testAbort() throws Exception {
         ConfigTransactionJMXClient transaction = configRegistryClient
                 .createTransaction();
         assertEquals(1, configRegistryClient.getOpenConfigs().size());
 
         transaction.abortConfig();
+        assertEquals(0, configRegistryClient.getOpenConfigs().size());
         try {
-            transaction.createModule(TestingFixedThreadPoolModuleFactory.NAME,
-                    fixed1);
-            fail();
-        } catch (IllegalStateException e) {
-            assertEquals("Configuration was aborted", e.getMessage());
-        }
-        try {
-            transaction.validateConfig();
+            platformMBeanServer.getMBeanInfo(transaction.getObjectName());
             fail();
-        } catch (IllegalStateException e) {
-            assertEquals("Configuration was aborted", e.getMessage());
+        }catch(InstanceNotFoundException e){
         }
-        assertEquals(0, configRegistryClient.getOpenConfigs().size());
     }
 
     @Test
index b90c763..2d4e7d2 100644 (file)
@@ -34,7 +34,7 @@ import org.opendaylight.yangtools.yang.common.RpcError
 
 class FRMRuntimeDataProvider implements RuntimeDataProvider, DataCommitHandler<InstanceIdentifier<? extends DataObject>, DataObject> {
 
-    static val FLOWS_PATH = InstanceIdentifier.builder().node(Flows).toInstance;
+    static val FLOWS_PATH = InstanceIdentifier.builder(Flows).toInstance;
 
     @Property
     var DataProviderService dataService;
index 0b77ea7..a91cef6 100644 (file)
@@ -27,7 +27,7 @@ public class SampleConsumer {
 
         DataModificationTransaction transaction = dataService.beginTransaction();
         Flow flow = createSampleFlow("foo", null);
-        InstanceIdentifier<Flow> path = InstanceIdentifier.builder().node(Flows.class).node(Flow.class, flow.getKey())
+        InstanceIdentifier<Flow> path = InstanceIdentifier.builder(Flows.class).child(Flow.class, flow.getKey())
                 .toInstance();
         transaction.putConfigurationData(path, flow);
 
index 7250841..20d375f 100644 (file)
@@ -7,35 +7,34 @@
  */
 package org.opendaylight.controller.md.compatibility.switchmanager
 
-import org.opendaylight.controller.switchmanager.ISwitchManager
-import org.opendaylight.controller.sal.core.NodeConnector
-import org.opendaylight.controller.sal.core.Property
-import java.util.List
-import org.opendaylight.controller.sal.core.Node
 import java.net.InetAddress
+import java.net.NetworkInterface
+import java.net.SocketException
+import java.util.ArrayList
+import java.util.Collections
+import java.util.HashSet
+import java.util.List
+import java.util.Map
 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService
-import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
-import org.opendaylight.controller.sal.core.Description
-import org.opendaylight.controller.sal.core.Tier
 import org.opendaylight.controller.sal.core.Bandwidth
+import org.opendaylight.controller.sal.core.Description
 import org.opendaylight.controller.sal.core.ForwardingMode
 import org.opendaylight.controller.sal.core.MacAddress
-
-import org.slf4j.LoggerFactory
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.opendaylight.yangtools.yang.binding.DataObject
-import java.net.NetworkInterface
-import java.net.SocketException
-import java.util.Collections
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import java.util.ArrayList
+import org.opendaylight.controller.sal.core.Node
+import org.opendaylight.controller.sal.core.NodeConnector
+import org.opendaylight.controller.sal.core.Property
+import org.opendaylight.controller.sal.core.Tier
+import org.opendaylight.controller.switchmanager.ISwitchManager
 import org.opendaylight.controller.switchmanager.Switch
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
-import java.util.Map
-import java.util.HashSet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
+import org.opendaylight.yangtools.yang.binding.DataObject
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.slf4j.LoggerFactory
+
+import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
 
 class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwitchManager {
 
@@ -118,7 +117,7 @@ class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwit
     }
 
     override getNetworkDevices() {
-        val path = InstanceIdentifier.builder().node(Nodes).toInstance;
+        val path = InstanceIdentifier.builder(Nodes).toInstance;
         val data = dataService.readOperationalData(path) as Nodes;
         val ret = new ArrayList<Switch>();
         for (node : data.node) {
@@ -173,7 +172,7 @@ class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwit
     }
 
     override getNodes() {
-        val path = InstanceIdentifier.builder().node(Nodes).toInstance;
+        val path = InstanceIdentifier.builder(Nodes).toInstance;
         val data = dataService.readOperationalData(path) as Nodes;
         val ret = new HashSet<Node>();
         for (node : data.node) {
index 37d4577..6ebe20b 100644 (file)
@@ -7,32 +7,27 @@
  */
 package org.opendaylight.controller.md.compatibility.topology
 
+import java.util.ArrayList
+import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider
+import org.opendaylight.controller.sal.core.Edge
+import org.opendaylight.controller.sal.core.NodeConnector
 import org.opendaylight.controller.switchmanager.ISwitchManager
 import org.opendaylight.controller.topologymanager.ITopologyManager
-import org.opendaylight.controller.md.sal.common.api.data.DataReader
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.opendaylight.yangtools.yang.binding.DataObject
-import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology
-import org.opendaylight.controller.md.compatibility.topology.TopologyMapping
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder
-
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder
-import java.util.ArrayList
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey
-import org.opendaylight.controller.sal.core.NodeConnector
-import org.opendaylight.controller.sal.topology.TopoEdgeUpdate
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder
-import org.opendaylight.controller.sal.core.Edge
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder
+import org.opendaylight.yangtools.yang.binding.DataObject
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 
 class TopologyReader implements RuntimeDataProvider {
 
@@ -53,7 +48,7 @@ class TopologyReader implements RuntimeDataProvider {
 
     new() {
         _topologyKey = new TopologyKey(new TopologyId("compatibility:ad-sal"));
-        _topologyPath = InstanceIdentifier.builder().node(NetworkTopology).child(Topology, topologyKey).toInstance;
+        _topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topologyKey).toInstance;
         _mapping = new TopologyMapping(topologyKey, topologyPath);
     }
 
index 905b838..aa238a8 100644 (file)
@@ -16,12 +16,8 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import java.util.Map
 import org.opendaylight.controller.sal.core.Edge
 import java.util.Set
-import java.util.List
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node
-import java.util.Collections
-import com.google.common.collect.FluentIterable
 import java.util.HashSet
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
 import org.opendaylight.controller.sal.compatibility.NodeMapping
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
@@ -30,7 +26,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.Destination
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey
 import java.util.HashMap
 
@@ -42,11 +37,11 @@ class AdSalTopologyMapping {
 
     new(TopologyKey topology) {
         topologyMapping = topology;
-        _topologyPath = InstanceIdentifier.builder.node(NetworkTopology).child(Topology, topology).toInstance;
+        _topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).toInstance;
     }
 
     def InstanceIdentifier<TerminationPoint> toTerminationPoint(NodeConnector connector) {
-        InstanceIdentifier.builder(topologyPath).node(Node).child(TerminationPoint, connector.toTerminationPointKey()).toInstance;
+        InstanceIdentifier.builder(topologyPath).child(Node).child(TerminationPoint, connector.toTerminationPointKey()).toInstance;
     }
 
     def Map<Edge, Set<org.opendaylight.controller.sal.core.Property>> toEdgePropertiesMap(Iterable<Link> links) {
index a59c2c1..00ce312 100644 (file)
@@ -251,9 +251,9 @@ package class SalCompatibilityProvider implements BindingAwareProvider {
         topology.dataService = session.getSALService(DataProviderService)
         tpProvider.dataService = session.getSALService(DataProviderService)
 
-        inventory.start();
+        inventory.startAdapter();
 
-        tpProvider.start();
+        tpProvider.startAdapter();
 
         subscribe.registerNotificationListener(dataPacket)
     }
index 0c211fd..f54defd 100644 (file)
@@ -122,12 +122,15 @@ class InventoryAndReadAdapter implements IPluginInReadService,
     private final Lock nodeToNodeConnectorsLock = new ReentrantLock();
 
 
-    def start(){
+    def startAdapter(){
         inventoryNotificationProvider.dataProviderService = dataProviderService;
         inventoryNotificationProvider.inventoryPublisher = inventoryPublisher;
         // inventoryNotificationProvider.start();
     }
 
+    def start(){
+    }
+
     def setInventoryPublisher(IPluginOutInventoryService listener){
         inventoryPublisher.add(listener);
     }
index 2dce505..2990422 100644 (file)
@@ -44,8 +44,7 @@ public class InventoryMapping {
   public static NodeRef toNodeRef(final Node node) {
     final NodeId nodeId = new NodeId(InventoryMapping.toNodeId(node));
     final NodeKey nodeKey = new NodeKey(nodeId);
-    final InstanceIdentifierBuilder<? extends Object> builder = InstanceIdentifier.builder();
-    final InstanceIdentifierBuilder<Nodes> nodes = builder.<Nodes>node(Nodes.class);
+    final InstanceIdentifierBuilder<Nodes> nodes = InstanceIdentifier.builder(Nodes.class);
     final InstanceIdentifierBuilder<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> child =
             nodes.<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node, NodeKey>child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey);
     final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> path = child.toInstance();
index 0486f34..fad37ae 100644 (file)
@@ -163,7 +163,7 @@ public class NodeMapping {
     Preconditions.checkArgument(MD_SAL_TYPE.equals(node.getType()));
     final String nodeId = Arguments.<String>checkInstanceOf(node.getID(), String.class);
     final NodeKey nodeKey = new NodeKey(new NodeId(nodeId));
-    final InstanceIdentifier<Node> nodePath = InstanceIdentifier.builder().node(Nodes.class).child(NODE_CLASS, nodeKey).toInstance();
+    final InstanceIdentifier<Node> nodePath = InstanceIdentifier.builder(Nodes.class).child(NODE_CLASS, nodeKey).toInstance();
     return new NodeRef(nodePath);
   }
   
index 3df826e..4aef75d 100644 (file)
@@ -31,8 +31,15 @@ class TopologyProvider implements AutoCloseable{
     DataProviderService dataService;
     
     Registration<DataCommitHandler<InstanceIdentifier<? extends DataObject>,DataObject>> commitHandlerRegistration;
-    
+
     def void start() {
+
+    }
+    def void startAdapter() {
+        if(dataService == null){
+            LOG.error("dataService not set");
+            return;
+        }
         commitHandler = new TopologyCommitHandler(dataService)
         commitHandler.setTopologyPublisher(topologyPublisher)
         val InstanceIdentifier<? extends DataObject> path = InstanceIdentifier.builder(NetworkTopology)
@@ -49,7 +56,9 @@ class TopologyProvider implements AutoCloseable{
     
     def setTopologyPublisher(IPluginOutTopologyService topologyPublisher) {
         _topologyPublisher = topologyPublisher;
-        commitHandler.setTopologyPublisher(topologyPublisher);
+        if(commitHandler != null){
+            commitHandler.setTopologyPublisher(topologyPublisher);
+        }
     }
     
 }
index cf6d232..047300a 100644 (file)
@@ -38,12 +38,6 @@ module sal-port {
             uses tr:transaction-aware;
         }
     }
-     
-    rpc get-port {
-        output {
-            uses port-type:flow-capable-port;
-        }
-    }
     
     notification port-updated {
         uses port-update;
index 248cca0..36a172d 100644 (file)
@@ -7,24 +7,17 @@
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import org.junit.Test;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.igp.node.attributes.Prefix;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.igp.node.attributes.PrefixBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
-
-
-
-
-
-
-
-import static org.junit.Assert.*;
-
 public class UnionSerializationTest extends AbstractDataServiceTest {
     
     public static final String PREFIX_STRING = "192.168.0.1/32";
@@ -42,7 +35,7 @@ public class UnionSerializationTest extends AbstractDataServiceTest {
         assertNotNull(serialized.getFirstSimpleByName(Prefix.QNAME));
         assertEquals(PREFIX_STRING, serialized.getFirstSimpleByName(Prefix.QNAME).getValue());
         
-        Prefix deserialized = (Prefix) testContext.getBindingToDomMappingService().dataObjectFromDataDom(InstanceIdentifier.builder().node(Prefix.class).build(), serialized);
+        Prefix deserialized = (Prefix) testContext.getBindingToDomMappingService().dataObjectFromDataDom(Prefix.class, serialized);
         assertNotNull(deserialized);
         assertNotNull(deserialized.getPrefix());
         assertNotNull(deserialized.getPrefix().getIpv4Prefix());
index 777709b..182441d 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-impl</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-parser-impl</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-broker-impl</artifactId>
index cc3b029..4aa3824 100644 (file)
       <groupId>io.netty</groupId>
       <artifactId>netty-codec-http</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-remote</artifactId>
+     </dependency>
     
     <!-- Testing Dependencies -->
     <dependency>
index c006a34..486cdcf 100644 (file)
@@ -17,11 +17,15 @@ import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120
 import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService;
 import org.opendaylight.yangtools.concepts.Registration;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
 *
 */
 public final class ToasterConsumerModule extends org.opendaylight.controller.config.yang.config.toaster_consumer.impl.AbstractToasterConsumerModule
  {
+    private static final Logger log = LoggerFactory.getLogger(ToasterConsumerModule.class);
 
     public ToasterConsumerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
@@ -55,6 +59,7 @@ public final class ToasterConsumerModule extends org.opendaylight.controller.con
             public void close() throws Exception {
                 runtimeRegistration.close();
                 notificationRegistration.close();
+                log.info("Toaster consumer (instance {}) torn down.", this);
             }
 
             @Override
@@ -63,6 +68,8 @@ public final class ToasterConsumerModule extends org.opendaylight.controller.con
             }
         }
 
-        return new AutoCloseableToastConsumer();
+        AutoCloseable ret = new AutoCloseableToastConsumer();
+        log.info("Toaster consumer (instance {}) initialized.", ret);
+        return ret;
     }
 }
index 1029105..8abff2c 100644 (file)
@@ -15,11 +15,15 @@ import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120
 import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterData;
 import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
 *
 */
 public final class ToasterProviderModule extends org.opendaylight.controller.config.yang.config.toaster_provider.impl.AbstractToasterProviderModule
  {
+    private static final Logger log = LoggerFactory.getLogger(ToasterProviderModule.class);
 
     public ToasterProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
@@ -58,6 +62,7 @@ public final class ToasterProviderModule extends org.opendaylight.controller.con
             public void close() throws Exception {
                 rpcRegistration.close();
                 runtimeReg.close();
+                log.info("Toaster provider (instance {}) torn down.", this);
             }
 
             @Override
@@ -66,7 +71,8 @@ public final class ToasterProviderModule extends org.opendaylight.controller.con
             }
         }
 
-        return new AutoCloseableToaster();
+        AutoCloseable ret = new AutoCloseableToaster();
+        log.info("Toaster provider (instance {}) initialized.", ret);
+        return ret;
     }
-
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.