Merge "Fixed validation bug of YANG import statement"
authorGiovanni Meo <gmeo@cisco.com>
Wed, 24 Apr 2013 16:02:49 +0000 (16:02 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 24 Apr 2013 16:02:49 +0000 (16:02 +0000)
96 files changed:
opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/internal/ArpHandler.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/IClusterServices.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManagerCommon.java
opendaylight/clustering/stub/src/main/java/org/opendaylight/controller/clustering/stub/internal/ClusterManagerCommon.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/SimpleClient.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationContainerImpl.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationImpl.java
opendaylight/distribution/opendaylight/pom.xml
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementation.java
opendaylight/forwardingrulesmanager/api/pom.xml [moved from opendaylight/forwardingrulesmanager/pom.xml with 92% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowConfig.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowConfig.java with 94% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntry.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntry.java with 87% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntryInstall.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntryInstall.java with 88% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java with 57% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManagerAware.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManagerAware.java with 57% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroup.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroup.java with 73% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupChangeListener.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupChangeListener.java with 60% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupConfig.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupConfig.java with 80% similarity]
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupProvider.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupProvider.java with 52% similarity]
opendaylight/forwardingrulesmanager/api/src/test/java/org/opendaylight/controller/forwardingrulesmanager/frmTest.java [moved from opendaylight/forwardingrulesmanager/src/test/java/org/opendaylight/controller/forwardingrulesmanager/frmTest.java with 80% similarity]
opendaylight/forwardingrulesmanager/implementation/pom.xml [new file with mode: 0644]
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/Activator.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/Activator.java with 65% similarity]
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java [moved from opendaylight/forwardingrulesmanager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java with 100% similarity]
opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java
opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java
opendaylight/logging/bridge/src/main/java/org/opendaylight/controller/logging/bridge/internal/Activator.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ContainerServiceDependency.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Node.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/NodeConnector.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ServiceHelper.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/yang/types/test/GeneratedTypesTest.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/GeneratorJavaFileTest.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/iana-if-type@2012-06-05.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-inet-types@2010-09-24.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-interfaces@2012-11-15.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-yang-types@2010-09-24.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/AbstractChildNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/AbstractTypeAwareBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/AugmentationSchemaBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/AugmentationTargetBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/ChildNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/DataSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/GroupingBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/SchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/api/UsesNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/AnyXmlBuilder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/AugmentationSchemaBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ChoiceBuilder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ChoiceCaseBuilder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ConstraintsBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ContainerSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/DeviationBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ExtensionBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/FeatureBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/GroupingBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/IdentitySchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/LeafListSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/LeafSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ListSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/ModuleBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/NotificationBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/RpcDefinitionBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/TypedefBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/UnionTypeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/UnknownSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/UsesNodeBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/impl/YangModelParserImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/impl/YangModelParserListenerImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/BitImpl.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/MustDefinitionImpl.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/ParserUtils.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/RefineHolder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/TypeConstraints.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/UnknownBoundaryNumber.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/YangModelBuilderUtil.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/util/YangParseException.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/model/parser/builder/impl/TestUtils.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/model/parser/builder/impl/YangModelBuilderTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/model/parser/impl/TestUtils.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/model/parser/impl/TypesResolutionTest.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/model/parser/impl/YangModelParserTest.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/testfile1.yang
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/testfile2.yang
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/testfile3.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/custom-types-test@2012-4-4.yang
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ContainerSchemaNode.java
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/NotificationDefinition.java
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/EmptyType.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/YangTypesConverter.java
opendaylight/statisticsmanager/integrationtest/pom.xml
opendaylight/statisticsmanager/integrationtest/src/test/java/org/opendaylight/controller/statisticsmanager/internal/StatisticsManagerIntegrationTest.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java
opendaylight/web/topology/src/main/java/org/opendaylight/controller/topology/web/Topology.java

index d4c1fd3..3730a71 100644 (file)
@@ -130,9 +130,11 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
 
     protected void handleARPPacket(Ethernet eHeader, ARP pkt, NodeConnector p) {
         if (pkt.getOpCode() == 0x1) {
-            logger.debug("Received ARP REQUEST Packet from NodeConnector:" + p);
+            logger.debug("Received ARP REQUEST Packet from NodeConnector: {}",
+                         p);
         } else {
-            logger.debug("Received ARP REPLY Packet from NodeConnector:" + p);
+            logger.debug("Received ARP REPLY Packet from NodeConnector: {}",
+                         p);
         }
         InetAddress targetIP = null;
         try {
@@ -328,13 +330,13 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
         Node n = host.getnodeconnectorNode();
         if (n == null) {
             logger.error("cannot send UcastARP because cannot extract node "
-                    + "from HostNodeConnector:" + host);
+                    + "from HostNodeConnector: {}", host);
             return;
         }
         NodeConnector outPort = host.getnodeConnector();
         if (outPort == null) {
             logger.error("cannot send UcastARP because cannot extract "
-                    + "outPort from HostNodeConnector:" + host);
+                    + "outPort from HostNodeConnector: {}", host);
             return;
         }
 
@@ -489,8 +491,8 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
             return PacketResult.IGNORED;
         }
         logger
-                .trace("Received a frame of size:"
-                        inPkt.getPacketData().length);
+                .trace("Received a frame of size: {}",
+                        inPkt.getPacketData().length);
         Packet formattedPak = this.dataPacketService.decodeDataPacket(inPkt);
         if (formattedPak instanceof Ethernet) {
             Object nextPak = formattedPak.getPayload();
index 031434f..68960ba 100644 (file)
@@ -118,7 +118,7 @@ public interface IClusterServices {
      *
      * @return ConcurrentHashMap to be used to modify the data structure
      */
-    ConcurrentMap<?, ?> getCache(String containerName, String cacheName);
+    ConcurrentMap<? extends Object, ? extends Object> getCache(String containerName, String cacheName);
 
     /**
      * Destroy a cachename given containerName/cachename, if doesn't exist
index 476b1b1..3034d3c 100644 (file)
@@ -113,15 +113,15 @@ public class ClusterManager implements IClusterServices {
         }
         while (supernodes.hasMoreTokens()) {
             String curr_supernode = supernodes.nextToken();
-            logger.debug("Examining supernode " + curr_supernode);
+            logger.debug("Examining supernode {}", curr_supernode);
             StringTokenizer host_port = new StringTokenizer(curr_supernode,
                     "[]");
             String host;
             String port;
             Integer port_num = gossipRouterPortDefault;
             if (host_port.countTokens() > 2) {
-                logger.error("Error parsing supernode " + curr_supernode
-                        + " proceed to the next one");
+                logger.error("Error parsing supernode {} proceed to the next one",
+                        curr_supernode);
                 continue;
             }
             host = host_port.nextToken();
@@ -184,13 +184,13 @@ public class ClusterManager implements IClusterServices {
                     for (InetAddress myAddr : myAddresses) {
                         if (myAddr.isLoopbackAddress()
                                 || myAddr.isLinkLocalAddress()) {
-                            logger.debug("Skipping local address "
-                                    + myAddr.getHostAddress());
+                            logger.debug("Skipping local address {}",
+                                         myAddr.getHostAddress());
                             continue;
                         } else {
                             // First non-local address
                             myBind = myAddr.getHostAddress();
-                            logger.debug("First non-local address " + myBind);
+                            logger.debug("First non-local address {}", myBind);
                             break;
                         }
                     }
@@ -199,7 +199,7 @@ public class ClusterManager implements IClusterServices {
                         .getProperty("jgroups.tcp.address");
                 if (jgroupAddress == null) {
                     if (myBind != null) {
-                        logger.debug("Set bind address to be " + myBind);
+                        logger.debug("Set bind address to be {}", myBind);
                         System.setProperty("jgroups.tcp.address", myBind);
                     } else {
                         logger
@@ -207,8 +207,8 @@ public class ClusterManager implements IClusterServices {
                         System.setProperty("jgroups.tcp.address", "127.0.0.1");
                     }
                 } else {
-                    logger.debug("jgroup.tcp.address already set to be "
-                            jgroupAddress);
+                    logger.debug("jgroup.tcp.address already set to be {}",
+                            jgroupAddress);
                 }
             } catch (UnknownHostException uhe) {
                 logger
@@ -220,14 +220,14 @@ public class ClusterManager implements IClusterServices {
         // host list
         System.setProperty("jgroups.tcpgossip.initial_hosts",
                 sanitized_supernodes_list.toString());
-        logger.debug("jgroups.tcp.address set to "
-                System.getProperty("jgroups.tcp.address"));
-        logger.debug("jgroups.tcpgossip.initial_hosts set to "
-                System.getProperty("jgroups.tcpgossip.initial_hosts"));
+        logger.debug("jgroups.tcp.address set to {}",
+                System.getProperty("jgroups.tcp.address"));
+        logger.debug("jgroups.tcpgossip.initial_hosts set to {}",
+                System.getProperty("jgroups.tcpgossip.initial_hosts"));
         GossipRouter res = null;
         if (amIGossipRouter) {
-            logger.info("I'm a GossipRouter will listen on port "
-                    gossipRouterPort);
+            logger.info("I'm a GossipRouter will listen on port {}",
+                    gossipRouterPort);
             res = new GossipRouter(gossipRouterPort);
         }
         return res;
@@ -241,10 +241,8 @@ public class ClusterManager implements IClusterServices {
                 this.gossiper.start();
                 logger.info("Started GossipRouter");
             } catch (Exception e) {
-                logger.error("GossipRouter didn't start exception " + e
-                        + " met");
-                logger.error("Stack Trace that raised the exception");
-                logger.error("",e);
+                logger.error("GossipRouter didn't start. Exception Stack Trace",
+                             e);
             }
         }
         logger.info("Starting the ClusterManager");
@@ -264,7 +262,7 @@ public class ClusterManager implements IClusterServices {
             this.cm = null;
             this.stop();
         }
-        logger.debug("Cache Manager has value " + this.cm);
+        logger.debug("Cache Manager has value {}", this.cm);
     }
 
     public void stop() {
index 2afbabe..7bf4954 100644 (file)
@@ -116,7 +116,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
         Dictionary props = c.getServiceProperties();
         if (props != null) {
             this.containerName = (String) props.get("containerName");
-            logger.debug("Running containerName:" + this.containerName);
+            logger.debug("Running containerName: {}", this.containerName);
         } else {
             // In the Global instance case the containerName is empty
             this.containerName = "";
index 13d05bb..035b0d3 100644 (file)
@@ -65,7 +65,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
         Dictionary props = c.getServiceProperties();
         if (props != null) {
             this.containerName = (String) props.get("containerName");
-            logger.debug("Running containerName:" + this.containerName);
+            logger.debug("Running containerName: {}", this.containerName);
         } else {
             // In the Global instance case the containerName is empty
             this.containerName = "";
@@ -88,7 +88,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
             CacheConfigException {
         ConcurrentMap<?, ?> res = this.caches.get(cacheName);
         if (res == null) {
-            res = new ConcurrentHashMap();
+            res = new ConcurrentHashMap<Object, Object>();
             this.caches.put(cacheName, res);
             return res;
         }
index 3e9717f..b6ab95d 100644 (file)
@@ -243,6 +243,7 @@ public class SimpleClient implements CommandProvider {
         }
     }
 
+    @SuppressWarnings("deprecation") //IGetUpdates intentionally deprecated
     public void _unlisten(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -370,7 +371,7 @@ public class SimpleClient implements CommandProvider {
     }
 
     public void _dumper(CommandInterpreter ci) {
-        ConcurrentMap c;
+        ConcurrentMap<Object, Object> c;
         String containerName = ci.nextArgument();
         if (containerName == null) {
             ci.println("containerName not supplied");
@@ -381,10 +382,10 @@ public class SimpleClient implements CommandProvider {
             ci.println("Cache not supplied");
             return;
         }
-        c = (ConcurrentMap) this.icluster.getCache(containerName, cacheName);
+        c = (ConcurrentMap<Object, Object>) this.icluster.getCache(containerName, cacheName);
         if (c != null) {
-            for (Object e : c.entrySet()) {
-                Map.Entry entry = (Map.Entry) e;
+            for (Map.Entry<Object, Object> e : c.entrySet()) {
+                Map.Entry<Object, Object> entry = e;
                 Object v = entry.getValue();
                 String res = "<NOT KNOWN>";
                 if (v != null) {
@@ -437,6 +438,7 @@ public class SimpleClient implements CommandProvider {
         }
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove call to deprecated amIStandby
     public void _getRole(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -449,6 +451,7 @@ public class SimpleClient implements CommandProvider {
         ci.println("My role is: " + role);
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove call to deprecated getActiveAddres
     public void _getActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -458,6 +461,7 @@ public class SimpleClient implements CommandProvider {
                 + this.icluster.getActiveAddress());
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove use of deprecated listenRoleChange
     public void _listenActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
@@ -473,6 +477,7 @@ public class SimpleClient implements CommandProvider {
         ci.println("Register listenRoleChanges");
     }
 
+    @SuppressWarnings("deprecation") //TODO: remove deprecated call to unlistenRoleChange
     public void _unlistenActive(CommandInterpreter ci) {
         if (this.icluster == null) {
             ci.println("\nNo Clustering services available");
index efe966b..3d0c565 100644 (file)
@@ -83,14 +83,14 @@ public class ConfigurationContainerImpl implements
     public Status saveConfiguration() {
         boolean success = true;
         for (IConfigurationContainerAware configurationAware : configurationAwareList) {
-            logger.info("Save Config triggered for "
-                    + configurationAware.getClass().getSimpleName());
+            logger.info("Save Config triggered for {}",
+                      configurationAware.getClass().getSimpleName());
 
             Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
                success = false;
-               logger.info("Failed to save config for "
-                               configurationAware.getClass().getSimpleName());
+               logger.info("Failed to save config for {}",
+                               configurationAware.getClass().getSimpleName());
             }
         }
         if (success) {
index a8f7da6..ee15b4a 100644 (file)
@@ -84,8 +84,8 @@ public class ConfigurationImpl implements IConfigurationService {
                Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
                success = false;
-               logger.info("Failed to save config for "
-                               configurationAware.getClass().getName());
+               logger.info("Failed to save config for {}",
+                               configurationAware.getClass().getName());
             }
         }
         if (success) {
index 8a74689..f05c95b 100644 (file)
@@ -40,7 +40,8 @@
     <module>../../configuration/implementation</module>
     <module>../../routing/dijkstra_implementation</module>
     <module>../../arphandler</module>
-    <module>../../forwardingrulesmanager</module>
+    <module>../../forwardingrulesmanager/api</module>
+    <module>../../forwardingrulesmanager/implementation</module>
     <module>../../hosttracker</module>
     <module>../../containermanager/api</module>
     <module>../../containermanager/implementation</module>
index 4c2ea73..ad6ea6b 100644 (file)
@@ -451,8 +451,8 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         staticRoutesFileName = ROOT + "staticRouting_" + containerName
                 + ".conf";
 
-        log.debug("forwarding.staticrouting starting on container "
-                + containerName);
+        log.debug("forwarding.staticrouting starting on container {}",
+                  containerName);
         //staticRoutes = new ConcurrentHashMap<String, StaticRoute>();
         allocateCaches();
         retrieveCaches();
@@ -6,7 +6,7 @@
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>commons.opendaylight</artifactId>
     <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/opendaylight</relativePath>
+    <relativePath>../../commons/opendaylight</relativePath>
   </parent>
 
   <groupId>org.opendaylight.controller</groupId>
               org.eclipse.osgi.framework.console,
                          org.osgi.framework
            </Import-Package>
-        <Bundle-Activator>
-             org.opendaylight.controller.forwardingrulesmanager.internal.Activator
-               </Bundle-Activator>
-            <Require-Bundle>
+        <Require-Bundle>
               org.opendaylight.controller.hosttracker
-            </Require-Bundle>
+        </Require-Bundle>
             <Service-Component>
             </Service-Component>
           </instructions>
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -76,8 +75,8 @@ public class FlowConfig implements Serializable {
     private String status;
 
     /*
-     * The order of the object data defined below is used directly in the UI built using JSP.
-     * Hence try to keep the order in a more logical way.
+     * The order of the object data defined below is used directly in the UI
+     * built using JSP. Hence try to keep the order in a more logical way.
      */
     @XmlElement
     private String installInHw;
@@ -216,14 +215,14 @@ public class FlowConfig implements Serializable {
     public void setInstallInHw(boolean inHw) {
         installInHw = inHw ? "true" : "false";
     }
-    
+
     public String getInstallInHw() {
-       return installInHw;
+        return installInHw;
     }
 
     public boolean isInternalFlow() {
         // Controller generated static flows have name starting with "**"
-       return (this.name != null && this.name.startsWith("**"));
+        return (this.name != null && this.name.startsWith("**"));
     }
 
     public String getName() {
@@ -608,14 +607,15 @@ public class FlowConfig implements Serializable {
                         }
                     }
 
-                    log.debug("Get Nexthop address = {} Type = {}", address, setNHType.toString());
+                    log.debug("Get Nexthop address = {} Type = {}", address,
+                            setNHType.toString());
                     if (setNHType == SetNextHopType.RESOLVE_L2RW) {
                         try {
                             return InetAddress.getByName(address);
                         } catch (Exception e) {
-                            log
-                                    .debug("Exception during nextHopAddress resolution : ",
-                                            e);
+                            log.debug(
+                                    "Exception during nextHopAddress resolution : ",
+                                    e);
                         }
                     }
                 }
@@ -641,10 +641,9 @@ public class FlowConfig implements Serializable {
                 .compile("([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}");
         Matcher mm = macPattern.matcher(mac);
         if (!mm.matches()) {
-            log
-                    .debug(
-                            "Ethernet address {} is not valid. Example: 00:05:b9:7c:81:5f",
-                            mac);
+            log.debug(
+                    "Ethernet address {} is not valid. Example: 00:05:b9:7c:81:5f",
+                    mac);
             return false;
         }
         return true;
@@ -657,8 +656,7 @@ public class FlowConfig implements Serializable {
         }
 
         if (sw == null) {
-            log
-                    .debug("switch info is not available. Skip checking if port is part of a switch or not.");
+            log.debug("switch info is not available. Skip checking if port is part of a switch or not.");
             return true;
         }
 
@@ -713,11 +711,11 @@ public class FlowConfig implements Serializable {
         // Check against each container's flow
         Flow flow = this.getFlow();
 
-        // Configuration is rejected if it conflicts with _all_ the container flows
+        // Configuration is rejected if it conflicts with _all_ the container
+        // flows
         for (ContainerFlow cFlow : cFlowList) {
             if (cFlow.allowsFlow(flow)) {
-                log
-                        .trace("Config is congruent with at least one container flow");
+                log.trace("Config is congruent with at least one container flow");
                 return false;
             }
         }
@@ -756,8 +754,7 @@ public class FlowConfig implements Serializable {
                     }
                 }
                 if (sw == null) {
-                    resultStr
-                            .append(String.format("Node %s not found", node));
+                    resultStr.append(String.format("Node %s not found", node));
                     return false;
                 }
             } else {
@@ -783,8 +780,7 @@ public class FlowConfig implements Serializable {
                 if (isPortValid(sw, port) == false) {
                     resultStr
                             .append(String
-                                    .format(
-                                            "Ingress port %d is not valid for the Switch",
+                                    .format("Ingress port %d is not valid for the Switch",
                                             port));
                     if ((container != null)
                             && !container.getName().equals(
@@ -843,8 +839,7 @@ public class FlowConfig implements Serializable {
             if ((dlSrc != null) && !isL2AddressValid(dlSrc)) {
                 resultStr
                         .append(String
-                                .format(
-                                        "Ethernet source address %s is not valid. Example: 00:05:b9:7c:81:5f",
+                                .format("Ethernet source address %s is not valid. Example: 00:05:b9:7c:81:5f",
                                         dlSrc));
                 return false;
             }
@@ -852,8 +847,7 @@ public class FlowConfig implements Serializable {
             if ((dlDst != null) && !isL2AddressValid(dlDst)) {
                 resultStr
                         .append(String
-                                .format(
-                                        "Ethernet destination address %s is not valid. Example: 00:05:b9:7c:81:5f",
+                                .format("Ethernet destination address %s is not valid. Example: 00:05:b9:7c:81:5f",
                                         dlDst));
                 return false;
             }
@@ -929,8 +923,7 @@ public class FlowConfig implements Serializable {
                                     if (isPortValid(sw, port) == false) {
                                         resultStr
                                                 .append(String
-                                                        .format(
-                                                                "Output port %d is not valid for this switch",
+                                                        .format("Output port %d is not valid for this switch",
                                                                 port));
                                         if ((container != null)
                                                 && !container.getName().equals(
@@ -965,8 +958,8 @@ public class FlowConfig implements Serializable {
                     if (sstr.matches()) {
                         if (!NetUtils.isIPv4AddressValid(sstr.group(1))) {
                             resultStr.append(String.format(
-                                    "IP source address %s is not valid", sstr
-                                            .group(1)));
+                                    "IP source address %s is not valid",
+                                    sstr.group(1)));
                             return false;
                         }
                         continue;
@@ -1007,8 +1000,7 @@ public class FlowConfig implements Serializable {
                                 && !isVlanPriorityValid(sstr.group(1))) {
                             resultStr
                                     .append(String
-                                            .format(
-                                                    "Vlan priority %s is not in the range 0 - 7",
+                                            .format("Vlan priority %s is not in the range 0 - 7",
                                                     sstr.group(1)));
                             return false;
                         }
@@ -1023,8 +1015,7 @@ public class FlowConfig implements Serializable {
                                 && !isL2AddressValid(sstr.group(1))) {
                             resultStr
                                     .append(String
-                                            .format(
-                                                    "Ethernet source address %s is not valid. Example: 00:05:b9:7c:81:5f",
+                                            .format("Ethernet source address %s is not valid. Example: 00:05:b9:7c:81:5f",
                                                     sstr.group(1)));
                             return false;
                         }
@@ -1039,8 +1030,7 @@ public class FlowConfig implements Serializable {
                                 && !isL2AddressValid(sstr.group(1))) {
                             resultStr
                                     .append(String
-                                            .format(
-                                                    "Ethernet destination address %s is not valid. Example: 00:05:b9:7c:81:5f",
+                                            .format("Ethernet destination address %s is not valid. Example: 00:05:b9:7c:81:5f",
                                                     sstr.group(1)));
                             return false;
                         }
@@ -1055,8 +1045,7 @@ public class FlowConfig implements Serializable {
                                 && !isTOSBitsValid(sstr.group(1))) {
                             resultStr
                                     .append(String
-                                            .format(
-                                                    "IP ToS bits %s is not in the range 0 - 63",
+                                            .format("IP ToS bits %s is not in the range 0 - 63",
                                                     sstr.group(1)));
                             return false;
                         }
@@ -1085,8 +1074,7 @@ public class FlowConfig implements Serializable {
                                 && !isTpPortValid(sstr.group(1))) {
                             resultStr
                                     .append(String
-                                            .format(
-                                                    "Transport destination port %s is not valid",
+                                            .format("Transport destination port %s is not valid",
                                                     sstr.group(1)));
                             return false;
                         }
@@ -1115,8 +1103,8 @@ public class FlowConfig implements Serializable {
                 return false;
             }
         } catch (NumberFormatException e) {
-            resultStr.append(String.format("Invalid number format %s", e
-                    .getMessage()));
+            resultStr.append(String.format("Invalid number format %s",
+                    e.getMessage()));
             return false;
         }
 
@@ -1124,25 +1112,26 @@ public class FlowConfig implements Serializable {
     }
 
     public FlowEntry getFlowEntry() {
-        return new FlowEntry(FlowConfig.staticFlowsGroup, this.name, this
-                .getFlow(), this.getNode());
+        return new FlowEntry(FlowConfig.staticFlowsGroup, this.name,
+                this.getFlow(), this.getNode());
     }
 
     public Flow getFlow() {
         Match match = new Match();
 
         if (this.ingressPort != null) {
-            match.setField(MatchType.IN_PORT, NodeConnectorCreator
-                    .createOFNodeConnector(Short.parseShort(ingressPort),
-                            getNode()));
+            match.setField(
+                    MatchType.IN_PORT,
+                    NodeConnectorCreator.createOFNodeConnector(
+                            Short.parseShort(ingressPort), getNode()));
         }
         if (this.dlSrc != null) {
-            match.setField(MatchType.DL_SRC, HexEncode
-                    .bytesFromHexString(this.dlSrc));
+            match.setField(MatchType.DL_SRC,
+                    HexEncode.bytesFromHexString(this.dlSrc));
         }
         if (this.dlDst != null) {
-            match.setField(MatchType.DL_DST, HexEncode
-                    .bytesFromHexString(this.dlDst));
+            match.setField(MatchType.DL_DST,
+                    HexEncode.bytesFromHexString(this.dlDst));
         }
         if (this.etherType != null) {
             match.setField(MatchType.DL_TYPE, Integer.decode(etherType)
@@ -1152,8 +1141,8 @@ public class FlowConfig implements Serializable {
             match.setField(MatchType.DL_VLAN, Short.parseShort(this.vlanId));
         }
         if (this.vlanPriority != null) {
-            match.setField(MatchType.DL_VLAN_PR, Byte
-                    .parseByte(this.vlanPriority));
+            match.setField(MatchType.DL_VLAN_PR,
+                    Byte.parseByte(this.vlanPriority));
         }
         if (this.nwSrc != null) {
             String parts[] = this.nwSrc.split("/");
@@ -1178,8 +1167,8 @@ public class FlowConfig implements Serializable {
             match.setField(MatchType.NW_DST, ip, mask);
         }
         if (this.protocol != null) {
-            match.setField(MatchType.NW_PROTO, IPProtocols
-                    .getProtocolNumberByte(this.protocol));
+            match.setField(MatchType.NW_PROTO,
+                    IPProtocols.getProtocolNumberByte(this.protocol));
         }
         if (this.tosBits != null) {
             match.setField(MatchType.NW_TOS, Byte.parseByte(this.tosBits));
@@ -1246,9 +1235,9 @@ public class FlowConfig implements Serializable {
     }
 
     /*
-     * Parses the actions string and return the List of SAL Action
-     * No syntax check run, as this function will be called when the
-     * config validation check has already been performed
+     * Parses the actions string and return the List of SAL Action No syntax
+     * check run, as this function will be called when the config validation
+     * check has already been performed
      */
     private List<Action> getActionList() {
         List<Action> actionList = new ArrayList<Action>();
@@ -1265,8 +1254,8 @@ public class FlowConfig implements Serializable {
                             if (n.group(1) != null) {
                                 short ofPort = Short.parseShort(n.group(1));
                                 actionList.add(new Output(NodeConnectorCreator
-                                        .createOFNodeConnector(ofPort, this
-                                                .getNode())));
+                                        .createOFNodeConnector(ofPort,
+                                                this.getNode())));
                             }
                         }
                     }
@@ -1319,8 +1308,8 @@ public class FlowConfig implements Serializable {
                         ActionType.SET_VLAN_ID.toString() + "=(.*)").matcher(
                         actiongrp);
                 if (sstr.matches()) {
-                    actionList.add(new SetVlanId(Short
-                            .parseShort(sstr.group(1))));
+                    actionList.add(new SetVlanId(
+                            Short.parseShort(sstr.group(1))));
                     continue;
                 }
 
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -22,14 +21,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Represents a flow applications request Forwarding Rules Manager to install
- * on a network node. A FlowEntry is constituted of a flow (match + actions),
- * the target network node, and the flow name. It also includes a group name. 
- * For instance the flows constituting a policy all share the same group name.
+ * Represents a flow applications request Forwarding Rules Manager to install on
+ * a network node. A FlowEntry is constituted of a flow (match + actions), the
+ * target network node, and the flow name. It also includes a group name. For
+ * instance the flows constituting a policy all share the same group name.
  */
 public class FlowEntry implements Cloneable, Serializable {
     protected static final Logger logger = LoggerFactory
-    .getLogger(FlowEntry.class);
+            .getLogger(FlowEntry.class);
     private static final long serialVersionUID = 1L;
     private static final Logger log = LoggerFactory.getLogger(FlowEntry.class);
     private String groupName; // group name
@@ -54,7 +53,7 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Return the actual Flow contained in this entry
-     *
+     * 
      * @return the flow
      */
     public Flow getFlow() {
@@ -84,7 +83,7 @@ public class FlowEntry implements Cloneable, Serializable {
             cloned = (FlowEntry) super.clone();
             cloned.flow = this.flow.clone();
         } catch (CloneNotSupportedException e) {
-           log.warn("exception in clone", e);
+            log.warn("exception in clone", e);
         }
         return cloned;
     }
@@ -115,13 +114,12 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Merges the current Flow with the passed Container Flow
-     *
-     * Note: Container Flow merging is not an injective function.
-     * Be m1 and m2 two different matches, and be f() the flow merge
-     * function, such that y1 = f(m1) and y2 = f(m2) are the two merged
-     * matches, we may have: y1 = y2
-     *
-     *
+     * 
+     * Note: Container Flow merging is not an injective function. Be m1 and m2
+     * two different matches, and be f() the flow merge function, such that y1 =
+     * f(m1) and y2 = f(m2) are the two merged matches, we may have: y1 = y2
+     * 
+     * 
      * @param containerFlow
      * @return this merged FlowEntry
      */
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -15,15 +14,15 @@ import org.opendaylight.controller.sal.core.ContainerFlow;
 import org.opendaylight.controller.sal.core.Node;
 
 /**
- * The flow database object representing the flow entry to install on
- * the network node. It contains the original flow entry FRM was
- * requested to install, the container flow with which that entry had
- * to be merged and the resultant merged flow entry, which is the
- * one that was eventually installed on the network node
- *
- * Note: If the container flow is null, the install entry will be a clone
- * of the original entry
- *
+ * The flow database object representing the flow entry to install on the
+ * network node. It contains the original flow entry FRM was requested to
+ * install, the container flow with which that entry had to be merged and the
+ * resultant merged flow entry, which is the one that was eventually installed
+ * on the network node
+ * 
+ * Note: If the container flow is null, the install entry will be a clone of the
+ * original entry
+ * 
  */
 public class FlowEntryInstall {
     private FlowEntry original;
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -19,42 +18,46 @@ import org.opendaylight.controller.sal.utils.Status;
 /**
  * Interface that describes methods for installing or removing forwarding rules
  * and to access to the flows database.
- *
+ * 
  */
 public interface IForwardingRulesManager {
 
     /**
-     * It requests FRM to install the passed Flow Entry. FRM will request
-     * the SDN protocol plugin to install the flow on the network node.
-     * Based on the result of this operation FRM will update its database
-     * accordingly and will return the proper {@code Status} code.
+     * It requests FRM to install the passed Flow Entry. FRM will request the
+     * SDN protocol plugin to install the flow on the network node. Based on the
+     * result of this operation FRM will update its database accordingly and
+     * will return the proper {@code Status} code.
      * 
-        * @param flow the flow entry to install
-        * @return the {@code Status} object indicating the result of this action.
-        */
+     * @param flow
+     *            the flow entry to install
+     * @return the {@code Status} object indicating the result of this action.
+     */
     public Status installFlowEntry(FlowEntry flow);
 
     /**
-     * It requests FRM to remove the passed Flow Entry. FRM will request
-     * the SDN protocol plugin to uninstall the flow from the network node.
-     * Based on the result of this operation FRM will update its database
-     * accordingly and will return the proper {@code Status} code.
+     * It requests FRM to remove the passed Flow Entry. FRM will request the SDN
+     * protocol plugin to uninstall the flow from the network node. Based on the
+     * result of this operation FRM will update its database accordingly and
+     * will return the proper {@code Status} code.
      * 
-     * @param flow the flow entry to uninstall
+     * @param flow
+     *            the flow entry to uninstall
      * @return the {@code Status} object indicating the result of this action
      */
     public Status uninstallFlowEntry(FlowEntry flow);
 
     /**
      * It requests FRM to replace the currently installed Flow Entry with the
-     * new one. It is up to the SDN protocol plugin to decide how to convey
-     * this message to the network node. It could be a delete + add or a single
-     * modify message depending on the SDN protocol specifications
-     * If the current flow is equal to the new one  it will be a no op and
-     * success code is returned.
+     * new one. It is up to the SDN protocol plugin to decide how to convey this
+     * message to the network node. It could be a delete + add or a single
+     * modify message depending on the SDN protocol specifications If the
+     * current flow is equal to the new one it will be a no op and success code
+     * is returned.
      * 
-     * @param current the current flow entry to modify
-     * @param newone the new flow entry which will replace the current one
+     * @param current
+     *            the current flow entry to modify
+     * @param newone
+     *            the new flow entry which will replace the current one
      * @return the {@code Status} object indicating the result of this action
      */
     public Status modifyFlowEntry(FlowEntry current, FlowEntry newone);
@@ -63,15 +66,15 @@ public interface IForwardingRulesManager {
      * It requests the FRM to replace the currently installed Flow Entry with
      * the new one. The currently installed entry is derived by the Match
      * portion of the passed Flow. FRM looks in its database for a previously
-     * installed FlowEntry which Match equals the Match of the passed Flow.
-     * If it finds it, it will request the SDN protocol plugin to replace the
-     * existing flow with the new one on the network node. If it does not
-     * find it, it will request plugin to add the new flow. If the passed entry
-     * is not valid an error code is returned.
-     * If the existing flow is equal to the passed one it will be a no op and
-     * success code is returned.
+     * installed FlowEntry which Match equals the Match of the passed Flow. If
+     * it finds it, it will request the SDN protocol plugin to replace the
+     * existing flow with the new one on the network node. If it does not find
+     * it, it will request plugin to add the new flow. If the passed entry is
+     * not valid an error code is returned. If the existing flow is equal to the
+     * passed one it will be a no op and success code is returned.
      * 
-     * @param newone the new flow entry to install
+     * @param newone
+     *            the new flow entry to install
      * @return the {@code Status} object indicating the result of this action
      */
     public Status modifyOrAddFlowEntry(FlowEntry newone);
@@ -79,64 +82,81 @@ public interface IForwardingRulesManager {
     /**
      * Check whether the passed flow entry conflicts with the Container flows
      * 
-     * @param flow the flow entry to test
+     * @param flow
+     *            the flow entry to test
      * @return true if conflicts, false otherwise
      */
     public boolean checkFlowEntryConflict(FlowEntry flow);
 
     /**
-     * Returns the list of Flow entries across network nodes which are part of the
-     * same flow group, policy
-     *
-     * @param group the group name
+     * Returns the list of Flow entries across network nodes which are part of
+     * the same flow group, policy
+     * 
+     * @param group
+     *            the group name
      * @return the list of flow entries belonging to the specified group
      */
     public List<FlowEntry> getFlowEntriesForGroup(String group);
 
     /**
-     * Add a list of output port to the flow with the specified name on the specified network node
-     *
-     * @param node     the network node
-     * @param flowName the flow name
-     * @param dstPort the list of ports to be added to the flow output actions
+     * Add a list of output port to the flow with the specified name on the
+     * specified network node
+     * 
+     * @param node
+     *            the network node
+     * @param flowName
+     *            the flow name
+     * @param dstPort
+     *            the list of ports to be added to the flow output actions
      */
     public void addOutputPort(Node node, String flowName,
             List<NodeConnector> dstPort);
 
     /**
-     * Remove a list of output port from the flow with the specified name on the specified network node
-     *
-     * @param node the network node
-     * @param flowName the flow name
-     * @param dstPortthe list of ports to be removed from the flow output actions
+     * Remove a list of output port from the flow with the specified name on the
+     * specified network node
+     * 
+     * @param node
+     *            the network node
+     * @param flowName
+     *            the flow name
+     * @param dstPortthe
+     *            list of ports to be removed from the flow output actions
      */
     public void removeOutputPort(Node node, String flowName,
             List<NodeConnector> dstPort);
 
     /**
-     * Replace the current output port in the specified flow with the specified one
-     *
-     * @param node     the network node
-     * @param groupName the group name
-     * @param flowName the flow name
-     * @param dstPort  the new output action port
+     * Replace the current output port in the specified flow with the specified
+     * one
+     * 
+     * @param node
+     *            the network node
+     * @param groupName
+     *            the group name
+     * @param flowName
+     *            the flow name
+     * @param dstPort
+     *            the new output action port
      */
     public void replaceOutputPort(Node node, String flowName,
             NodeConnector outPort);
 
     /**
      * Returns the output port configured on the specified flow
-     *
-     * @param node     the network node
-     * @param flowName the flow name
+     * 
+     * @param node
+     *            the network node
+     * @param flowName
+     *            the flow name
      * @return the output action port for the specified flow
      */
     public NodeConnector getOutputPort(Node node, String flowName);
 
     /**
-     * Returns all the troubleshooting information that applications
-     * have set along with the policy they have configured through
-     * forwarding rules manger.
+     * Returns all the troubleshooting information that applications have set
+     * along with the policy they have configured through forwarding rules
+     * manger.
      * 
      * @return the collection of troubleshooting objects
      */
@@ -144,60 +164,69 @@ public interface IForwardingRulesManager {
 
     /**
      * Set the troubleshooting information for the policy
-     *
-     * @param policyname the flow group name
-     * @param o        the object containing the troubleshooting information
-     * @param add      true for adding, false for removing
+     * 
+     * @param policyname
+     *            the flow group name
+     * @param o
+     *            the object containing the troubleshooting information
+     * @param add
+     *            true for adding, false for removing
      */
     public void setTSPolicyData(String policyName, Object o, boolean add);
 
     /**
-     * Returns the troubleshooting information that was set for the specified policy
+     * Returns the troubleshooting information that was set for the specified
+     * policy
      * 
-     * @param groupName the flows group name
+     * @param groupName
+     *            the flows group name
      * @return the troubleshooting info object
      */
     public Object getTSPolicyData(String policyName);
 
     /**
-     * Returns the specifications of all the flows configured for all the 
+     * Returns the specifications of all the flows configured for all the
      * switches on the current container
-     *
+     * 
      * @return the list of flow configurations present in the database
      */
     public List<FlowConfig> getStaticFlows();
 
     /**
-     * Returns the specifications of all the flows configured for 
-     * the given switch on the current container
-     *
-     * @param node     the network node identifier
-     * @return the list of {@code FlowConfig} objects
+     * Returns the specifications of all the flows configured for the given
+     * switch on the current container
+     * 
+     * @param node
+     *            the network node identifier
+     * @return the list of {@code FlowConfig} objects
      */
     public List<FlowConfig> getStaticFlows(Node node);
 
     /**
-     * Returns the specification of the flow configured for the given
-     * network node on the current container
-     *
-     * @param name the flow name
-     * @param n the netwrok node identifier
+     * Returns the specification of the flow configured for the given network
+     * node on the current container
+     * 
+     * @param name
+     *            the flow name
+     * @param n
+     *            the netwrok node identifier
      * @return the {@code FlowConfig} object
      */
     public FlowConfig getStaticFlow(String name, Node n);
 
     /**
-     * Returns the list of names of flows configured for the given 
-     * Network node on the current container
-     *
-     * @param node the network node identifier
+     * Returns the list of names of flows configured for the given Network node
+     * on the current container
+     * 
+     * @param node
+     *            the network node identifier
      * @return the list of flow names
      */
     public List<String> getStaticFlowNamesForNode(Node node);
 
     /**
      * Returns the list of Node(s) for which a static flow has been configured
-     *
+     * 
      * @return the list of network nodes
      */
     public List<Node> getListNodeWithConfiguredFlows();
@@ -210,59 +239,70 @@ public interface IForwardingRulesManager {
     public Status saveConfig();
 
     /**
-     * Add a flow specified by the {@code FlowConfig} object on the current container
+     * Add a flow specified by the {@code FlowConfig} object on the current
+     * container
      * 
-     * @param config the {@code FlowConfig} object representing the static flow
-     * @param restore if set to true, the config object validation will be skipped.
-     *                                  Used only internally, always set it to false.
+     * @param config
+     *            the {@code FlowConfig} object representing the static flow
+     * @param restore
+     *            if set to true, the config object validation will be skipped.
+     *            Used only internally, always set it to false.
      * @return the {@code Status} object indicating the result of this action.
      */
     public Status addStaticFlow(FlowConfig config, boolean restore);
 
     /**
-     * Remove a flow specified by the {@code FlowConfig} object on the current container
+     * Remove a flow specified by the {@code FlowConfig} object on the current
+     * container
      * 
-     * @param config the {@code FlowConfig} object representing the static flow
+     * @param config
+     *            the {@code FlowConfig} object representing the static flow
      * @return the {@code Status} object indicating the result of this action
      */
     public Status removeStaticFlow(FlowConfig config);
 
     /**
-     * Replace the flow identified by the {@code FlowConfig.name} name for
-     * the {@code FlowConfig.node} network node with the new flow specified
-     * by {@code FlowConfig} object
-     *
-     * @param config the {@code FlowConfig} object
+     * Replace the flow identified by the {@code FlowConfig.name} name for the
+     * {@code FlowConfig.node} network node with the new flow specified by
+     * {@code FlowConfig} object
+     * 
+     * @param config
+     *            the {@code FlowConfig} object
      * @returnthe {@code Status} object indicating the result of this action
      */
     public Status modifyStaticFlow(FlowConfig config);
 
     /**
      * Remove the flow specified by name on the passed network node
-     *
-     * @param name for the static flow
-     * @param node on which the flow is attached
+     * 
+     * @param name
+     *            for the static flow
+     * @param node
+     *            on which the flow is attached
      * @return the {@code Status} object indicating the result of this action
      */
     public Status removeStaticFlow(String name, Node node);
 
     /**
-     * Toggle the installation status of the specified configured flow
-     * If the flow configuration status is active, this call will
-     * change the flow status to inactive and vice-versa
-     *
-     * @param configObject the {@code FlowConfig} object
+     * Toggle the installation status of the specified configured flow If the
+     * flow configuration status is active, this call will change the flow
+     * status to inactive and vice-versa
+     * 
+     * @param configObject
+     *            the {@code FlowConfig} object
      * @return the {@code Status} object indicating the result of this action
      */
     public Status toggleStaticFlowStatus(FlowConfig configObject);
-    
+
     /**
-     * Toggle the installation status of the specified configured flow
-     * If the flow configuration status is active, this call will
-     * change the flow status to inactive and vice-versa
-     *
-     * @param name for the static flow
-     * @param node on which the flow is attached
+     * Toggle the installation status of the specified configured flow If the
+     * flow configuration status is active, this call will change the flow
+     * status to inactive and vice-versa
+     * 
+     * @param name
+     *            for the static flow
+     * @param node
+     *            on which the flow is attached
      * @return the {@code Status} object indicating the result of this action
      */
     public Status toggleStaticFlowStatus(String name, Node node);
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -9,20 +8,22 @@
 
 package org.opendaylight.controller.forwardingrulesmanager;
 
-
 /**
- * The interface which describes the methods forwarding rules manager
- * will call for notifying the listeners of policy installation updates.
- *
+ * The interface which describes the methods forwarding rules manager will call
+ * for notifying the listeners of policy installation updates.
+ * 
  */
 public interface IForwardingRulesManagerAware {
 
-       /**
-        * Inform the listeners that a troubleshooting information was 
-        * added or removed for the specified policy.
-        * 
-        * @param policyName the policy affected
-        * @param add true if the troubleshooting information was added, false otherwise
-        */
+    /**
+     * Inform the listeners that a troubleshooting information was added or
+     * removed for the specified policy.
+     * 
+     * @param policyName
+     *            the policy affected
+     * @param add
+     *            true if the troubleshooting information was added, false
+     *            otherwise
+     */
     public void policyUpdate(String policyName, boolean add);
 }
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -13,13 +12,13 @@ import java.util.HashSet;
 import java.util.Set;
 
 /**
- * PortGroup is a simple data-structure to represent any arbitrary group of ports
- * on a Switch (that is represented using its switch-ID).
- *
- * PortGroup is used by PortGroupProvider application to signal a set of ports that
- * represent a configured PortGroupConfig.
- *
- *
+ * PortGroup is a simple data-structure to represent any arbitrary group of
+ * ports on a Switch (that is represented using its switch-ID).
+ * 
+ * PortGroup is used by PortGroupProvider application to signal a set of ports
+ * that represent a configured PortGroupConfig.
+ * 
+ * 
  */
 public class PortGroup {
     private long matrixSwitchId;
@@ -27,9 +26,11 @@ public class PortGroup {
 
     /**
      * PortGroup Constructor using Switch and Ports.
-     *
-     * @param matrixSwitchId Switch Id that represents an openflow Switch
-     * @param ports Set of short values representing openflow port-ids.
+     * 
+     * @param matrixSwitchId
+     *            Switch Id that represents an openflow Switch
+     * @param ports
+     *            Set of short values representing openflow port-ids.
      */
     public PortGroup(long matrixSwitchId, Set<Short> ports) {
         super();
@@ -39,8 +40,9 @@ public class PortGroup {
 
     /**
      * PortGroup Constructor using Switch.
-     *
-     * @param matrixSwitchId Switch-Id that represents an openflow Switch
+     * 
+     * @param matrixSwitchId
+     *            Switch-Id that represents an openflow Switch
      */
     public PortGroup(long matrixSwitchId) {
         this.matrixSwitchId = matrixSwitchId;
@@ -49,7 +51,7 @@ public class PortGroup {
 
     /**
      * Returns the switchId representing the Switch that makes this PortGroup.
-     *
+     * 
      * @return long switchId
      */
     public long getMatrixSwitchId() {
@@ -58,8 +60,9 @@ public class PortGroup {
 
     /**
      * Assigns a Switch to this PortGroup
-     *
-     * @param matrixSwitchId Switch-Id that represents an openflow Switch
+     * 
+     * @param matrixSwitchId
+     *            Switch-Id that represents an openflow Switch
      */
     public void setMatrixSwitchId(long matrixSwitchId) {
         this.matrixSwitchId = matrixSwitchId;
@@ -67,7 +70,7 @@ public class PortGroup {
 
     /**
      * Returns the Set of Ports that makes this PortGroup.
-     *
+     * 
      * @return Set of short values representing openflow port-ids.
      */
     public Set<Short> getPorts() {
@@ -76,8 +79,9 @@ public class PortGroup {
 
     /**
      * Assigns a set of openflow ports to this PortGroup
-     *
-     * @param ports Set of short values representing openflow port-ids.
+     * 
+     * @param ports
+     *            Set of short values representing openflow port-ids.
      */
     public void setPorts(Set<Short> ports) {
         this.ports = ports;
@@ -85,8 +89,9 @@ public class PortGroup {
 
     /**
      * Adds a port to this PortGroup
-     *
-     * @param port Short value of a openflow port.
+     * 
+     * @param port
+     *            Short value of a openflow port.
      */
     public void addPort(short port) {
         ports.add(port);
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -14,18 +13,24 @@ import java.util.Map;
 import org.opendaylight.controller.sal.core.Node;
 
 /**
- * PortGroupChangeListener listens to the PortGroup updates provided by the PortGroupProvider.
- *
- *
+ * PortGroupChangeListener listens to the PortGroup updates provided by the
+ * PortGroupProvider.
+ * 
+ * 
  */
 public interface PortGroupChangeListener {
     /**
-     * This method is invoked by PortGroupProvider whenever it detects a change in PortGroup
-     * membership for a given PortGroupConfig.
-     *
-     * @param config Port Group Configuration
-     * @param portGroupData HashMap of Node id to PortGroup that represents the updated ports as detected by PortGroupProvider.
-     * @param add true indicates that the PortGroup is added. False indicates that the PortGroup is removed.
+     * This method is invoked by PortGroupProvider whenever it detects a change
+     * in PortGroup membership for a given PortGroupConfig.
+     * 
+     * @param config
+     *            Port Group Configuration
+     * @param portGroupData
+     *            HashMap of Node id to PortGroup that represents the updated
+     *            ports as detected by PortGroupProvider.
+     * @param add
+     *            true indicates that the PortGroup is added. False indicates
+     *            that the PortGroup is removed.
      */
     void portGroupChanged(PortGroupConfig config,
             Map<Node, PortGroup> portGroupData, boolean add);
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -15,14 +14,14 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * PortGroupConfig class represents the User's Configuration with a Opaque Regular Expression
- * String that is parsed and handled by PortGroupProvider.
- *
- * Typically, the opaque matchString will be a Regular Expression String supported by a particular
- * PortGroupProvider based on Customer requirements.
- *
- *
- *
+ * PortGroupConfig class represents the User's Configuration with a Opaque
+ * Regular Expression String that is parsed and handled by PortGroupProvider.
+ * 
+ * Typically, the opaque matchString will be a Regular Expression String
+ * supported by a particular PortGroupProvider based on Customer requirements.
+ * 
+ * 
+ * 
  */
 public class PortGroupConfig implements Serializable {
     private static final long serialVersionUID = 1L;
@@ -40,11 +39,13 @@ public class PortGroupConfig implements Serializable {
     }
 
     /**
-     * Constructor to create a Port Group Configuration using a Group Name and an Opaque
-     * String that is managed by PortGroupProvider.
-     *
-     * @param name Group Name representing a Port Group configuration
-     * @param matchString An Opaque String managed by PortGroupProvider
+     * Constructor to create a Port Group Configuration using a Group Name and
+     * an Opaque String that is managed by PortGroupProvider.
+     * 
+     * @param name
+     *            Group Name representing a Port Group configuration
+     * @param matchString
+     *            An Opaque String managed by PortGroupProvider
      */
     public PortGroupConfig(String name, String matchString) {
         super();
@@ -54,7 +55,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Returns the user configured PortGroup Configuration name.
-     *
+     * 
      * @return Configuration Name
      */
     public String getName() {
@@ -63,7 +64,9 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Assigns a name to the configuration
-     * @param name configuration name
+     * 
+     * @param name
+     *            configuration name
      */
     public void setName(String name) {
         this.name = name;
@@ -71,6 +74,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Returns the Opaque string
+     * 
      * @return
      */
     public String getMatchString() {
@@ -79,17 +83,18 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Assigns an opaque String to the Configuration.
-     *
-     * @param matchString Opaque string handled by PortGroupProvider
+     * 
+     * @param matchString
+     *            Opaque string handled by PortGroupProvider
      */
     public void setMatchString(String matchString) {
         this.matchString = matchString;
     }
 
     /**
-     * Returns the names of all the configurable fields in PortGroupConfig.
-     * This method is typically used by NorthBound apis.
-     *
+     * Returns the names of all the configurable fields in PortGroupConfig. This
+     * method is typically used by NorthBound apis.
+     * 
      * @return List of Field names that can be configured.
      */
     public static List<String> getFieldsNames() {
@@ -97,7 +102,7 @@ public class PortGroupConfig implements Serializable {
         for (Field fld : PortGroupConfig.class.getDeclaredFields()) {
             fieldList.add(fld.getName());
         }
-        //remove static field(s)
+        // remove static field(s)
         fieldList.remove(0);
         fieldList.remove(0);
 
@@ -105,10 +110,12 @@ public class PortGroupConfig implements Serializable {
     }
 
     /**
-     * Returns the names of all the configurable fields in PortGroupConfig in human readable format for UI purposes.
-     * This method is typically used by Web/UI apis.
-     *
-     * @return List of Human readable Strings that corresponds to the configurable field names.
+     * Returns the names of all the configurable fields in PortGroupConfig in
+     * human readable format for UI purposes. This method is typically used by
+     * Web/UI apis.
+     * 
+     * @return List of Human readable Strings that corresponds to the
+     *         configurable field names.
      */
     public static List<String> getPrettyFieldsNames() {
         List<String> fieldList = new ArrayList<String>();
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -14,48 +13,59 @@ import java.util.Map;
 import org.opendaylight.controller.sal.core.Node;
 
 /**
- * PortGroupProvider interface provides all the necessary blueprint for a custom application to implement
- * in order to provide Port Grouping Service. Custom Application that implements this interface will have
- * to handle the opaque match criteria passed to it via PortGroupConfig.
- *
- *
- *
+ * PortGroupProvider interface provides all the necessary blueprint for a custom
+ * application to implement in order to provide Port Grouping Service. Custom
+ * Application that implements this interface will have to handle the opaque
+ * match criteria passed to it via PortGroupConfig.
+ * 
+ * 
+ * 
  */
 public interface PortGroupProvider {
     /**
-     * This method is invoked by the Controller towards the Provider when a new port group is configured.
-     *
-     * @param config New PortGroupConfig object created by user Configuration.
+     * This method is invoked by the Controller towards the Provider when a new
+     * port group is configured.
+     * 
+     * @param config
+     *            New PortGroupConfig object created by user Configuration.
      * @return true if successful. false otherwise.
      */
     public boolean createPortGroupConfig(PortGroupConfig config);
 
     /**
-     * This method is invoked by the Controller towards the Provider when an existing port group is deleted.
-     *
-     * @param config Existing Port Group Configuration deleted by the user.
+     * This method is invoked by the Controller towards the Provider when an
+     * existing port group is deleted.
+     * 
+     * @param config
+     *            Existing Port Group Configuration deleted by the user.
      * @return true if successful. false otherwise.
      */
     public boolean deletePortGroupConfig(PortGroupConfig config);
 
     /**
-     * Returns the complete mapping database corresponds to a PortGroup Configuration.
-     * Its the PortGroupProvider Application's responsibility to manage the Switches & the Set of its Ports that
-     * correspond to each of the Configuration and return it to the Controller when requested.
-     *
-     * @param config User Configuration
+     * Returns the complete mapping database corresponds to a PortGroup
+     * Configuration. Its the PortGroupProvider Application's responsibility to
+     * manage the Switches & the Set of its Ports that correspond to each of the
+     * Configuration and return it to the Controller when requested.
+     * 
+     * @param config
+     *            User Configuration
      * @see PortGroupConfig
-     * @return Database of Switch-Id to PortGroup mapping that corresponds to the Port Group User Configuration.
+     * @return Database of Switch-Id to PortGroup mapping that corresponds to
+     *         the Port Group User Configuration.
      */
     public Map<Node, PortGroup> getPortGroupData(PortGroupConfig config);
 
     /**
-     * Returns PortGroup data for a given Switch and user Configuration.
-     * Its the PortGroupProvider Application's responsibility to manage the Switches & the Set of its Ports that
-     * correspond to each of the Configuration and return it to the Controller when requested.
-     *
-     * @param config User Configuration
-     * @param matrixSwitchId Switch Id that represents an openflow Switch
+     * Returns PortGroup data for a given Switch and user Configuration. Its the
+     * PortGroupProvider Application's responsibility to manage the Switches &
+     * the Set of its Ports that correspond to each of the Configuration and
+     * return it to the Controller when requested.
+     * 
+     * @param config
+     *            User Configuration
+     * @param matrixSwitchId
+     *            Switch Id that represents an openflow Switch
      * @see PortGroupConfig
      * @return PortGroup data for a given Openflow switch.
      * @see PortGroup
@@ -64,33 +74,41 @@ public interface PortGroupProvider {
             long matrixSwitchId);
 
     /**
-     * Registers a Listener for Port Group membership changes based on Custom application algorithm.
-     * @param listener A Controller module that listens to events from the Custom Port Grouping Application.
+     * Registers a Listener for Port Group membership changes based on Custom
+     * application algorithm.
+     * 
+     * @param listener
+     *            A Controller module that listens to events from the Custom
+     *            Port Grouping Application.
      */
     public void registerPortGroupChange(PortGroupChangeListener listener);
 
     /**
-     * Application returns an Usage string for the Match Criteria User Configuration.
-     * Controller provides an opportunity for application to implement Custom Algorithm for Port Grouping.
-     * This method exposes the custom algorithm to the user so that the user can configure the matchString
-     * regular expression in PortGroupConfig appropriately.
-     *
+     * Application returns an Usage string for the Match Criteria User
+     * Configuration. Controller provides an opportunity for application to
+     * implement Custom Algorithm for Port Grouping. This method exposes the
+     * custom algorithm to the user so that the user can configure the
+     * matchString regular expression in PortGroupConfig appropriately.
+     * 
      * @return Usage string.
      */
     public String getApplicationDrivenMatchCriteriaUsage();
 
     /**
-     * Returns the name of the Custom Application that implements  PortGroupProvider interface.
-     *
+     * Returns the name of the Custom Application that implements
+     * PortGroupProvider interface.
+     * 
      * @return Provider Name
      */
     public String getProviderName();
 
     /**
-     * Controller uses this method to check with the Provider supports the matchCriteria String configured by the User.
-     *
+     * Controller uses this method to check with the Provider supports the
+     * matchCriteria String configured by the User.
+     * 
      * @param matchCriteria
-     * @return true if the Provider supports the matchCriteria String. false otherwise.
+     * @return true if the Provider supports the matchCriteria String. false
+     *         otherwise.
      */
     public boolean isMatchCriteriaSupported(String matchCriteria);
 }
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -41,33 +40,35 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 
 public class frmTest {
 
-       @Test
-       public void testFlowEntryInstall() throws UnknownHostException{
-                Node node = NodeCreator.createOFNode(1L);
-            FlowEntry pol = new FlowEntry("polTest", null, getSampleFlowV6(node),
-                       node);
-            FlowEntry pol2 = new FlowEntry("polTest2", null, getSampleFlowV6(node),
-                       node);
-            FlowEntryInstall fei = new FlowEntryInstall(pol, null);
-            FlowEntryInstall fei2 = new FlowEntryInstall(pol, null);
-            FlowEntryInstall fei3 = new FlowEntryInstall(pol2, null);
-            Assert.assertTrue(fei.getOriginal().equals(pol));
-            Assert.assertTrue(fei.getInstall().equals(pol));
-            Assert.assertTrue(fei.getFlowName().equals(pol.getFlowName()));
-            Assert.assertTrue(fei.getGroupName().equals(pol.getGroupName()));
-            Assert.assertTrue(fei.getNode().equals(pol.getNode()));
-            Assert.assertFalse(fei.isDeletePending());
-            fei.toBeDeleted();
-            Assert.assertTrue(fei.isDeletePending());
-            Assert.assertNull(fei.getContainerFlow());
-            Assert.assertTrue(fei.equalsByNodeAndName(pol.getNode(), pol.getFlowName()));
-            
-            Assert.assertTrue(fei.equals(fei2));
-            fei2.getOriginal().setFlowName("polTest2");
-            Assert.assertFalse(fei.equals(null));
-            Assert.assertFalse(fei.equals(fei3));
-         
-       }
+    @Test
+    public void testFlowEntryInstall() throws UnknownHostException {
+        Node node = NodeCreator.createOFNode(1L);
+        FlowEntry pol = new FlowEntry("polTest", null, getSampleFlowV6(node),
+                node);
+        FlowEntry pol2 = new FlowEntry("polTest2", null, getSampleFlowV6(node),
+                node);
+        FlowEntryInstall fei = new FlowEntryInstall(pol, null);
+        FlowEntryInstall fei2 = new FlowEntryInstall(pol, null);
+        FlowEntryInstall fei3 = new FlowEntryInstall(pol2, null);
+        Assert.assertTrue(fei.getOriginal().equals(pol));
+        Assert.assertTrue(fei.getInstall().equals(pol));
+        Assert.assertTrue(fei.getFlowName().equals(pol.getFlowName()));
+        Assert.assertTrue(fei.getGroupName().equals(pol.getGroupName()));
+        Assert.assertTrue(fei.getNode().equals(pol.getNode()));
+        Assert.assertFalse(fei.isDeletePending());
+        fei.toBeDeleted();
+        Assert.assertTrue(fei.isDeletePending());
+        Assert.assertNull(fei.getContainerFlow());
+        Assert.assertTrue(fei.equalsByNodeAndName(pol.getNode(),
+                pol.getFlowName()));
+
+        Assert.assertTrue(fei.equals(fei2));
+        fei2.getOriginal().setFlowName("polTest2");
+        Assert.assertFalse(fei.equals(null));
+        Assert.assertFalse(fei.equals(fei3));
+
+    }
+
     @Test
     public void testFlowEntryCreation() throws UnknownHostException {
         Node node = NodeCreator.createOFNode(1L);
@@ -102,7 +103,6 @@ public class frmTest {
         Assert.assertTrue(pol.equals(pol2));
     }
 
-
     @Test
     public void testFlowEntryCloning() throws UnknownHostException {
         Node node = NodeCreator.createOFNode(1L);
@@ -126,7 +126,7 @@ public class frmTest {
         match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
 
         List<Action> actionList = new ArrayList<Action>();
-        //actionList.add(new Drop());
+        // actionList.add(new Drop());
 
         Flow flow = new Flow(match, actionList);
         FlowEntry pol1 = new FlowEntry("m1", "same", flow, node1);
@@ -165,21 +165,21 @@ public class frmTest {
         FlowEntry entry = new FlowEntry("polTest", null, getSampleFlowV6(node),
                 node);
 
-        //testing equal function
+        // testing equal function
         Assert.assertFalse(frmC.equals(null));
         Assert.assertTrue(frmC.equals(frmC));
         Assert.assertTrue(frmC.equals(frmC3));
         Assert.assertFalse(frmC.equals(entry));
         FlowConfig flowC = createSampleFlowConfig();
         Assert.assertFalse(frmC.equals(flowC));
-        //testing installInHW
+        // testing installInHW
         Assert.assertTrue(frmC.installInHw());
         frmC.setInstallInHw(false);
         Assert.assertFalse(frmC.installInHw());
         frmC.setInstallInHw(true);
         Assert.assertTrue(frmC.installInHw());
 
-        //testing general set and get methods
+        // testing general set and get methods
         ArrayList<String> actions = createSampleActionList();
         frmC.setActions(actions);
         Assert.assertFalse(frmC.equals(frmC3));
@@ -256,20 +256,16 @@ public class frmTest {
 
         Assert.assertFalse(frmC.equals(flowC));
         frmC.setProtocol(IPProtocols.TCP.toString());
-        Assert.assertTrue(frmC.getProtocol().equals(
-                              IPProtocols.TCP.toString()));
+        Assert.assertTrue(frmC.getProtocol().equals(IPProtocols.TCP.toString()));
         Assert.assertFalse(frmC.equals(frmC3));
         frmC3.setProtocol(IPProtocols.TCP.toString());
 
         Assert.assertFalse(frmC.equals(flowC));
-        frmC.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                     "1"));
-        Assert.assertTrue(frmC.getNode()
-                          .equals(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                                  "1")));
+        frmC.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
+        Assert.assertTrue(frmC.getNode().equals(
+                Node.fromString(Node.NodeIDType.OPENFLOW, "1")));
         Assert.assertFalse(frmC.equals(frmC3));
-        frmC3.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                      "1"));
+        frmC3.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
 
         Assert.assertFalse(frmC.equals(flowC));
         frmC.setTosBits("0");
@@ -313,7 +309,7 @@ public class frmTest {
         Assert.assertFalse(frmC.equals(frmC3));
         frmC3.setHardTimeout("1000");
 
-        //     Assert.assertFalse(frmC.equals(flowC));
+        // Assert.assertFalse(frmC.equals(flowC));
         Assert.assertTrue(actions.equals(frmC.getActions()));
 
         FlowConfig frmC2 = new FlowConfig(frmC);
@@ -323,7 +319,7 @@ public class frmTest {
         Assert.assertFalse(frmC2.equals(frmC));
         frmC2.setDynamic(true);
         Assert.assertTrue(frmC2.equals(frmC));
-        //Assert.assertFalse(frmC2.equals(frmC3));
+        // Assert.assertFalse(frmC2.equals(frmC3));
         flowC.setDynamic(true);
         Assert.assertTrue(flowC.equals(frmC));
         Assert.assertTrue(flowC.isStatusSuccessful());
@@ -342,65 +338,61 @@ public class frmTest {
         Assert.assertTrue(id.toString().equals("1"));
 
     }
-    
+
     @Test
-    public void testFlowConfigNextHopValidity() throws UnknownHostException{
-       FlowConfig fc = new FlowConfig();
-       Assert.assertFalse(fc.isOutputNextHopValid(null));
-       Assert.assertFalse(fc.isOutputNextHopValid("abc"));
-       Assert.assertFalse(fc.isOutputNextHopValid("1.1.1"));
-       Assert.assertFalse(fc.isOutputNextHopValid("1.1.1.1/49"));
-       
-       Assert.assertTrue(fc.isOutputNextHopValid("1.1.1.1"));
-       Assert.assertTrue(fc.isOutputNextHopValid("1.1.1.1/32"));
-       Assert.assertTrue(fc.isOutputNextHopValid("2001:420:281:1004:407a:57f4:4d15:c355"));
-       
+    public void testFlowConfigNextHopValidity() throws UnknownHostException {
+        FlowConfig fc = new FlowConfig();
+        Assert.assertFalse(fc.isOutputNextHopValid(null));
+        Assert.assertFalse(fc.isOutputNextHopValid("abc"));
+        Assert.assertFalse(fc.isOutputNextHopValid("1.1.1"));
+        Assert.assertFalse(fc.isOutputNextHopValid("1.1.1.1/49"));
+
+        Assert.assertTrue(fc.isOutputNextHopValid("1.1.1.1"));
+        Assert.assertTrue(fc.isOutputNextHopValid("1.1.1.1/32"));
+        Assert.assertTrue(fc
+                .isOutputNextHopValid("2001:420:281:1004:407a:57f4:4d15:c355"));
+
     }
-    
+
     @Test
-    public void testFlowConfigEqualities() throws UnknownHostException{
-       FlowConfig fc = new FlowConfig();
-       FlowConfig fc2 = new FlowConfig();
-       fc.setName("flow1");
-       fc.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                   "1"));
-       Assert.assertFalse(fc.onNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                                     "0")));
-       Assert.assertTrue(fc.onNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                                    "1")));
-       
-       Assert.assertTrue(fc.isByNameAndNodeIdEqual(
-                              "flow1",
-                              Node.fromString(Node.NodeIDType.OPENFLOW, "1")));
-       Assert.assertFalse(fc.isByNameAndNodeIdEqual(
-                               "flow1",
-                               Node.fromString(Node.NodeIDType.OPENFLOW, "0")));
-       Assert.assertFalse(fc.isByNameAndNodeIdEqual(
-                               "flow2",
-                               Node.fromString(Node.NodeIDType.OPENFLOW, "1")));
-       
-       Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
-       fc2.setName("flow1");
-       Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
-       fc2.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                     "0"));
-       Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
-       fc2.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                    "1"));
-       Assert.assertTrue(fc.isByNameAndNodeIdEqual(fc2));
+    public void testFlowConfigEqualities() throws UnknownHostException {
+        FlowConfig fc = new FlowConfig();
+        FlowConfig fc2 = new FlowConfig();
+        fc.setName("flow1");
+        fc.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
+        Assert.assertFalse(fc.onNode(Node.fromString(Node.NodeIDType.OPENFLOW,
+                "0")));
+        Assert.assertTrue(fc.onNode(Node.fromString(Node.NodeIDType.OPENFLOW,
+                "1")));
+
+        Assert.assertTrue(fc.isByNameAndNodeIdEqual("flow1",
+                Node.fromString(Node.NodeIDType.OPENFLOW, "1")));
+        Assert.assertFalse(fc.isByNameAndNodeIdEqual("flow1",
+                Node.fromString(Node.NodeIDType.OPENFLOW, "0")));
+        Assert.assertFalse(fc.isByNameAndNodeIdEqual("flow2",
+                Node.fromString(Node.NodeIDType.OPENFLOW, "1")));
+
+        Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
+        fc2.setName("flow1");
+        Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
+        fc2.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "0"));
+        Assert.assertFalse(fc.isByNameAndNodeIdEqual(fc2));
+        fc2.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
+        Assert.assertTrue(fc.isByNameAndNodeIdEqual(fc2));
     }
-    
+
     @Test
-    public void testStatusToggle() throws UnknownHostException{
-       FlowConfig fc = new FlowConfig();
-       fc.toggleStatus();
-       Assert.assertTrue(fc.installInHw());
-       fc.toggleStatus();
-       Assert.assertFalse(fc.installInHw());
-       fc.toggleStatus();
-       Assert.assertTrue(fc.installInHw());
-       
+    public void testStatusToggle() throws UnknownHostException {
+        FlowConfig fc = new FlowConfig();
+        fc.toggleStatus();
+        Assert.assertTrue(fc.installInHw());
+        fc.toggleStatus();
+        Assert.assertFalse(fc.installInHw());
+        fc.toggleStatus();
+        Assert.assertTrue(fc.installInHw());
+
     }
+
     @Test
     public void testGetFlowEntry() throws UnknownHostException {
         FlowConfig fc2 = createSampleFlowConfig();
@@ -442,8 +434,7 @@ public class frmTest {
         Assert.assertFalse(fc.isValid(null, sb));
         Assert.assertTrue(sb.toString().contains("Node is null"));
 
-        fc.setNode(Node.fromString(Node.NodeIDType.OPENFLOW,
-                                   "1"));
+        fc.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
         Assert.assertTrue(fc.isValid(null, sb));
 
         fc.setPriority("-1");
@@ -463,9 +454,7 @@ public class frmTest {
         fc.setCookie("100");
         fc.setIngressPort("-1");
         Assert.assertFalse(fc.isValid(null, sb));
-        Assert
-                .assertTrue(sb.toString().contains(
-                        "is not valid for the Switch"));
+        Assert.assertTrue(sb.toString().contains("is not valid for the Switch"));
         fc.setIngressPort("100");
         Assert.assertTrue(fc.isValid(null, sb));
 
@@ -613,15 +602,12 @@ public class frmTest {
     private FlowConfig createSampleFlowConfig() throws UnknownHostException {
         ArrayList<String> actions;
         actions = createSampleActionList();
-        //actions.add(ActionType.CONTROLLER.toString());
-        FlowConfig flowConfig =
-            new FlowConfig("true", "Config1", 
-                           Node.fromString(Node.NodeIDType.OPENFLOW,
-                                           "1"), "100", "0", "60", "2", "100",
-                           "0", "0x0800", "00:A0:C9:14:C8:29",
-                           "00:A0:C9:22:AB:11", IPProtocols.TCP.toString(), "0",
-                           "1.2.3.4", "2.2.2.2", "8080", "100", "300", "1000",
-                           actions);
+        // actions.add(ActionType.CONTROLLER.toString());
+        FlowConfig flowConfig = new FlowConfig("true", "Config1",
+                Node.fromString(Node.NodeIDType.OPENFLOW, "1"), "100", "0",
+                "60", "2", "100", "0", "0x0800", "00:A0:C9:14:C8:29",
+                "00:A0:C9:22:AB:11", IPProtocols.TCP.toString(), "0",
+                "1.2.3.4", "2.2.2.2", "8080", "100", "300", "1000", actions);
         return flowConfig;
 
     }
@@ -633,19 +619,19 @@ public class frmTest {
         actions.add(ActionType.FLOOD.toString());
         actions.add(ActionType.SW_PATH.toString());
         actions.add(ActionType.HW_PATH.toString());
-        actions.add(ActionType.SET_VLAN_PCP.toString()+"=1");
-        actions.add(ActionType.SET_VLAN_ID.toString()+"=1");
+        actions.add(ActionType.SET_VLAN_PCP.toString() + "=1");
+        actions.add(ActionType.SET_VLAN_ID.toString() + "=1");
         actions.add(ActionType.POP_VLAN.toString());
-        actions.add(ActionType.SET_DL_SRC.toString()+"=00:A0:C1:AB:22:11");
-        actions.add(ActionType.SET_DL_DST.toString()+"=00:B1:C1:00:AA:BB");
-        actions.add(ActionType.SET_NW_SRC.toString()+"=1.1.1.1");
-        actions.add(ActionType.SET_NW_DST.toString()+"=2.2.2.2");
+        actions.add(ActionType.SET_DL_SRC.toString() + "=00:A0:C1:AB:22:11");
+        actions.add(ActionType.SET_DL_DST.toString() + "=00:B1:C1:00:AA:BB");
+        actions.add(ActionType.SET_NW_SRC.toString() + "=1.1.1.1");
+        actions.add(ActionType.SET_NW_DST.toString() + "=2.2.2.2");
         actions.add(ActionType.CONTROLLER.toString());
-        actions.add(ActionType.SET_NW_TOS.toString()+"1");
-        actions.add(ActionType.SET_TP_SRC.toString()+"60");
-        actions.add(ActionType.SET_TP_DST.toString()+"8080");
-        actions.add(ActionType.SET_NEXT_HOP.toString()+"=1.1.1.1");
-        
+        actions.add(ActionType.SET_NW_TOS.toString() + "1");
+        actions.add(ActionType.SET_TP_SRC.toString() + "60");
+        actions.add(ActionType.SET_TP_DST.toString() + "8080");
+        actions.add(ActionType.SET_NEXT_HOP.toString() + "=1.1.1.1");
+
         return actions;
     }
 
diff --git a/opendaylight/forwardingrulesmanager/implementation/pom.xml b/opendaylight/forwardingrulesmanager/implementation/pom.xml
new file mode 100644 (file)
index 0000000..2c0bc93
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.controller</groupId>
+  <artifactId>forwardingrulesmanager.implementation</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+       <groupId>org.apache.felix</groupId>
+       <artifactId>maven-bundle-plugin</artifactId>
+       <version>2.3.6</version>
+       <extensions>true</extensions>
+       <configuration>
+         <instructions>
+           <Include-Resource>
+           </Include-Resource>
+           <Export-Package>
+           </Export-Package>
+           <Import-Package>
+                     org.opendaylight.controller.clustering.services,
+                     org.opendaylight.controller.configuration,
+              org.opendaylight.controller.hosttracker,
+              org.opendaylight.controller.hosttracker.hostAware,
+              org.opendaylight.controller.switchmanager,
+              org.opendaylight.controller.sal.action,
+              org.opendaylight.controller.sal.core,
+              org.opendaylight.controller.sal.flowprogrammer,
+              org.opendaylight.controller.sal.match,
+                         org.opendaylight.controller.sal.utils,
+              org.opendaylight.controller.sal.packet,
+                         org.opendaylight.controller.forwardingrulesmanager,
+              javax.xml.bind.annotation,
+              javax.xml.bind,
+              org.apache.felix.dm,
+              org.apache.commons.lang3.builder,
+              org.osgi.service.component,
+              org.slf4j,
+              org.eclipse.osgi.framework.console,
+                         org.osgi.framework
+           </Import-Package>
+        <Bundle-Activator>
+             org.opendaylight.controller.forwardingrulesmanager.internal.Activator
+               </Bundle-Activator>
+            <Require-Bundle>
+              org.opendaylight.controller.hosttracker
+            </Require-Bundle>
+            <Service-Component>
+            </Service-Component>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>    
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+       <dependency>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>sal</artifactId>
+               <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+       <dependency>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>forwardingrulesmanager</artifactId>
+               <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -39,32 +38,31 @@ public class Activator extends ComponentActivatorAbstractBase {
             .getLogger(Activator.class);
 
     /**
-     * Function called when the activator starts just after some
-     * initializations are done by the
-     * ComponentActivatorAbstractBase.
-     *
+     * Function called when the activator starts just after some initializations
+     * are done by the ComponentActivatorAbstractBase.
+     * 
      */
     public void init() {
 
     }
 
     /**
-     * Function called when the activator stops just before the
-     * cleanup done by ComponentActivatorAbstractBase
-     *
+     * Function called when the activator stops just before the cleanup done by
+     * ComponentActivatorAbstractBase
+     * 
      */
     public void destroy() {
 
     }
 
     /**
-     * Function that is used to communicate to dependency manager the
-     * list of known implementations for services inside a container
-     *
-     *
+     * Function that is used to communicate to dependency manager the list of
+     * known implementations for services inside a container
+     * 
+     * 
      * @return An array containing all the CLASS objects that will be
-     * instantiated in order to get an fully working implementation
-     * Object
+     *         instantiated in order to get an fully working implementation
+     *         Object
      */
     public Object[] getImplementations() {
         Object[] res = { ForwardingRulesManagerImpl.class };
@@ -72,17 +70,19 @@ public class Activator extends ComponentActivatorAbstractBase {
     }
 
     /**
-     * Function that is called when configuration of the dependencies
-     * is required.
-     *
-     * @param c dependency manager Component object, used for
-     * configuring the dependencies exported and imported
-     * @param imp Implementation class that is being configured,
-     * needed as long as the same routine can configure multiple
-     * implementations
-     * @param containerName The containerName being configured, this allow
-     * also optional per-container different behavior if needed, usually
-     * should not be the case though.
+     * Function that is called when configuration of the dependencies is
+     * required.
+     * 
+     * @param c
+     *            dependency manager Component object, used for configuring the
+     *            dependencies exported and imported
+     * @param imp
+     *            Implementation class that is being configured, needed as long
+     *            as the same routine can configure multiple implementations
+     * @param containerName
+     *            The containerName being configured, this allow also optional
+     *            per-container different behavior if needed, usually should not
+     *            be the case though.
      */
     public void configureInstance(Component c, Object imp, String containerName) {
         if (imp.equals(ForwardingRulesManagerImpl.class)) {
@@ -100,7 +100,7 @@ public class Activator extends ComponentActivatorAbstractBase {
                         IInventoryListener.class.getName(),
                         ICacheUpdateAware.class.getName(),
                         IConfigurationContainerAware.class.getName(),
-                        IFlowProgrammerListener.class.getName()};
+                        IFlowProgrammerListener.class.getName() };
             } else {
                 interfaces = new String[] {
                         ISwitchManagerAware.class.getName(),
@@ -108,32 +108,36 @@ public class Activator extends ComponentActivatorAbstractBase {
                         IInventoryListener.class.getName(),
                         ICacheUpdateAware.class.getName(),
                         IConfigurationContainerAware.class.getName(),
-                        IFlowProgrammerListener.class.getName()};
+                        IFlowProgrammerListener.class.getName() };
             }
 
             c.setInterface(interfaces, props);
 
-            c.add(createContainerServiceDependency(containerName).setService(
-                    IFlowProgrammerService.class).setCallbacks(
-                    "setFlowProgrammerService", "unsetFlowProgrammerService")
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(IFlowProgrammerService.class)
+                    .setCallbacks("setFlowProgrammerService",
+                            "unsetFlowProgrammerService").setRequired(true));
+
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(IClusterContainerServices.class)
+                    .setCallbacks("setClusterContainerService",
+                            "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(ISwitchManager.class)
+                    .setCallbacks("setSwitchManager", "unsetSwitchManager")
+                    .setRequired(true));
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(IForwardingRulesManagerAware.class)
+                    .setCallbacks("setFrmAware", "unsetFrmAware")
+                    .setRequired(false));
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(IfIptoHost.class)
+                    .setCallbacks("setHostFinder", "unsetHostFinder")
+                    .setRequired(true));
+            c.add(createContainerServiceDependency(containerName)
+                    .setService(IContainer.class)
+                    .setCallbacks("setIContainer", "unsetIContainer")
                     .setRequired(true));
-
-            c.add(createContainerServiceDependency(containerName).setService(
-                    IClusterContainerServices.class).setCallbacks(
-                    "setClusterContainerService",
-                    "unsetClusterContainerService").setRequired(true));
-            c.add(createContainerServiceDependency(containerName).setService(
-                    ISwitchManager.class).setCallbacks("setSwitchManager",
-                    "unsetSwitchManager").setRequired(true));
-            c.add(createContainerServiceDependency(containerName).setService(
-                    IForwardingRulesManagerAware.class).setCallbacks(
-                    "setFrmAware", "unsetFrmAware").setRequired(false));
-            c.add(createContainerServiceDependency(containerName).setService(
-                    IfIptoHost.class).setCallbacks("setHostFinder",
-                    "unsetHostFinder").setRequired(true));
-            c.add(createContainerServiceDependency(containerName).setService(
-                    IContainer.class).setCallbacks("setIContainer",
-                    "unsetIContainer").setRequired(true));
         }
     }
 }
index 96b6c05..45f3ced 100644 (file)
@@ -639,7 +639,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
             if (switchNeedsTieringUpdate(dstNode, currentTier + 1)) {
                 Tier t = new Tier(currentTier + 1);
                 switchManager.setNodeProp(dstNode, t);
-                //logger.info("Updating Switch Tier "+ (currentTier+1) +" for "+String.format("%x", dstSw.getId()));
                 needsVisiting.add(dstNode);
             }
         }
@@ -684,7 +683,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
             return true;
         else if (t.getValue() > tier)
             return true;
-        //logger.info(getContainerName()+" -> "+ "Switch "+String.format("%x", sw.getId())+ " is in better Tier "+sw.getTier()+" ... skipping "+tier);
         return false;
     }
 
@@ -956,6 +954,7 @@ public class HostTracker implements IfIptoHost, IfHostListener,
     }
 
     private class ARPRefreshHandler extends TimerTask {
+        @SuppressWarnings("deprecation")
         public void run() {
             if ((clusterContainerService != null)
                     && !clusterContainerService.amICoordinator()) {
@@ -992,8 +991,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
                     notifyHostLearnedOrRemoved(host, false);
                 } else if (arp_cntdown <= switchManager.getHostRetryCount()) {
                     /* Use the services of arphandler to check if host is still there */
-                    // logger.info("Probe for Host:{}", host);
-                    //logger.info("ARP Probing ("+arp_cntdown+") for "+host.toString());
                     logger.trace("ARP Probing ({}) for {}({})", new Object[] {
                             arp_cntdown,
                             host.getNetworkAddress().getHostAddress(),
index 75c5ca9..d455a0a 100644 (file)
@@ -44,7 +44,7 @@ public class Activator implements BundleActivator {
                         .getService(service);
                 if (reader == null) {
                     this.log.error("Cannot register the LogListener because "
-                            + "cannot retrive LogReaderService");
+                            + "cannot retrieve LogReaderService");
                 }
                 reader.addLogListener(this.listener);
                 // Now lets walk all the exiting messages
@@ -66,7 +66,7 @@ public class Activator implements BundleActivator {
                         controller.logging.bridge.internal.UncaughtExceptionHandler());
             } else {
                 this.log.error("Cannot register the LogListener because "
-                        + "cannot retrive LogReaderService");
+                        + "cannot retrieve LogReaderService");
             }
         } else {
             System.err
index 29e9dfa..f37d013 100644 (file)
@@ -46,6 +46,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         this.containerName = containerName;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName) {
         this.m_dep.setService(serviceName, "(containerName="
@@ -53,6 +54,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName, String serviceFilter) {
         this.m_dep.setService(serviceName, "(&(containerName="
@@ -67,6 +69,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this;
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public ServiceDependency setService(Class serviceName,
             ServiceReference serviceReference) {
@@ -163,6 +166,7 @@ public class ContainerServiceDependency implements ServiceDependency,
                 .createCopy(), this.containerName);
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public Dictionary getProperties() {
         return this.m_dep.getProperties();
@@ -193,6 +197,7 @@ public class ContainerServiceDependency implements ServiceDependency,
         return this.m_dep.isAutoConfig();
     }
 
+    @SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
     @Override
     public Class getAutoConfigType() {
         return this.m_dep.getAutoConfigType();
index 206b392..5c21294 100644 (file)
@@ -53,8 +53,8 @@ public class Node implements Serializable {
      * surround.
      */
     public static final class NodeIDType {
-        private static final ConcurrentHashMap<String, Class> compatibleType =
-            new ConcurrentHashMap<String, Class>();
+        private static final ConcurrentHashMap<String, Class<? extends Object>> compatibleType =
+            new ConcurrentHashMap<String, Class<? extends Object>>();
         /**
          * Identifier for an OpenFlow node
          */
@@ -113,7 +113,7 @@ public class Node implements Serializable {
          * @return true if registered, false otherwise
          */
         public static boolean registerIDType(String type,
-                                             Class compatibleID) {
+                                             Class<? extends Object> compatibleID) {
             if (compatibleType.get(type) != null) {
                 return false;
             }  else {
index 86baaad..59a184e 100644 (file)
@@ -50,8 +50,8 @@ public class NodeConnector implements Serializable {
      */
     public static class NodeConnectorIDType {
         private static final
-        ConcurrentHashMap<String, ImmutablePair<Class, String>> compatibleType =
-            new ConcurrentHashMap<String, ImmutablePair<Class, String>>();
+        ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>> compatibleType =
+            new ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>>();
         /**
          * Represent a special port pointing toward the controller,
          * this is to send data packets toward the controller from
@@ -175,7 +175,7 @@ public class NodeConnector implements Serializable {
          * @return true if registered, false otherwise
          */
         public static boolean registerIDType(String type,
-                                             Class compatibleID,
+                                             Class<? extends Object> compatibleID,
                                              String compatibleNode) {
             if (compatibleType.get(type) != null) {
                 return false;
index 0555860..ef9f2f4 100644 (file)
@@ -82,7 +82,8 @@ public class ServiceHelper {
             }
             return true;
         } catch (Exception e) {
-            logger.error("Exception "+e.getMessage() +" while registering the service "+instance.toString());
+            logger.error("Exception {} while registering the service {}",
+                    e.getMessage(), instance.toString());
         }
         return false;
     }
index bd7fcb9..bed4ef3 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.controller.sal.binding.yang.types.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.util.List;
 import java.util.Set;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
 import org.opendaylight.controller.sal.binding.generator.impl.BindingGeneratorImpl;
@@ -248,6 +247,7 @@ public class GeneratedTypesTest {
         assertEquals(10, resolvedLeafrefCount);
     }
 
+    @Ignore
     @Test
     public void testContainerResolving() {
         final String filePath = getClass().getResource(
@@ -326,6 +326,7 @@ public class GeneratedTypesTest {
         assertEquals(4, methodsCount);
     }
 
+    @Ignore
     @Test
     public void testLeafListResolving() {
         final String filePath = getClass().getResource(
@@ -399,6 +400,7 @@ public class GeneratedTypesTest {
         assertEquals(3, methodsCount);
     }
 
+    @Ignore
     @Test
     public void testListResolving() {
         final String filePath = getClass()
index 9df281f..4ab054d 100644 (file)
@@ -10,34 +10,55 @@ package org.opendaylight.controller.sal.java.api.generator.test;
 import static org.junit.Assert.*;\r
 \r
 import java.io.File;\r
+import java.util.ArrayList;\r
 import java.util.Arrays;\r
 import java.util.HashSet;\r
 import java.util.List;\r
 import java.util.Set;\r
 \r
+import javax.tools.JavaCompiler;\r
+import javax.tools.JavaFileObject;\r
+import javax.tools.StandardJavaFileManager;\r
+import javax.tools.ToolProvider;\r
+\r
 import org.junit.After;\r
 import org.junit.Before;\r
 import org.junit.Test;\r
+import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;\r
+import org.opendaylight.controller.sal.binding.generator.impl.BindingGeneratorImpl;\r
 import org.opendaylight.controller.sal.binding.generator.impl.GeneratedTypeBuilderImpl;\r
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;\r
 import org.opendaylight.controller.sal.binding.model.api.GeneratedType;\r
+import org.opendaylight.controller.sal.binding.model.api.Type;\r
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;\r
 import org.opendaylight.controller.sal.java.api.generator.GeneratorJavaFile;\r
 import org.opendaylight.controller.sal.java.api.generator.InterfaceGenerator;\r
+import org.opendaylight.controller.yang.model.api.Module;\r
+import org.opendaylight.controller.yang.model.api.SchemaContext;\r
+import org.opendaylight.controller.yang.model.parser.impl.YangModelParserImpl;\r
 \r
 public class GeneratorJavaFileTest {\r
-\r
     private static final String FS = File.separator;\r
     private static final String PATH = "test-dir";\r
     private final File testDir = new File(PATH);\r
 \r
+    private static final String GENERATOR_OUTPUT_PATH = "src/test/resources/src";\r
+    private static final File GENERATOR_OUTPUT = new File(GENERATOR_OUTPUT_PATH);\r
+    private static final String COMPILER_OUTPUT_PATH = "src/test/resources/bin";\r
+    private static final File COMPILER_OUTPUT = new File(COMPILER_OUTPUT_PATH);\r
+\r
     @Before\r
     public void init() {\r
         assertTrue(testDir.mkdir());\r
+        assertTrue(COMPILER_OUTPUT.mkdirs());\r
+        assertTrue(GENERATOR_OUTPUT.mkdirs());\r
     }\r
 \r
     @After\r
     public void cleanUp() {\r
         deleteTestDir(testDir);\r
+        deleteTestDir(COMPILER_OUTPUT);\r
+        deleteTestDir(GENERATOR_OUTPUT);\r
     }\r
 \r
     @Test\r
@@ -66,6 +87,54 @@ public class GeneratorJavaFileTest {
         assertTrue(filesList.contains("Type3.java"));\r
     }\r
 \r
+    @Test\r
+    public void compilationTest() throws Exception {\r
+        final YangModelParserImpl parser = new YangModelParserImpl();\r
+        final BindingGenerator bindingGenerator = new BindingGeneratorImpl();\r
+\r
+        File sourcesDir = new File("src/test/resources/yang");\r
+        File[] sourceFiles = sourcesDir.listFiles();\r
+        String[] sourcesDirPaths = new String[sourceFiles.length];\r
+        for (int i = 0; i < sourceFiles.length; i++) {\r
+            sourcesDirPaths[i] = sourceFiles[i].getAbsolutePath();\r
+        }\r
+        final Set<Module> modulesToBuild = parser\r
+                .parseYangModels(sourcesDirPaths);\r
+\r
+        final SchemaContext context = parser\r
+                .resolveSchemaContext(modulesToBuild);\r
+        final List<Type> types = bindingGenerator.generateTypes(context);\r
+        final Set<GeneratedType> typesToGenerate = new HashSet<GeneratedType>();\r
+        final Set<GeneratedTransferObject> tosToGenerate = new HashSet<GeneratedTransferObject>();\r
+        for (Type type : types) {\r
+            if (type instanceof GeneratedType) {\r
+                typesToGenerate.add((GeneratedType) type);\r
+            }\r
+\r
+            if (type instanceof GeneratedTransferObject) {\r
+                tosToGenerate.add((GeneratedTransferObject) type);\r
+            }\r
+        }\r
+\r
+        final GeneratorJavaFile generator = new GeneratorJavaFile(\r
+                typesToGenerate, tosToGenerate);\r
+        generator.generateToFile(GENERATOR_OUTPUT_PATH);\r
+\r
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\r
+        StandardJavaFileManager fileManager = compiler.getStandardFileManager(\r
+                null, null, null);\r
+\r
+        List<File> filesList = getJavaFiles(new File(GENERATOR_OUTPUT_PATH));\r
+\r
+        Iterable<? extends JavaFileObject> compilationUnits = fileManager\r
+                .getJavaFileObjectsFromFiles(filesList);\r
+        Iterable<String> options = Arrays.asList(new String[] { "-d",\r
+                COMPILER_OUTPUT_PATH });\r
+        boolean compiled = compiler.getTask(null, null, null, options, null,\r
+                compilationUnits).call();\r
+        assertTrue(compiled);\r
+    }\r
+\r
     private GeneratedType createGeneratedType(String pkgName, String name) {\r
         GeneratedTypeBuilder builder = new GeneratedTypeBuilderImpl(pkgName,\r
                 name);\r
@@ -83,4 +152,26 @@ public class GeneratorJavaFileTest {
         }\r
     }\r
 \r
+    /**\r
+     * Search recursively given directory for *.java files.\r
+     *\r
+     * @param directory\r
+     *            directory to search\r
+     * @return List of java files found\r
+     */\r
+    private List<File> getJavaFiles(File directory) {\r
+        List<File> result = new ArrayList<File>();\r
+        for (File file : directory.listFiles()) {\r
+            if (file.isDirectory()) {\r
+                result.addAll(getJavaFiles(file));\r
+            } else {\r
+                String absPath = file.getAbsolutePath();\r
+                if (absPath.endsWith(".java")) {\r
+                    result.add(file);\r
+                }\r
+            }\r
+        }\r
+        return result;\r
+    }\r
+\r
 }\r
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang b/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang
new file mode 100644 (file)
index 0000000..7ed1f99
--- /dev/null
@@ -0,0 +1,141 @@
+module abstract-topology {
+    yang-version 1;
+    namespace "urn:model:abstract:topology";
+    prefix "tp";
+
+    import ietf-inet-types {
+        prefix "inet";
+        revision-date 2010-09-24;
+    }
+
+    import ietf-interfaces {
+        prefix "if";
+        revision-date 2012-11-15;
+    }
+
+    organization "Cisco";
+    contact "WILL-BE-DEFINED-LATER";
+
+    description
+        "This module contains the definitions of elements that creates network 
+    topology i.e. definition of network nodes and links. This module is not designed to be used solely for network representation. This module SHOULD be used as base module in defining the network topology.";
+
+    revision "2013-02-08" {
+        reference "~~~ WILL BE DEFINED LATER";
+    }
+    
+    revision "2013-01-01" {
+        reference "~~~ WILL BE DEFINED LATER";
+    }
+    
+    typedef node-id-ref {
+        type leafref {
+            path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
+        }
+        description "This type is used for leafs that reference network node instance.";
+    }
+
+    typedef link-id-ref {
+        type leafref {
+            path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
+        }
+        description "This type is used for leafs that reference network link instance.";
+    }
+
+    typedef interface-id-ref {
+        type leafref {
+            path "/tp:topology/tp:interfaces/tp:interface/tp:interface-id";
+        }
+    }
+
+    container topology {
+        description "This is the model of abstract topology which contains only Network Nodes and Network Links. Each topology MUST be identified by unique topology-id for reason that the store could contain many topologies.";
+
+        leaf topology-id {
+            type inet:uri;
+            description "It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have
+            UNIQUE topology identifier.";
+        }
+
+        container network-nodes {
+            list network-node {
+                key "node-id";
+
+                leaf node-id {
+                    type inet:uri;
+                    description "The Topology identifier of network-node.";
+                }
+
+                container attributes {
+                    description "Aditional attributes that can Network Node contains.";
+                }
+                description "The list of network nodes defined for topology.";
+            }
+        }
+
+        container interfaces {
+            list interface {
+                key "interface-id";
+
+                leaf interface-id {
+                    type leafref {
+                        path "/if:interfaces/if:interface/if:name";
+                    }
+                }
+
+                leaf-list higher-layer-if {
+                    type leafref {
+                        path "/if:interfaces/if:interface/if:higher-layer-if";
+                    }
+                }
+            }
+        }
+        
+        container network-links {
+            list network-link {
+                key "link-id";
+
+                leaf link-id {
+                    type inet:uri;
+                    description "";
+                }
+
+                container source-node {
+                    leaf id {
+                        type node-id-ref;
+                        description "Source node identifier.";
+                    }
+                }
+
+                container destination-node {
+                    leaf id {
+                        type node-id-ref;
+                        description "Destination node identifier.";
+                    }
+                }
+
+                container tunnels {
+                    list tunnel {
+                        key "tunnel-id";
+
+                        leaf tunnel-id {
+                            type leafref {
+                                path "../../../link-id";
+                            }
+                        }
+                    }
+                }
+
+                leaf interface {
+                    type interface-id-ref;
+                }
+
+                container attributes {
+                    description "Aditional attributes that can Network Link contains.";
+                }
+                description "The Network Link which is defined by Local (Source) and Remote (Destination) Network Nodes. Every link MUST be defined either by identifier and
+                his local and remote Network Nodes (In real applications it is common that many links are originated from one node and end up in same remote node). To ensure that we would always know to distinguish between links, every link SHOULD have identifier.";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/iana-if-type@2012-06-05.yang b/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/iana-if-type@2012-06-05.yang
new file mode 100644 (file)
index 0000000..a7fa137
--- /dev/null
@@ -0,0 +1,1516 @@
+module iana-if-type {
+  namespace "urn:ietf:params:xml:ns:yang:iana-if-type";
+  prefix ianaift;
+
+  organization "IANA";
+  contact
+    "        Internet Assigned Numbers Authority
+
+     Postal: ICANN
+             4676 Admiralty Way, Suite 330
+             Marina del Rey, CA 90292
+
+     Tel:    +1 310 823 9358
+     E-Mail: iana&iana.org";
+  description
+    "This YANG module defines the iana-if-type typedef, which
+     contains YANG definitions for IANA-registered interface types.
+
+     This YANG module is maintained by IANA, and reflects the
+     'ifType definitions' registry.
+
+     The latest revision of this YANG module can be obtained from
+     the IANA web site.
+
+     Copyright (c) 2011 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC XXXX; see
+     the RFC itself for full legal notices.";
+  // RFC Ed.: replace XXXX with actual RFC number and remove this
+  // note.
+
+  // RFC Ed.: update the date below with the date of RFC publication
+  // and remove this note.
+  revision 2012-06-05 {
+    description
+      "Initial revision.";
+    reference
+      "RFC XXXX: TITLE";
+  }
+
+  typedef iana-if-type {
+    type enumeration {
+      enum "other" {
+        value 1;
+        description
+          "None of the following";
+      }
+      enum "regular1822" {
+        value 2;
+      }
+      enum "hdh1822" {
+        value 3;
+      }
+      enum "ddnX25" {
+        value 4;
+      }
+      enum "rfc877x25" {
+        value 5;
+        reference
+          "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer";
+      }
+      enum "ethernetCsmacd" {
+        value 6;
+        description
+          "For all ethernet-like interfaces, regardless of speed,
+           as per RFC3635.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "iso88023Csmacd" {
+        value 7;
+        status deprecated;
+        description
+          "Deprecated via RFC3635.
+           Use ethernetCsmacd(6) instead.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "iso88024TokenBus" {
+        value 8;
+      }
+      enum "iso88025TokenRing" {
+        value 9;
+      }
+      enum "iso88026Man" {
+        value 10;
+      }
+      enum "starLan" {
+        value 11;
+        status deprecated;
+        description
+          "Deprecated via RFC3635.
+           Use ethernetCsmacd(6) instead.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "proteon10Mbit" {
+        value 12;
+      }
+      enum "proteon80Mbit" {
+        value 13;
+      }
+      enum "hyperchannel" {
+        value 14;
+      }
+      enum "fddi" {
+        value 15;
+        reference
+          "RFC 1512 - FDDI Management Information Base";
+      }
+      enum "lapb" {
+        value 16;
+        reference
+          "RFC 1381 - SNMP MIB Extension for X.25 LAPB";
+      }
+      enum "sdlc" {
+        value 17;
+      }
+      enum "ds1" {
+        value 18;
+        description
+          "DS1-MIB";
+        reference
+          "RFC 4805 - Definitions of Managed Objects for the
+                      DS1, J1, E1, DS2, and E2 Interface Types";
+      }
+      enum "e1" {
+        value 19;
+        status obsolete;
+        description
+          "Obsolete see DS1-MIB";
+        reference
+          "RFC 4805 - Definitions of Managed Objects for the
+                      DS1, J1, E1, DS2, and E2 Interface Types";
+      }
+      enum "basicISDN" {
+        value 20;
+        description
+          "see also RFC2127";
+      }
+      enum "primaryISDN" {
+        value 21;
+      }
+      enum "propPointToPointSerial" {
+        value 22;
+        description
+          "proprietary serial";
+      }
+      enum "ppp" {
+        value 23;
+      }
+      enum "softwareLoopback" {
+        value 24;
+      }
+      enum "eon" {
+        value 25;
+        description
+          "CLNP over IP";
+      }
+      enum "ethernet3Mbit" {
+        value 26;
+      }
+      enum "nsip" {
+        value 27;
+        description
+          "XNS over IP";
+      }
+      enum "slip" {
+        value 28;
+        description
+          "generic SLIP";
+      }
+      enum "ultra" {
+        value 29;
+        description
+          "ULTRA technologies";
+      }
+      enum "ds3" {
+        value 30;
+        description
+          "DS3-MIB";
+        reference
+          "RFC 3896 - Definitions of Managed Objects for the
+                      DS3/E3 Interface Type";
+      }
+      enum "sip" {
+        value 31;
+        description
+          "SMDS, coffee";
+        reference
+          "RFC 1694 - Definitions of Managed Objects for SMDS
+                      Interfaces using SMIv2";
+      }
+      enum "frameRelay" {
+        value 32;
+        description
+          "DTE only.";
+        reference
+          "RFC 2115 - Management Information Base for Frame Relay
+                      DTEs Using SMIv2";
+      }
+      enum "rs232" {
+        value 33;
+        reference
+          "RFC 1659 - Definitions of Managed Objects for RS-232-like
+                      Hardware Devices using SMIv2";
+      }
+      enum "para" {
+        value 34;
+        description
+          "parallel-port";
+        reference
+          "RFC 1660 - Definitions of Managed Objects for
+                      Parallel-printer-like Hardware Devices using
+                      SMIv2";
+      }
+      enum "arcnet" {
+        value 35;
+        description
+          "arcnet";
+      }
+      enum "arcnetPlus" {
+        value 36;
+        description
+          "arcnet plus";
+      }
+      enum "atm" {
+        value 37;
+        description
+          "ATM cells";
+      }
+      enum "miox25" {
+        value 38;
+        reference
+          "RFC 1461 - SNMP MIB extension for Multiprotocol
+                      Interconnect over X.25";
+      }
+      enum "sonet" {
+        value 39;
+        description
+          "SONET or SDH";
+      }
+      enum "x25ple" {
+        value 40;
+        reference
+          "RFC 2127 - ISDN Management Information Base using SMIv2";
+      }
+      enum "iso88022llc" {
+        value 41;
+      }
+      enum "localTalk" {
+        value 42;
+      }
+      enum "smdsDxi" {
+        value 43;
+      }
+      enum "frameRelayService" {
+        value 44;
+        description
+          "FRNETSERV-MIB";
+        reference
+          "RFC 2954 - Definitions of Managed Objects for Frame
+                      Relay Service";
+      }
+      enum "v35" {
+        value 45;
+      }
+      enum "hssi" {
+        value 46;
+      }
+      enum "hippi" {
+        value 47;
+      }
+      enum "modem" {
+        value 48;
+        description
+          "Generic modem";
+      }
+      enum "aal5" {
+        value 49;
+        description
+          "AAL5 over ATM";
+      }
+      enum "sonetPath" {
+        value 50;
+      }
+      enum "sonetVT" {
+        value 51;
+      }
+      enum "smdsIcip" {
+        value 52;
+        description
+          "SMDS InterCarrier Interface";
+      }
+      enum "propVirtual" {
+        value 53;
+        description
+          "proprietary virtual/internal";
+        reference
+          "RFC 2863 - The Interfaces Group MIB";
+      }
+      enum "propMultiplexor" {
+        value 54;
+        description
+          "proprietary multiplexing";
+        reference
+          "RFC 2863 - The Interfaces Group MIB";
+      }
+      enum "ieee80212" {
+        value 55;
+        description
+          "100BaseVG";
+      }
+      enum "fibreChannel" {
+        value 56;
+        description
+          "Fibre Channel";
+      }
+      enum "hippiInterface" {
+        value 57;
+        description
+          "HIPPI interfaces";
+      }
+      enum "frameRelayInterconnect" {
+        value 58;
+        status obsolete;
+        description
+          "Obsolete use either
+           frameRelay(32) or frameRelayService(44).";
+      }
+      enum "aflane8023" {
+        value 59;
+        description
+          "ATM Emulated LAN for 802.3";
+      }
+      enum "aflane8025" {
+        value 60;
+        description
+          "ATM Emulated LAN for 802.5";
+      }
+      enum "cctEmul" {
+        value 61;
+        description
+         "ATM Emulated circuit";
+      }
+      enum "fastEther" {
+        value 62;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635.
+          ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "isdn" {
+        value 63;
+        description
+          "ISDN and X.25";
+        reference
+          "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN
+                      in the Packet Mode";
+      }
+      enum "v11" {
+        value 64;
+        description
+         "CCITT V.11/X.21";
+      }
+      enum "v36" {
+        value 65;
+        description
+          "CCITT V.36";
+      }
+      enum "g703at64k" {
+        value 66;
+        description
+          "CCITT G703 at 64Kbps";
+      }
+      enum "g703at2mb" {
+        value 67;
+        status obsolete;
+        description
+          "Obsolete see DS1-MIB";
+      }
+      enum "qllc" {
+        value 68;
+        description
+          "SNA QLLC";
+      }
+      enum "fastEtherFX" {
+        value 69;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635
+          ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "channel" {
+        value 70;
+        description
+          "channel";
+      }
+      enum "ieee80211" {
+        value 71;
+        description
+          "radio spread spectrum";
+      }
+      enum "ibm370parChan" {
+        value 72;
+        description
+          "IBM System 360/370 OEMI Channel";
+      }
+      enum "escon" {
+        value 73;
+        description
+          "IBM Enterprise Systems Connection";
+      }
+      enum "dlsw" {
+        value 74;
+        description
+          "Data Link Switching";
+      }
+      enum "isdns" {
+        value 75;
+        description
+          "ISDN S/T interface";
+      }
+      enum "isdnu" {
+        value 76;
+        description
+          "ISDN U interface";
+      }
+      enum "lapd" {
+        value 77;
+        description
+          "Link Access Protocol D";
+      }
+      enum "ipSwitch" {
+        value 78;
+        description
+          "IP Switching Objects";
+      }
+      enum "rsrb" {
+        value 79;
+        description
+          "Remote Source Route Bridging";
+      }
+      enum "atmLogical" {
+        value 80;
+        description
+          "ATM Logical Port";
+        reference
+          "RFC 3606 - Definitions of Supplemental Managed Objects
+                      for ATM Interface";
+      }
+      enum "ds0" {
+        value 81;
+        description
+          "Digital Signal Level 0";
+        reference
+          "RFC 2494 - Definitions of Managed Objects for the DS0
+                      and DS0 Bundle Interface Type";
+      }
+      enum "ds0Bundle" {
+        value 82;
+        description
+          "group of ds0s on the same ds1";
+        reference
+          "RFC 2494 - Definitions of Managed Objects for the DS0
+                      and DS0 Bundle Interface Type";
+      }
+      enum "bsc" {
+        value 83;
+        description
+          "Bisynchronous Protocol";
+      }
+      enum "async" {
+        value 84;
+        description
+          "Asynchronous Protocol";
+      }
+      enum "cnr" {
+        value 85;
+        description
+          "Combat Net Radio";
+      }
+      enum "iso88025Dtr" {
+        value 86;
+        description
+          "ISO 802.5r DTR";
+      }
+      enum "eplrs" {
+        value 87;
+        description
+          "Ext Pos Loc Report Sys";
+      }
+      enum "arap" {
+        value 88;
+        description
+          "Appletalk Remote Access Protocol";
+      }
+      enum "propCnls" {
+        value 89;
+        description
+          "Proprietary Connectionless Protocol";
+      }
+      enum "hostPad" {
+        value 90;
+        description
+          "CCITT-ITU X.29 PAD Protocol";
+      }
+      enum "termPad" {
+        value 91;
+        description
+          "CCITT-ITU X.3 PAD Facility";
+      }
+      enum "frameRelayMPI" {
+        value 92;
+        description
+          "Multiproto Interconnect over FR";
+      }
+      enum "x213" {
+        value 93;
+        description
+          "CCITT-ITU X213";
+      }
+      enum "adsl" {
+        value 94;
+        description
+          "Asymmetric Digital Subscriber Loop";
+      }
+      enum "radsl" {
+        value 95;
+        description
+          "Rate-Adapt. Digital Subscriber Loop";
+      }
+      enum "sdsl" {
+        value 96;
+        description
+          "Symmetric Digital Subscriber Loop";
+      }
+      enum "vdsl" {
+        value 97;
+        description
+          "Very H-Speed Digital Subscrib. Loop";
+      }
+      enum "iso88025CRFPInt" {
+        value 98;
+        description
+          "ISO 802.5 CRFP";
+      }
+      enum "myrinet" {
+        value 99;
+        description
+          "Myricom Myrinet";
+      }
+      enum "voiceEM" {
+        value 100;
+        description
+          "voice recEive and transMit";
+      }
+      enum "voiceFXO" {
+        value 101;
+        description
+          "voice Foreign Exchange Office";
+      }
+      enum "voiceFXS" {
+        value 102;
+        description
+          "voice Foreign Exchange Station";
+      }
+      enum "voiceEncap" {
+        value 103;
+        description
+          "voice encapsulation";
+      }
+      enum "voiceOverIp" {
+        value 104;
+        description
+          "voice over IP encapsulation";
+      }
+      enum "atmDxi" {
+        value 105;
+        description
+          "ATM DXI";
+      }
+      enum "atmFuni" {
+        value 106;
+        description
+          "ATM FUNI";
+      }
+      enum "atmIma" {
+        value 107;
+        description
+          "ATM IMA";
+      }
+      enum "pppMultilinkBundle" {
+        value 108;
+        description
+          "PPP Multilink Bundle";
+      }
+      enum "ipOverCdlc" {
+        value 109;
+        description
+          "IBM ipOverCdlc";
+      }
+      enum "ipOverClaw" {
+        value 110;
+        description
+          "IBM Common Link Access to Workstn";
+      }
+      enum "stackToStack" {
+        value 111;
+        description
+          "IBM stackToStack";
+      }
+      enum "virtualIpAddress" {
+        value 112;
+        description
+          "IBM VIPA";
+      }
+      enum "mpc" {
+        value 113;
+        description
+          "IBM multi-protocol channel support";
+      }
+      enum "ipOverAtm" {
+        value 114;
+        description
+          "IBM ipOverAtm";
+        reference
+          "RFC 2320 - Definitions of Managed Objects for Classical IP
+                      and ARP Over ATM Using SMIv2 (IPOA-MIB)";
+      }
+      enum "iso88025Fiber" {
+        value 115;
+        description
+          "ISO 802.5j Fiber Token Ring";
+      }
+      enum "tdlc" {
+        value 116;
+        description
+          "IBM twinaxial data link control";
+      }
+      enum "gigabitEthernet" {
+        value 117;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635
+           ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "hdlc" {
+        value 118;
+        description
+          "HDLC";
+      }
+      enum "lapf" {
+        value 119;
+        description
+          "LAP F";
+      }
+      enum "v37" {
+        value 120;
+        description
+          "V.37";
+      }
+      enum "x25mlp" {
+        value 121;
+        description
+          "Multi-Link Protocol";
+      }
+      enum "x25huntGroup" {
+        value 122;
+        description
+          "X25 Hunt Group";
+      }
+      enum "transpHdlc" {
+        value 123;
+        description
+          "Transp HDLC";
+      }
+      enum "interleave" {
+        value 124;
+        description
+          "Interleave channel";
+      }
+      enum "fast" {
+        value 125;
+        description
+          "Fast channel";
+      }
+      enum "ip" {
+        value 126;
+        description
+          "IP (for APPN HPR in IP networks)";
+      }
+      enum "docsCableMaclayer" {
+        value 127;
+        description
+          "CATV Mac Layer";
+      }
+      enum "docsCableDownstream" {
+        value 128;
+        description
+          "CATV Downstream interface";
+      }
+      enum "docsCableUpstream" {
+        value 129;
+        description
+          "CATV Upstream interface";
+      }
+      enum "a12MppSwitch" {
+        value 130;
+        description
+          "Avalon Parallel Processor";
+      }
+      enum "tunnel" {
+        value 131;
+        description
+          "Encapsulation interface";
+      }
+      enum "coffee" {
+        value 132;
+        description
+          "coffee pot";
+        reference
+          "RFC 2325 - Coffee MIB";
+      }
+      enum "ces" {
+        value 133;
+        description
+          "Circuit Emulation Service";
+      }
+      enum "atmSubInterface" {
+        value 134;
+        description
+          "ATM Sub Interface";
+      }
+      enum "l2vlan" {
+        value 135;
+        description
+          "Layer 2 Virtual LAN using 802.1Q";
+      }
+      enum "l3ipvlan" {
+        value 136;
+        description
+          "Layer 3 Virtual LAN using IP";
+      }
+      enum "l3ipxvlan" {
+        value 137;
+        description
+          "Layer 3 Virtual LAN using IPX";
+      }
+      enum "digitalPowerline" {
+        value 138;
+        description
+          "IP over Power Lines";
+      }
+      enum "mediaMailOverIp" {
+        value 139;
+        description
+          "Multimedia Mail over IP";
+      }
+      enum "dtm" {
+        value 140;
+        description
+          "Dynamic syncronous Transfer Mode";
+      }
+      enum "dcn" {
+        value 141;
+        description
+          "Data Communications Network";
+      }
+      enum "ipForward" {
+        value 142;
+        description
+          "IP Forwarding Interface";
+      }
+      enum "msdsl" {
+        value 143;
+        description
+          "Multi-rate Symmetric DSL";
+      }
+      enum "ieee1394" {
+        value 144;
+        description
+          "IEEE1394 High Performance Serial Bus";
+      }
+      enum "if-gsn" {
+        value 145;
+        description
+          "HIPPI-6400";
+      }
+      enum "dvbRccMacLayer" {
+        value 146;
+        description
+          "DVB-RCC MAC Layer";
+      }
+      enum "dvbRccDownstream" {
+        value 147;
+        description
+          "DVB-RCC Downstream Channel";
+      }
+      enum "dvbRccUpstream" {
+        value 148;
+        description
+          "DVB-RCC Upstream Channel";
+      }
+      enum "atmVirtual" {
+        value 149;
+        description
+          "ATM Virtual Interface";
+      }
+      enum "mplsTunnel" {
+        value 150;
+        description
+          "MPLS Tunnel Virtual Interface";
+      }
+      enum "srp" {
+        value 151;
+        description
+          "Spatial Reuse Protocol       ";
+      }
+      enum "voiceOverAtm" {
+        value 152;
+        description
+          "Voice Over ATM";
+      }
+      enum "voiceOverFrameRelay" {
+        value 153;
+        description
+          "Voice Over Frame Relay";
+      }
+      enum "idsl" {
+        value 154;
+        description
+          "Digital Subscriber Loop over ISDN";
+      }
+      enum "compositeLink" {
+        value 155;
+        description
+          "Avici Composite Link Interface";
+      }
+      enum "ss7SigLink" {
+        value 156;
+        description
+          "SS7 Signaling Link";
+      }
+      enum "propWirelessP2P" {
+        value 157;
+        description
+          "Prop. P2P wireless interface";
+      }
+      enum "frForward" {
+        value 158;
+        description
+          "Frame Forward Interface";
+      }
+      enum "rfc1483" {
+        value 159;
+        description
+          "Multiprotocol over ATM AAL5";
+        reference
+          "RFC 1483 - Multiprotocol Encapsulation over ATM
+                      Adaptation Layer 5";
+      }
+      enum "usb" {
+        value 160;
+        description
+          "USB Interface";
+      }
+      enum "ieee8023adLag" {
+        value 161;
+        description
+          "IEEE 802.3ad Link Aggregate";
+      }
+      enum "bgppolicyaccounting" {
+        value 162;
+        description
+          "BGP Policy Accounting";
+      }
+      enum "frf16MfrBundle" {
+        value 163;
+        description
+          "FRF .16 Multilink Frame Relay";
+      }
+      enum "h323Gatekeeper" {
+        value 164;
+        description
+          "H323 Gatekeeper";
+      }
+      enum "h323Proxy" {
+        value 165;
+        description
+          "H323 Voice and Video Proxy";
+      }
+      enum "mpls" {
+        value 166;
+        description
+          "MPLS";
+      }
+      enum "mfSigLink" {
+        value 167;
+        description
+          "Multi-frequency signaling link";
+      }
+      enum "hdsl2" {
+        value 168;
+        description
+          "High Bit-Rate DSL - 2nd generation";
+      }
+      enum "shdsl" {
+        value 169;
+        description
+          "Multirate HDSL2";
+      }
+      enum "ds1FDL" {
+        value 170;
+        description
+          "Facility Data Link 4Kbps on a DS1";
+      }
+      enum "pos" {
+        value 171;
+        description
+          "Packet over SONET/SDH Interface";
+      }
+      enum "dvbAsiIn" {
+        value 172;
+        description
+          "DVB-ASI Input";
+      }
+      enum "dvbAsiOut" {
+        value 173;
+        description
+          "DVB-ASI Output";
+      }
+      enum "plc" {
+        value 174;
+        description
+          "Power Line Communtications";
+      }
+      enum "nfas" {
+        value 175;
+        description
+          "Non Facility Associated Signaling";
+      }
+      enum "tr008" {
+        value 176;
+        description
+          "TR008";
+      }
+      enum "gr303RDT" {
+        value 177;
+        description
+          "Remote Digital Terminal";
+      }
+      enum "gr303IDT" {
+        value 178;
+        description
+          "Integrated Digital Terminal";
+      }
+      enum "isup" {
+        value 179;
+        description
+          "ISUP";
+      }
+      enum "propDocsWirelessMaclayer" {
+        value 180;
+        description
+          "Cisco proprietary Maclayer";
+      }
+      enum "propDocsWirelessDownstream" {
+        value 181;
+        description
+          "Cisco proprietary Downstream";
+      }
+      enum "propDocsWirelessUpstream" {
+        value 182;
+        description
+          "Cisco proprietary Upstream";
+      }
+      enum "hiperlan2" {
+        value 183;
+        description
+          "HIPERLAN Type 2 Radio Interface";
+      }
+      enum "propBWAp2Mp" {
+        value 184;
+        description
+          "PropBroadbandWirelessAccesspt2multipt use of this value
+           for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f
+           is deprecated and ieee80216WMAN(237) should be used
+           instead.";
+      }
+      enum "sonetOverheadChannel" {
+        value 185;
+        description
+          "SONET Overhead Channel";
+      }
+      enum "digitalWrapperOverheadChannel" {
+        value 186;
+        description
+          "Digital Wrapper";
+      }
+      enum "aal2" {
+        value 187;
+        description
+          "ATM adaptation layer 2";
+      }
+      enum "radioMAC" {
+        value 188;
+        description
+          "MAC layer over radio links";
+      }
+      enum "atmRadio" {
+        value 189;
+        description
+          "ATM over radio links";
+      }
+      enum "imt" {
+        value 190;
+        description
+          "Inter Machine Trunks";
+      }
+      enum "mvl" {
+        value 191;
+        description
+          "Multiple Virtual Lines DSL";
+      }
+      enum "reachDSL" {
+        value 192;
+        description
+          "Long Reach DSL";
+      }
+      enum "frDlciEndPt" {
+        value 193;
+        description
+          "Frame Relay DLCI End Point";
+      }
+      enum "atmVciEndPt" {
+        value 194;
+        description
+          "ATM VCI End Point";
+      }
+      enum "opticalChannel" {
+        value 195;
+        description
+          "Optical Channel";
+      }
+      enum "opticalTransport" {
+        value 196;
+        description
+          "Optical Transport";
+      }
+      enum "propAtm" {
+        value 197;
+        description
+          "Proprietary ATM";
+      }
+      enum "voiceOverCable" {
+        value 198;
+        description
+          "Voice Over Cable Interface";
+      }
+      enum "infiniband" {
+        value 199;
+        description
+          "Infiniband";
+      }
+      enum "teLink" {
+        value 200;
+        description
+          "TE Link";
+      }
+      enum "q2931" {
+        value 201;
+        description
+          "Q.2931";
+      }
+      enum "virtualTg" {
+        value 202;
+        description
+          "Virtual Trunk Group";
+      }
+      enum "sipTg" {
+        value 203;
+        description
+          "SIP Trunk Group";
+      }
+      enum "sipSig" {
+        value 204;
+        description
+          "SIP Signaling";
+      }
+      enum "docsCableUpstreamChannel" {
+        value 205;
+        description
+          "CATV Upstream Channel";
+      }
+      enum "econet" {
+        value 206;
+        description
+          "Acorn Econet";
+      }
+      enum "pon155" {
+        value 207;
+        description
+          "FSAN 155Mb Symetrical PON interface";
+      }
+      enum "pon622" {
+        value 208;
+        description
+          "FSAN622Mb Symetrical PON interface";
+      }
+      enum "bridge" {
+        value 209;
+        description
+          "Transparent bridge interface";
+      }
+      enum "linegroup" {
+        value 210;
+        description
+          "Interface common to multiple lines";
+      }
+      enum "voiceEMFGD" {
+        value 211;
+        description
+          "voice E&M Feature Group D";
+      }
+      enum "voiceFGDEANA" {
+        value 212;
+        description
+          "voice FGD Exchange Access North American";
+      }
+      enum "voiceDID" {
+        value 213;
+        description
+          "voice Direct Inward Dialing";
+      }
+      enum "mpegTransport" {
+        value 214;
+        description
+          "MPEG transport interface";
+      }
+      enum "sixToFour" {
+        value 215;
+        status deprecated;
+        description
+          "6to4 interface (DEPRECATED)";
+        reference
+          "RFC 4087 - IP Tunnel MIB";
+      }
+      enum "gtp" {
+        value 216;
+        description
+          "GTP (GPRS Tunneling Protocol)";
+      }
+      enum "pdnEtherLoop1" {
+        value 217;
+        description
+          "Paradyne EtherLoop 1";
+      }
+      enum "pdnEtherLoop2" {
+        value 218;
+        description
+          "Paradyne EtherLoop 2";
+      }
+      enum "opticalChannelGroup" {
+        value 219;
+        description
+          "Optical Channel Group";
+      }
+      enum "homepna" {
+        value 220;
+        description
+          "HomePNA ITU-T G.989";
+      }
+      enum "gfp" {
+        value 221;
+        description
+          "Generic Framing Procedure (GFP)";
+      }
+      enum "ciscoISLvlan" {
+        value 222;
+        description
+          "Layer 2 Virtual LAN using Cisco ISL";
+      }
+      enum "actelisMetaLOOP" {
+        value 223;
+        description
+          "Acteleis proprietary MetaLOOP High Speed Link";
+      }
+      enum "fcipLink" {
+        value 224;
+        description
+          "FCIP Link";
+      }
+      enum "rpr" {
+        value 225;
+        description
+          "Resilient Packet Ring Interface Type";
+      }
+      enum "qam" {
+        value 226;
+        description
+          "RF Qam Interface";
+      }
+      enum "lmp" {
+        value 227;
+        description
+          "Link Management Protocol";
+        reference
+          "RFC 4327 - Link Management Protocol (LMP) Management
+                      Information Base (MIB)";
+      }
+      enum "cblVectaStar" {
+        value 228;
+        description
+          "Cambridge Broadband Networks Limited VectaStar";
+      }
+      enum "docsCableMCmtsDownstream" {
+        value 229;
+        description
+          "CATV Modular CMTS Downstream Interface";
+      }
+      enum "adsl2" {
+        value 230;
+        status deprecated;
+        description
+          "Asymmetric Digital Subscriber Loop Version 2
+           (DEPRECATED/OBSOLETED - please use adsl2plus(238)
+           instead)";
+        reference
+          "RFC 4706 - Definitions of Managed Objects for Asymmetric
+                      Digital Subscriber Line 2 (ADSL2)";
+      }
+      enum "macSecControlledIF" {
+        value 231;
+        description
+          "MACSecControlled";
+      }
+      enum "macSecUncontrolledIF" {
+        value 232;
+        description
+          "MACSecUncontrolled";
+      }
+      enum "aviciOpticalEther" {
+        value 233;
+        description
+         "Avici Optical Ethernet Aggregate";
+      }
+      enum "atmbond" {
+        value 234;
+        description
+          "atmbond";
+      }
+      enum "voiceFGDOS" {
+        value 235;
+        description
+          "voice FGD Operator Services";
+      }
+      enum "mocaVersion1" {
+        value 236;
+        description
+          "MultiMedia over Coax Alliance (MoCA) Interface
+           as documented in information provided privately to IANA";
+      }
+      enum "ieee80216WMAN" {
+        value 237;
+        description
+          "IEEE 802.16 WMAN interface";
+      }
+      enum "adsl2plus" {
+        value 238;
+        description
+          "Asymmetric Digital Subscriber Loop Version 2,
+           Version 2 Plus and all variants";
+      }
+      enum "dvbRcsMacLayer" {
+        value 239;
+        description
+          "DVB-RCS MAC Layer";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "dvbTdm" {
+        value 240;
+        description
+          "DVB Satellite TDM";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "dvbRcsTdma" {
+        value 241;
+        description
+          "DVB-RCS TDMA";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "x86Laps" {
+        value 242;
+        description
+          "LAPS based on ITU-T X.86/Y.1323";
+      }
+      enum "wwanPP" {
+        value 243;
+        description
+          "3GPP WWAN";
+      }
+      enum "wwanPP2" {
+        value 244;
+        description
+          "3GPP2 WWAN";
+      }
+      enum "voiceEBS" {
+        value 245;
+        description
+          "voice P-phone EBS physical interface";
+      }
+      enum "ifPwType" {
+        value 246;
+        description
+          "Pseudowire interface type";
+        reference
+          "RFC 5601 - Pseudowire (PW) Management Information Base";
+      }
+      enum "ilan" {
+        value 247;
+        description
+          "Internal LAN on a bridge per IEEE 802.1ap";
+      }
+      enum "pip" {
+        value 248;
+        description
+          "Provider Instance Port on a bridge per IEEE 802.1ah PBB";
+      }
+      enum "aluELP" {
+        value 249;
+        description
+          "Alcatel-Lucent Ethernet Link Protection";
+      }
+      enum "gpon" {
+        value 250;
+        description
+          "Gigabit-capable passive optical networks (G-PON) as per
+           ITU-T G.948";
+      }
+      enum "vdsl2" {
+        value 251;
+        description
+          "Very high speed digital subscriber line Version 2
+           (as per ITU-T Recommendation G.993.2)";
+        reference
+          "RFC 5650 - Definitions of Managed Objects for Very High
+                      Speed Digital Subscriber Line 2 (VDSL2)";
+      }
+      enum "capwapDot11Profile" {
+        value 252;
+        description
+          "WLAN Profile Interface";
+        reference
+          "RFC 5834 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Binding MIB for
+                      IEEE 802.11";
+      }
+      enum "capwapDot11Bss" {
+        value 253;
+        description
+          "WLAN BSS Interface";
+        reference
+          "RFC 5834 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Binding MIB for
+                      IEEE 802.11";
+      }
+      enum "capwapWtpVirtualRadio" {
+        value 254;
+        description
+          "WTP Virtual Radio Interface";
+        reference
+          "RFC 5833 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Base MIB";
+      }
+      enum "bits" {
+        value 255;
+        description
+          "bitsport";
+      }
+      enum "docsCableUpstreamRfPort" {
+        value 256;
+        description
+          "DOCSIS CATV Upstream RF Port";
+      }
+      enum "cableDownstreamRfPort" {
+        value 257;
+        description
+          "CATV downstream RF port";
+      }
+      enum "vmwareVirtualNic" {
+        value 258;
+        description
+          "VMware Virtual Network Interface";
+      }
+      enum "ieee802154" {
+        value 259;
+        description
+          "IEEE 802.15.4 WPAN interface";
+        reference
+          "IEEE 802.15.4-2006";
+      }
+      enum "otnOdu" {
+        value 260;
+        description
+          "OTN Optical Data Unit";
+      }
+      enum "otnOtu" {
+        value 261;
+        description
+          "OTN Optical channel Transport Unit";
+      }
+      enum "ifVfiType" {
+        value 262;
+        description
+          "VPLS Forwarding Instance Interface Type";
+      }
+      enum "g9981" {
+        value 263;
+        description
+          "G.998.1 bonded interface";
+      }
+      enum "g9982" {
+        value 264;
+        description
+          "G.998.2 bonded interface";
+      }
+      enum "g9983" {
+        value 265;
+        description
+          "G.998.3 bonded interface";
+      }
+      enum "aluEpon" {
+        value 266;
+        description
+          "Ethernet Passive Optical Networks (E-PON)";
+      }
+      enum "aluEponOnu" {
+        value 267;
+        description
+          "EPON Optical Network Unit";
+      }
+      enum "aluEponPhysicalUni" {
+        value 268;
+        description
+          "EPON physical User to Network interface";
+      }
+      enum "aluEponLogicalLink" {
+        value 269;
+        description
+          "The emulation of a point-to-point link over the EPON
+           layer";
+      }
+      enum "aluGponOnu" {
+        value 270;
+        description
+          "GPON Optical Network Unit";
+        reference
+          "ITU-T G.984.2";
+      }
+      enum "aluGponPhysicalUni" {
+        value 271;
+        description
+          "GPON physical User to Network interface";
+        reference
+          "ITU-T G.984.2";
+      }
+      enum "vmwareNicTeam" {
+        value 272;
+        description
+          "VMware NIC Team";
+      }
+    }
+    description
+      "This data type is used as the syntax of the 'type'
+       leaf in the 'interface' list in the YANG module
+       ietf-interface.
+
+       The definition of this typedef with the
+       addition of newly assigned values is published
+       periodically by the IANA, in either the Assigned
+       Numbers RFC, or some derivative of it specific to
+       Internet Network Management number assignments.  (The
+       latest arrangements can be obtained by contacting the
+       IANA.)
+
+       Requests for new values should be made to IANA via
+       email (iana&iana.org).";
+    reference
+      "ifType definitions registry.
+       <http://www.iana.org/assignments/smi-numbers>";
+  }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-inet-types@2010-09-24.yang b/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-inet-types@2010-09-24.yang
new file mode 100644 (file)
index 0000000..6a6c748
--- /dev/null
@@ -0,0 +1,418 @@
+ module ietf-inet-types {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+   prefix "inet";
+
+   organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Partain
+               <mailto:david.partain@ericsson.com>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     Editor:   Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>";
+
+   description
+    "This module contains a collection of generally useful derived
+     YANG data types for Internet addresses and related things.
+
+     Copyright (c) 2010 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, is permitted pursuant to, and subject to the license
+     terms contained in, the Simplified BSD License set forth in Section
+     4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC 6021; see
+     the RFC itself for full legal notices.";
+
+   revision 2010-09-24 {
+     description
+      "Initial revision.";
+     reference
+      "RFC 6021: Common YANG Data Types";
+   }
+
+   /*** collection of protocol field related types ***/
+
+   typedef ip-version {
+     type enumeration {
+       enum unknown {
+         value "0";
+         description
+          "An unknown or unspecified version of the Internet protocol.";
+       }
+       enum ipv4 {
+         value "1";
+         description
+          "The IPv4 protocol as defined in RFC 791.";
+       }
+       enum ipv6 {
+         value "2";
+         description
+          "The IPv6 protocol as defined in RFC 2460.";
+       }
+     }
+     description
+      "This value represents the version of the IP protocol.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetVersion textual convention of the SMIv2.";
+     reference
+      "RFC  791: Internet Protocol
+       RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   typedef dscp {
+     type uint8 {
+       range "0..63";
+     }
+     description
+      "The dscp type represents a Differentiated Services Code-Point
+       that may be used for marking packets in a traffic stream.
+
+       In the value set and its semantics, this type is equivalent
+       to the Dscp textual convention of the SMIv2.";
+     reference
+      "RFC 3289: Management Information Base for the Differentiated
+                 Services Architecture
+       RFC 2474: Definition of the Differentiated Services Field
+                 (DS Field) in the IPv4 and IPv6 Headers
+       RFC 2780: IANA Allocation Guidelines For Values In
+                 the Internet Protocol and Related Headers";
+   }
+
+   typedef ipv6-flow-label {
+     type uint32 {
+       range "0..1048575";
+     }
+     description
+      "The flow-label type represents flow identifier or Flow Label
+       in an IPv6 packet header that may be used to discriminate
+       traffic flows.
+
+       In the value set and its semantics, this type is equivalent
+       to the IPv6FlowLabel textual convention of the SMIv2.";
+     reference
+      "RFC 3595: Textual Conventions for IPv6 Flow Label
+       RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
+   }
+
+   typedef port-number {
+     type uint16 {
+       range "0..65535";
+     }
+     description
+      "The port-number type represents a 16-bit port number of an
+       Internet transport layer protocol such as UDP, TCP, DCCP, or
+       SCTP.  Port numbers are assigned by IANA.  A current list of
+       all assignments is available from <http://www.iana.org/>.
+
+       Note that the port number value zero is reserved by IANA.  In
+       situations where the value zero does not make sense, it can
+       be excluded by subtyping the port-number type.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetPortNumber textual convention of the SMIv2.";
+     reference
+      "RFC  768: User Datagram Protocol
+       RFC  793: Transmission Control Protocol
+       RFC 4960: Stream Control Transmission Protocol
+       RFC 4340: Datagram Congestion Control Protocol (DCCP)
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   /*** collection of autonomous system related types ***/
+
+   typedef as-number {
+     type uint32;
+     description
+      "The as-number type represents autonomous system numbers
+       which identify an Autonomous System (AS).  An AS is a set
+       of routers under a single technical administration, using
+       an interior gateway protocol and common metrics to route
+       packets within the AS, and using an exterior gateway
+       protocol to route packets to other ASs'.  IANA maintains
+       the AS number space and has delegated large parts to the
+       regional registries.
+
+       Autonomous system numbers were originally limited to 16
+       bits.  BGP extensions have enlarged the autonomous system
+       number space to 32 bits.  This type therefore uses an uint32
+       base type without a range restriction in order to support
+       a larger autonomous system number space.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetAutonomousSystemNumber textual convention of
+       the SMIv2.";
+     reference
+      "RFC 1930: Guidelines for creation, selection, and registration
+                 of an Autonomous System (AS)
+       RFC 4271: A Border Gateway Protocol 4 (BGP-4)
+       RFC 4893: BGP Support for Four-octet AS Number Space
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   /*** collection of IP address and hostname related types ***/
+
+   typedef ip-address {
+     type union {
+       type inet:ipv4-address;
+       type inet:ipv6-address;
+     }
+     description
+      "The ip-address type represents an IP address and is IP
+       version neutral.  The format of the textual representations
+       implies the IP version.";
+   }
+
+   typedef ipv4-address {
+     type string {
+       pattern
+         '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+       +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+       + '(%[\p{N}\p{L}]+)?';
+     }
+     description
+       "The ipv4-address type represents an IPv4 address in
+        dotted-quad notation.  The IPv4 address may include a zone
+        index, separated by a % sign.
+
+        The zone index is used to disambiguate identical address
+        values.  For link-local addresses, the zone index will
+        typically be the interface index number or the name of an
+        interface.  If the zone index is not present, the default
+        zone of the device will be used.
+
+        The canonical format for the zone index is the numerical
+        format";
+   }
+
+   typedef ipv6-address {
+     type string {
+       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+             + '(%[\p{N}\p{L}]+)?';
+       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+             + '(%.+)?';
+     }
+     description
+      "The ipv6-address type represents an IPv6 address in full,
+       mixed, shortened, and shortened-mixed notation.  The IPv6
+       address may include a zone index, separated by a % sign.
+
+       The zone index is used to disambiguate identical address
+       values.  For link-local addresses, the zone index will
+       typically be the interface index number or the name of an
+       interface.  If the zone index is not present, the default
+       zone of the device will be used.
+
+       The canonical format of IPv6 addresses uses the compressed
+       format described in RFC 4291, Section 2.2, item 2 with the
+       following additional rules: the :: substitution must be
+       applied to the longest sequence of all-zero 16-bit chunks
+       in an IPv6 address.  If there is a tie, the first sequence
+       of all-zero 16-bit chunks is replaced by ::.  Single
+       all-zero 16-bit chunks are not compressed.  The canonical
+       format uses lowercase characters and leading zeros are
+       not allowed.  The canonical format for the zone index is
+       the numerical format as described in RFC 4007, Section
+       11.2.";
+     reference
+      "RFC 4291: IP Version 6 Addressing Architecture
+       RFC 4007: IPv6 Scoped Address Architecture
+       RFC 5952: A Recommendation for IPv6 Address Text Representation";
+   }
+
+   typedef ip-prefix {
+     type union {
+       type inet:ipv4-prefix;
+       type inet:ipv6-prefix;
+     }
+     description
+      "The ip-prefix type represents an IP prefix and is IP
+       version neutral.  The format of the textual representations
+       implies the IP version.";
+   }
+
+   typedef ipv4-prefix {
+     type string {
+       pattern
+          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+        +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+        + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
+     }
+     description
+      "The ipv4-prefix type represents an IPv4 address prefix.
+       The prefix length is given by the number following the
+       slash character and must be less than or equal to 32.
+
+       A prefix length value of n corresponds to an IP address
+       mask that has n contiguous 1-bits from the most
+       significant bit (MSB) and all other bits set to 0.
+
+       The canonical format of an IPv4 prefix has all bits of
+       the IPv4 address set to zero that are not part of the
+       IPv4 prefix.";
+   }
+
+   typedef ipv6-prefix {
+     type string {
+       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+             + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
+       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+             + '(/.+)';
+     }
+     description
+      "The ipv6-prefix type represents an IPv6 address prefix.
+       The prefix length is given by the number following the
+       slash character and must be less than or equal 128.
+
+       A prefix length value of n corresponds to an IP address
+       mask that has n contiguous 1-bits from the most
+       significant bit (MSB) and all other bits set to 0.
+
+       The IPv6 address should have all bits that do not belong
+       to the prefix set to zero.
+
+       The canonical format of an IPv6 prefix has all bits of
+       the IPv6 address set to zero that are not part of the
+       IPv6 prefix.  Furthermore, IPv6 address is represented
+       in the compressed format described in RFC 4291, Section
+       2.2, item 2 with the following additional rules: the ::
+       substitution must be applied to the longest sequence of
+       all-zero 16-bit chunks in an IPv6 address.  If there is
+       a tie, the first sequence of all-zero 16-bit chunks is
+       replaced by ::.  Single all-zero 16-bit chunks are not
+       compressed.  The canonical format uses lowercase
+       characters and leading zeros are not allowed.";
+     reference
+      "RFC 4291: IP Version 6 Addressing Architecture";
+   }
+
+   /*** collection of domain name and URI types ***/
+
+   typedef domain-name {
+     type string {
+       pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*'
+            +  '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)'
+            +  '|\.';
+       length "1..253";
+     }
+     description
+      "The domain-name type represents a DNS domain name.  The
+       name SHOULD be fully qualified whenever possible.
+
+       Internet domain names are only loosely specified.  Section
+       3.5 of RFC 1034 recommends a syntax (modified in Section
+       2.1 of RFC 1123).  The pattern above is intended to allow
+       for current practice in domain name use, and some possible
+       future expansion.  It is designed to hold various types of
+       domain names, including names used for A or AAAA records
+       (host names) and other records, such as SRV records.  Note
+       that Internet host names have a stricter syntax (described
+       in RFC 952) than the DNS recommendations in RFCs 1034 and
+       1123, and that systems that want to store host names in
+       schema nodes using the domain-name type are recommended to
+       adhere to this stricter standard to ensure interoperability.
+
+       The encoding of DNS names in the DNS protocol is limited
+       to 255 characters.  Since the encoding consists of labels
+       prefixed by a length bytes and there is a trailing NULL
+       byte, only 253 characters can appear in the textual dotted
+       notation.
+
+       The description clause of schema nodes using the domain-name
+       type MUST describe when and how these names are resolved to
+       IP addresses.  Note that the resolution of a domain-name value
+       may require to query multiple DNS records (e.g., A for IPv4
+       and AAAA for IPv6).  The order of the resolution process and
+       which DNS record takes precedence can either be defined
+       explicitely or it may depend on the configuration of the
+       resolver.
+
+       Domain-name values use the US-ASCII encoding.  Their canonical
+       format uses lowercase US-ASCII characters.  Internationalized
+       domain names MUST be encoded in punycode as described in RFC
+       3492";
+     reference
+      "RFC  952: DoD Internet Host Table Specification
+       RFC 1034: Domain Names - Concepts and Facilities
+       RFC 1123: Requirements for Internet Hosts -- Application
+                 and Support
+       RFC 2782: A DNS RR for specifying the location of services
+                 (DNS SRV)
+       RFC 3492: Punycode: A Bootstring encoding of Unicode for
+                 Internationalized Domain Names in Applications
+                 (IDNA)
+       RFC 5891: Internationalizing Domain Names in Applications
+                 (IDNA): Protocol";
+   }
+
+   typedef host {
+     type union {
+       type inet:ip-address;
+       type inet:domain-name;
+     }
+     description
+      "The host type represents either an IP address or a DNS
+       domain name.";
+   }
+
+   typedef uri {
+     type string;
+     description
+      "The uri type represents a Uniform Resource Identifier
+       (URI) as defined by STD 66.
+
+       Objects using the uri type MUST be in US-ASCII encoding,
+       and MUST be normalized as described by RFC 3986 Sections
+       6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary
+       percent-encoding is removed, and all case-insensitive
+       characters are set to lowercase except for hexadecimal
+       digits, which are normalized to uppercase as described in
+       Section 6.2.2.1.
+
+       The purpose of this normalization is to help provide
+       unique URIs.  Note that this normalization is not
+       sufficient to provide uniqueness.  Two URIs that are
+       textually distinct after this normalization may still be
+       equivalent.
+
+       Objects using the uri type may restrict the schemes that
+       they permit.  For example, 'data:' and 'urn:' schemes
+       might not be appropriate.
+
+       A zero-length URI is not a valid URI.  This can be used to
+       express 'URI absent' where required.
+
+       In the value set and its semantics, this type is equivalent
+       to the Uri SMIv2 textual convention defined in RFC 5017.";
+     reference
+      "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
+       RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
+                 Group: Uniform Resource Identifiers (URIs), URLs,
+                 and Uniform Resource Names (URNs): Clarifications
+                 and Recommendations
+       RFC 5017: MIB Textual Conventions for Uniform Resource
+                 Identifiers (URIs)";
+   }
+
+ }
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-interfaces@2012-11-15.yang b/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-interfaces@2012-11-15.yang
new file mode 100644 (file)
index 0000000..481a5d2
--- /dev/null
@@ -0,0 +1,469 @@
+module ietf-interfaces {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
+  prefix if;
+
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2010-09-24;
+  }
+
+  organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     WG Chair: Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>
+
+     Editor:   Martin Bjorklund
+               <mailto:mbj@tail-f.com>";
+
+  description
+    "This module contains a collection of YANG definitions for
+     managing network interfaces.
+
+     Copyright (c) 2012 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC XXXX; see
+     the RFC itself for full legal notices.";
+
+  // RFC Ed.: replace XXXX with actual RFC number and remove this
+  // note.
+
+  // RFC Ed.: update the date below with the date of RFC publication
+  // and remove this note.
+  revision 2012-11-15 {
+    description
+      "Initial revision.";
+    reference
+      "RFC XXXX: A YANG Data Model for Interface Management";
+  }
+
+  /* Typedefs */
+
+  typedef interface-ref {
+    type leafref {
+      path "/if:interfaces/if:interface/if:name";
+    }
+    description
+      "This type is used by data models that need to reference
+       interfaces.";
+  }
+
+  /* Features */
+
+  feature arbitrary-names {
+    description
+      "This feature indicates that the server allows interfaces to
+       be named arbitrarily.";
+  }
+
+  feature if-mib {
+    description
+      "This feature indicates that the server implements IF-MIB.";
+    reference
+      "RFC 2863: The Interfaces Group MIB";
+  }
+
+  /* Data nodes */
+
+  container interfaces {
+    description
+      "Interface parameters.";
+
+    list interface {
+      key "name";
+      unique "type location";
+
+      description
+        "The list of interfaces on the device.";
+
+      leaf name {
+        type string;
+        description
+          "The name of the interface.
+
+           A device MAY restrict the allowed values for this leaf,
+           possibly depending on the type and location.
+
+           If the device allows arbitrarily named interfaces, the
+           feature 'arbitrary-names' is advertised.
+
+           This leaf MAY be mapped to ifName by an implementation.
+           Such an implementation MAY restrict the allowed values for
+           this leaf so that it matches the restrictions of ifName.
+           If a NETCONF server that implements this restriction is
+           sent a value that doesn't match the restriction, it MUST
+           reply with an rpc-error with the error-tag
+           'invalid-value'.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifName";
+      }
+
+      leaf description {
+        type string;
+        description
+          "A textual description of the interface.
+
+           This leaf MAY be mapped to ifAlias by an implementation.
+           Such an implementation MAY restrict the allowed values for
+           this leaf so that it matches the restrictions of ifAlias.
+           If a NETCONF server that implements this restriction is
+           sent a value that doesn't match the restriction, it MUST
+           reply with an rpc-error with the error-tag
+           'invalid-value'.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifAlias";
+      }
+
+      leaf location {
+        type string;
+        description
+          "The device-specific location of the interface of a
+           particular type.  The format of the location string
+           depends on the interface type and the device.
+
+           If the interface's type represents a physical interface,
+           this leaf MUST be set.
+
+           When an interface entry is created, a server MAY
+           initialize the location leaf with a valid value, e.g., if
+           it is possible to derive the location from the name of
+           the interface.";
+      }
+
+      leaf enabled {
+        type boolean;
+        default "true";
+        description
+          "The desired state of the interface.
+
+           This leaf contains the configured, desired state of the
+           interface.  Systems that implement the IF-MIB use the
+           value of this leaf to set IF-MIB.ifAdminStatus to 'up' or
+           'down' after an ifEntry has been initialized, as described
+           in RFC 2863.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+      }
+
+      leaf last-change {
+        type yang:date-and-time;
+        config false;
+        description
+          "The time the interface entered its current operational
+           state.  If the current state was entered prior to the
+           last re-initialization of the local network management
+           subsystem, then this node is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifLastChange";
+      }
+
+      leaf if-index {
+        if-feature if-mib;
+        type int32 {
+          range "1..2147483647";
+        }
+        config false;
+        description
+          "The ifIndex value for the ifEntry represented by this
+           interface.
+
+           Media-specific modules must specify how the type is
+           mapped to entries in the ifTable.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifIndex";
+      }
+
+      leaf phys-address {
+        type yang:phys-address;
+        config false;
+        description
+          "The interface's address at its protocol sub-layer.  For
+          example, for an 802.x interface, this object normally
+          contains a MAC address.  The interface's media-specific
+          modules must define the bit and byte ordering and the
+          format of the value of this object.  For interfaces that do
+          not have such an address (e.g., a serial line), this node
+          is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
+      }
+
+      leaf-list higher-layer-if {
+        type interface-ref;
+        config false;
+        description
+          "A list of references to interfaces layered on top of this
+           interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifStackTable";
+      }
+
+      leaf-list lower-layer-if {
+        type interface-ref;
+        config false;
+        description
+          "A list of references to interfaces layered underneath this
+           interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifStackTable";
+      }
+
+      leaf speed {
+        type yang:gauge64;
+        units "bits / second";
+        config false;
+        description
+            "An estimate of the interface's current bandwidth in bits
+             per second.  For interfaces which do not vary in
+             bandwidth or for those where no accurate estimation can
+             be made, this node should contain the nominal bandwidth.
+             For interfaces that has no concept of bandwidth, this
+             node is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB -
+                     ifSpeed, ifHighSpeed";
+      }
+
+      container statistics {
+        config false;
+        description
+          "A collection of interface-related statistics objects.";
+
+        leaf discontinuity-time {
+          type yang:date-and-time;
+          description
+            "The time on the most recent occasion at which any one or
+             more of this interface's counters suffered a
+             discontinuity.  If no such discontinuities have occurred
+             since the last re-initialization of the local management
+             subsystem, then this node contains the time the local
+             management subsystem re-initialized itself.";
+        }
+
+        leaf in-octets {
+          type yang:counter64;
+          description
+            "The total number of octets received on the interface,
+             including framing characters.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+        }
+        leaf in-unicast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were not addressed to a
+             multicast or broadcast address at this sub-layer.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+        }
+        leaf in-broadcast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were addressed to a broadcast
+             address at this sub-layer.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCInBroadcastPkts";
+        }
+        leaf in-multicast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were addressed to a multicast
+             address at this sub-layer.  For a MAC layer protocol,
+             this includes both Group and Functional addresses.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCInMulticastPkts";
+        }
+        leaf in-discards {
+          type yang:counter32;
+          description
+            "The number of inbound packets which were chosen to be
+             discarded even though no errors had been detected to
+             prevent their being deliverable to a higher-layer
+             protocol.  One possible reason for discarding such a
+             packet could be to free up buffer space.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+        }
+        leaf in-errors {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of inbound
+             packets that contained errors preventing them from being
+             deliverable to a higher-layer protocol.  For character-
+             oriented or fixed-length interfaces, the number of
+             inbound transmission units that contained errors
+             preventing them from being deliverable to a higher-layer
+             protocol.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInErrors";
+        }
+        leaf in-unknown-protos {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of packets
+             received via the interface which were discarded because
+             of an unknown or unsupported protocol.  For
+             character-oriented or fixed-length interfaces that
+             support protocol multiplexing the number of transmission
+             units received via the interface which were discarded
+             because of an unknown or unsupported protocol.  For any
+             interface that does not support protocol multiplexing,
+             this counter is not present.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+        }
+
+        leaf out-octets {
+          type yang:counter64;
+          description
+            "The total number of octets transmitted out of the
+             interface, including framing characters.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+        }
+        leaf out-unicast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were not addressed
+             to a multicast or broadcast address at this sub-layer,
+             including those that were discarded or not sent.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+        }
+        leaf out-broadcast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were addressed to a
+             broadcast address at this sub-layer, including those
+             that were discarded or not sent.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCOutBroadcastPkts";
+        }
+        leaf out-multicast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were addressed to a
+             multicast address at this sub-layer, including those
+             that were discarded or not sent.  For a MAC layer
+             protocol, this includes both Group and Functional
+             addresses.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCOutMulticastPkts";
+        }
+        leaf out-discards {
+          type yang:counter32;
+          description
+            "The number of outbound packets which were chosen to be
+             discarded even though no errors had been detected to
+             prevent their being transmitted.  One possible reason
+             for discarding such a packet could be to free up buffer
+             space.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+        }
+        leaf out-errors {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of outbound
+             packets that could not be transmitted because of errors.
+             For character-oriented or fixed-length interfaces, the
+             number of outbound transmission units that could not be
+             transmitted because of errors.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-yang-types@2010-09-24.yang b/opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-yang-types@2010-09-24.yang
new file mode 100644 (file)
index 0000000..e9d88ab
--- /dev/null
@@ -0,0 +1,396 @@
+ module ietf-yang-types {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
+   prefix "yang";
+
+   organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Partain
+               <mailto:david.partain@ericsson.com>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     Editor:   Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>";
+
+   description
+    "This module contains a collection of generally useful derived
+     YANG data types.
+
+     Copyright (c) 2010 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, is permitted pursuant to, and subject to the license
+     terms contained in, the Simplified BSD License set forth in Section
+     4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC 6021; see
+     the RFC itself for full legal notices.";
+
+   revision 2010-09-24 {
+     description
+      "Initial revision.";
+     reference
+      "RFC 6021: Common YANG Data Types";
+   }
+
+   /*** collection of counter and gauge types ***/
+
+   typedef counter32 {
+     type uint32;
+     description
+      "The counter32 type represents a non-negative integer
+       that monotonically increases until it reaches a
+       maximum value of 2^32-1 (4294967295 decimal), when it
+       wraps around and starts increasing again from zero.
+
+       Counters have no defined 'initial' value, and thus, a
+       single value of a counter has (in general) no information
+       content.  Discontinuities in the monotonically increasing
+       value normally occur at re-initialization of the
+       management system, and at other times as specified in the
+       description of a schema node using this type.  If such
+       other times can occur, for example, the creation of
+       a schema node of type counter32 at times other than
+       re-initialization, then a corresponding schema node
+       should be defined, with an appropriate type, to indicate
+       the last discontinuity.
+
+       The counter32 type should not be used for configuration
+       schema nodes.  A default statement SHOULD NOT be used in
+       combination with the type counter32.
+
+       In the value set and its semantics, this type is equivalent
+       to the Counter32 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef zero-based-counter32 {
+     type yang:counter32;
+     default "0";
+     description
+      "The zero-based-counter32 type represents a counter32
+       that has the defined 'initial' value zero.
+
+       A schema node of this type will be set to zero (0) on creation
+       and will thereafter increase monotonically until it reaches
+       a maximum value of 2^32-1 (4294967295 decimal), when it
+       wraps around and starts increasing again from zero.
+
+       Provided that an application discovers a new schema node
+       of this type within the minimum time to wrap, it can use the
+       'initial' value as a delta.  It is important for a management
+       station to be aware of this minimum time and the actual time
+       between polls, and to discard data if the actual time is too
+       long or there is no defined minimum time.
+
+       In the value set and its semantics, this type is equivalent
+       to the ZeroBasedCounter32 textual convention of the SMIv2.";
+     reference
+       "RFC 4502: Remote Network Monitoring Management Information
+                  Base Version 2";
+   }
+
+   typedef counter64 {
+     type uint64;
+     description
+      "The counter64 type represents a non-negative integer
+       that monotonically increases until it reaches a
+       maximum value of 2^64-1 (18446744073709551615 decimal),
+       when it wraps around and starts increasing again from zero.
+
+       Counters have no defined 'initial' value, and thus, a
+       single value of a counter has (in general) no information
+       content.  Discontinuities in the monotonically increasing
+       value normally occur at re-initialization of the
+       management system, and at other times as specified in the
+       description of a schema node using this type.  If such
+       other times can occur, for example, the creation of
+       a schema node of type counter64 at times other than
+       re-initialization, then a corresponding schema node
+       should be defined, with an appropriate type, to indicate
+       the last discontinuity.
+
+       The counter64 type should not be used for configuration
+       schema nodes.  A default statement SHOULD NOT be used in
+       combination with the type counter64.
+
+       In the value set and its semantics, this type is equivalent
+       to the Counter64 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef zero-based-counter64 {
+     type yang:counter64;
+     default "0";
+     description
+      "The zero-based-counter64 type represents a counter64 that
+       has the defined 'initial' value zero.
+
+       A schema node of this type will be set to zero (0) on creation
+       and will thereafter increase monotonically until it reaches
+       a maximum value of 2^64-1 (18446744073709551615 decimal),
+       when it wraps around and starts increasing again from zero.
+
+       Provided that an application discovers a new schema node
+       of this type within the minimum time to wrap, it can use the
+       'initial' value as a delta.  It is important for a management
+       station to be aware of this minimum time and the actual time
+       between polls, and to discard data if the actual time is too
+       long or there is no defined minimum time.
+
+       In the value set and its semantics, this type is equivalent
+       to the ZeroBasedCounter64 textual convention of the SMIv2.";
+     reference
+      "RFC 2856: Textual Conventions for Additional High Capacity
+                 Data Types";
+   }
+
+   typedef gauge32 {
+     type uint32;
+     description
+      "The gauge32 type represents a non-negative integer, which
+       may increase or decrease, but shall never exceed a maximum
+       value, nor fall below a minimum value.  The maximum value
+       cannot be greater than 2^32-1 (4294967295 decimal), and
+       the minimum value cannot be smaller than 0.  The value of
+       a gauge32 has its maximum value whenever the information
+       being modeled is greater than or equal to its maximum
+       value, and has its minimum value whenever the information
+       being modeled is smaller than or equal to its minimum value.
+       If the information being modeled subsequently decreases
+       below (increases above) the maximum (minimum) value, the
+       gauge32 also decreases (increases).
+
+       In the value set and its semantics, this type is equivalent
+       to the Gauge32 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef gauge64 {
+     type uint64;
+     description
+      "The gauge64 type represents a non-negative integer, which
+       may increase or decrease, but shall never exceed a maximum
+       value, nor fall below a minimum value.  The maximum value
+       cannot be greater than 2^64-1 (18446744073709551615), and
+       the minimum value cannot be smaller than 0.  The value of
+       a gauge64 has its maximum value whenever the information
+       being modeled is greater than or equal to its maximum
+       value, and has its minimum value whenever the information
+       being modeled is smaller than or equal to its minimum value.
+       If the information being modeled subsequently decreases
+       below (increases above) the maximum (minimum) value, the
+       gauge64 also decreases (increases).
+
+       In the value set and its semantics, this type is equivalent
+       to the CounterBasedGauge64 SMIv2 textual convention defined
+       in RFC 2856";
+     reference
+      "RFC 2856: Textual Conventions for Additional High Capacity
+                 Data Types";
+   }
+
+   /*** collection of identifier related types ***/
+
+   typedef object-identifier {
+     type string {
+       pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
+             + '(\.(0|([1-9]\d*)))*';
+     }
+     description
+      "The object-identifier type represents administratively
+       assigned names in a registration-hierarchical-name tree.
+
+       Values of this type are denoted as a sequence of numerical
+       non-negative sub-identifier values.  Each sub-identifier
+       value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers
+       are separated by single dots and without any intermediate
+       whitespace.
+
+       The ASN.1 standard restricts the value space of the first
+       sub-identifier to 0, 1, or 2.  Furthermore, the value space
+       of the second sub-identifier is restricted to the range
+       0 to 39 if the first sub-identifier is 0 or 1.  Finally,
+       the ASN.1 standard requires that an object identifier
+       has always at least two sub-identifier.  The pattern
+       captures these restrictions.
+
+       Although the number of sub-identifiers is not limited,
+       module designers should realize that there may be
+       implementations that stick with the SMIv2 limit of 128
+       sub-identifiers.
+
+       This type is a superset of the SMIv2 OBJECT IDENTIFIER type
+       since it is not restricted to 128 sub-identifiers.  Hence,
+       this type SHOULD NOT be used to represent the SMIv2 OBJECT
+       IDENTIFIER type, the object-identifier-128 type SHOULD be
+       used instead.";
+     reference
+      "ISO9834-1: Information technology -- Open Systems
+       Interconnection -- Procedures for the operation of OSI
+       Registration Authorities: General procedures and top
+       arcs of the ASN.1 Object Identifier tree";
+   }
+
+
+
+
+   typedef object-identifier-128 {
+     type object-identifier {
+       pattern '\d*(\.\d*){1,127}';
+     }
+     description
+      "This type represents object-identifiers restricted to 128
+       sub-identifiers.
+
+       In the value set and its semantics, this type is equivalent
+       to the OBJECT IDENTIFIER type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   /*** collection of date and time related types ***/
+
+   typedef date-and-time {
+     type string {
+       pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
+             + '(Z|[\+\-]\d{2}:\d{2})';
+     }
+     description
+      "The date-and-time type is a profile of the ISO 8601
+       standard for representation of dates and times using the
+       Gregorian calendar.  The profile is defined by the
+       date-time production in Section 5.6 of RFC 3339.
+
+       The date-and-time type is compatible with the dateTime XML
+       schema type with the following notable exceptions:
+
+       (a) The date-and-time type does not allow negative years.
+
+       (b) The date-and-time time-offset -00:00 indicates an unknown
+           time zone (see RFC 3339) while -00:00 and +00:00 and Z all
+           represent the same time zone in dateTime.
+
+       (c) The canonical format (see below) of data-and-time values
+           differs from the canonical format used by the dateTime XML
+           schema type, which requires all times to be in UTC using the
+           time-offset 'Z'.
+
+       This type is not equivalent to the DateAndTime textual
+       convention of the SMIv2 since RFC 3339 uses a different
+       separator between full-date and full-time and provides
+       higher resolution of time-secfrac.
+
+       The canonical format for date-and-time values with a known time
+       zone uses a numeric time zone offset that is calculated using
+       the device's configured known offset to UTC time.  A change of
+       the device's offset to UTC time will cause date-and-time values
+       to change accordingly.  Such changes might happen periodically
+       in case a server follows automatically daylight saving time
+       (DST) time zone offset changes.  The canonical format for
+       date-and-time values with an unknown time zone (usually referring
+       to the notion of local time) uses the time-offset -00:00.";
+     reference
+      "RFC 3339: Date and Time on the Internet: Timestamps
+       RFC 2579: Textual Conventions for SMIv2
+       XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
+   }
+
+   typedef timeticks {
+     type uint32;
+     description
+      "The timeticks type represents a non-negative integer that
+       represents the time, modulo 2^32 (4294967296 decimal), in
+       hundredths of a second between two epochs.  When a schema
+       node is defined that uses this type, the description of
+       the schema node identifies both of the reference epochs.
+
+       In the value set and its semantics, this type is equivalent
+       to the TimeTicks type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef timestamp {
+     type yang:timeticks;
+     description
+      "The timestamp type represents the value of an associated
+       timeticks schema node at which a specific occurrence happened.
+       The specific occurrence must be defined in the description
+       of any schema node defined using this type.  When the specific
+       occurrence occurred prior to the last time the associated
+       timeticks attribute was zero, then the timestamp value is
+       zero.  Note that this requires all timestamp values to be
+       reset to zero when the value of the associated timeticks
+       attribute reaches 497+ days and wraps around to zero.
+
+       The associated timeticks schema node must be specified
+       in the description of any schema node using this type.
+
+       In the value set and its semantics, this type is equivalent
+       to the TimeStamp textual convention of the SMIv2.";
+     reference
+      "RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   /*** collection of generic address types ***/
+
+   typedef phys-address {
+     type string {
+       pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+     }
+     description
+      "Represents media- or physical-level addresses represented
+       as a sequence octets, each octet represented by two hexadecimal
+       numbers.  Octets are separated by colons.  The canonical
+       representation uses lowercase characters.
+
+       In the value set and its semantics, this type is equivalent
+       to the PhysAddress textual convention of the SMIv2.";
+     reference
+      "RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   typedef mac-address {
+     type string {
+       pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
+     }
+     description
+      "The mac-address type represents an IEEE 802 MAC address.
+       The canonical representation uses lowercase characters.
+
+       In the value set and its semantics, this type is equivalent
+       to the MacAddress textual convention of the SMIv2.";
+     reference
+      "IEEE 802: IEEE Standard for Local and Metropolitan Area
+                 Networks: Overview and Architecture
+       RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   /*** collection of XML specific types ***/
+
+   typedef xpath1.0 {
+     type string;
+     description
+      "This type represents an XPATH 1.0 expression.
+
+       When a schema node is defined that uses this type, the
+       description of the schema node MUST specify the XPath
+       context in which the XPath expression is evaluated.";
+     reference
+      "XPATH: XML Path Language (XPath) Version 1.0";
+   }
+
+ }
\ No newline at end of file
index 71e24bc..ff84594 100644 (file)
@@ -27,11 +27,19 @@ public abstract class AbstractChildNodeBuilder implements ChildNodeBuilder {
         return qname;
     }
 
+    public Set<DataSchemaNodeBuilder> getChildNodes() {
+        return childNodes;
+    }
+
     @Override
     public void addChildNode(DataSchemaNodeBuilder childNode) {
         childNodes.add(childNode);
     }
 
+    public Set<GroupingBuilder> getGroupings() {
+        return groupings;
+    }
+
     @Override
     public void addGrouping(GroupingBuilder grouping) {
         groupings.add(grouping);
index 35446ce..02b4d7f 100644 (file)
@@ -1,7 +1,17 @@
+/*
+ * Copyright (c) 2013 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.yang.model.parser.builder.api;
 
 import org.opendaylight.controller.yang.model.api.TypeDefinition;
 
+/**
+ * Basic implementation for TypeAwareBuilder builders.
+ */
 public class AbstractTypeAwareBuilder implements TypeAwareBuilder {
 
     protected TypeDefinition<?> type;
index 71cf7a1..ef54c0b 100644 (file)
@@ -16,12 +16,13 @@ import org.opendaylight.controller.yang.model.api.Status;
 /**
  * Interface for builders of 'augment' statement.
  */
-public interface AugmentationSchemaBuilder extends ChildNodeBuilder, TypeDefinitionAwareBuilder {
+public interface AugmentationSchemaBuilder extends ChildNodeBuilder {
 
        void setDescription(String description);
        void setReference(String reference);
        void setStatus(Status status);
 
+       String getTargetPathAsString();
        SchemaPath getTargetPath();
 
        Set<DataSchemaNodeBuilder> getChildNodes();
index 7b4a191..0b435c1 100644 (file)
@@ -7,17 +7,17 @@
  */
 package org.opendaylight.controller.yang.model.parser.builder.api;
 
-import org.opendaylight.controller.yang.model.api.AugmentationSchema;
-
 /**
  * Interface for builders of those nodes, which can be augmentation targets.
  */
 public interface AugmentationTargetBuilder {
 
-       /**
-        * Add augment, which points to this node.
-        * @param augment augment which points to this node
-        */
-       void addAugmentation(AugmentationSchema augment);
+    /**
+     * Add augment, which points to this node.
+     *
+     * @param augment
+     *            augment which points to this node
+     */
+    void addAugmentation(AugmentationSchemaBuilder augment);
 
 }
index 7dc716a..dc29c8f 100644 (file)
@@ -10,14 +10,19 @@ package org.opendaylight.controller.yang.model.parser.builder.api;
 import org.opendaylight.controller.yang.common.QName;
 
 /**
- * Interface for all yang data-node containers [augment, case, container, grouping, list, module, notification].
+ * Interface for all yang data-node containers [augment, case, container,
+ * grouping, list, module, notification].
  */
 public interface ChildNodeBuilder extends Builder {
 
-       QName getQName();
-       void addChildNode(DataSchemaNodeBuilder childNode);
-       void addGrouping(GroupingBuilder groupingBuilder);
-       void addUsesNode(UsesNodeBuilder usesBuilder);
-       void addTypedef(TypeDefinitionBuilder typedefBuilder);
+    QName getQName();
+
+    void addChildNode(DataSchemaNodeBuilder childNode);
+
+    void addGrouping(GroupingBuilder groupingBuilder);
+
+    void addUsesNode(UsesNodeBuilder usesBuilder);
+
+    void addTypedef(TypeDefinitionBuilder typedefBuilder);
 
 }
index 3db0a5c..94355c8 100644 (file)
@@ -12,8 +12,11 @@ import org.opendaylight.controller.yang.model.api.GroupingDefinition;
 /**
  * Interface for builders of 'grouping' statement.
  */
-public interface GroupingBuilder extends ChildNodeBuilder, SchemaNodeBuilder, TypeDefinitionAwareBuilder {
+public interface GroupingBuilder extends ChildNodeBuilder, SchemaNodeBuilder,
+        TypeDefinitionAwareBuilder {
 
-       GroupingDefinition build();
+    DataSchemaNodeBuilder getChildNode(String name);
+
+    GroupingDefinition build();
 
 }
index b96347e..533e79d 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.yang.model.parser.builder.api;\r
 \r
 import org.opendaylight.controller.yang.common.QName;\r
+import org.opendaylight.controller.yang.model.api.SchemaNode;\r
 import org.opendaylight.controller.yang.model.api.SchemaPath;\r
 import org.opendaylight.controller.yang.model.api.Status;\r
 import org.opendaylight.controller.yang.model.parser.builder.impl.UnknownSchemaNodeBuilder;\r
@@ -19,6 +20,8 @@ public interface SchemaNodeBuilder extends Builder {
 \r
     QName getQName();\r
 \r
+    SchemaPath getPath();\r
+\r
     void setPath(SchemaPath schemaPath);\r
 \r
     void setDescription(String description);\r
@@ -27,6 +30,8 @@ public interface SchemaNodeBuilder extends Builder {
 \r
     void setStatus(Status status);\r
 \r
-    void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownSchemaNodeBuilder);\r
+    void addUnknownSchemaNode(UnknownSchemaNodeBuilder unknownNode);\r
+\r
+    SchemaNode build();\r
 \r
 }\r
index 1f808eb..99add7c 100644 (file)
@@ -7,15 +7,23 @@
  */
 package org.opendaylight.controller.yang.model.parser.builder.api;
 
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.SchemaPath;
 import org.opendaylight.controller.yang.model.api.UsesNode;
+import org.opendaylight.controller.yang.model.parser.util.RefineHolder;
 
 /**
  * Interface for builders of 'uses' statement.
  */
 public interface UsesNodeBuilder extends Builder {
 
+    SchemaPath getGroupingPath();
     void addAugment(AugmentationSchemaBuilder builder);
     void setAugmenting(boolean augmenting);
+    List<RefineHolder> getRefines();
+    void setRefines(List<RefineHolder> refines);
+    void addRefineNode(SchemaNodeBuilder refineNode);
     UsesNode build();
 
 }
diff --git a/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/AnyXmlBuilder.java b/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/model/parser/builder/impl/AnyXmlBuilder.java
new file mode 100644 (file)
index 0000000..212e2f8
--- /dev/null
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2013 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.yang.model.parser.builder.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.AnyXmlSchemaNode;
+import org.opendaylight.controller.yang.model.api.ConstraintDefinition;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.parser.builder.api.DataSchemaNodeBuilder;
+
+public class AnyXmlBuilder implements DataSchemaNodeBuilder {
+    private final QName qname;
+    private SchemaPath path;
+    private final AnyXmlSchemaNodeImpl instance;
+    private final ConstraintsBuilder constraints = new ConstraintsBuilder();
+    private final List<UnknownSchemaNodeBuilder> addedUnknownNodes = new ArrayList<UnknownSchemaNodeBuilder>();
+
+    private String description;
+    private String reference;
+    private Status status = Status.CURRENT;
+    private boolean configuration;
+
+    public AnyXmlBuilder(final QName qname) {
+        this.qname = qname;
+        instance = new AnyXmlSchemaNodeImpl(qname);
+    }
+
+    @Override
+    public AnyXmlSchemaNode build() {
+        instance.setPath(path);
+        instance.setConstraints(constraints.build());
+        instance.setDescription(description);
+        instance.setReference(reference);
+        instance.setStatus(status);
+
+        // UNKNOWN NODES
+        final List<UnknownSchemaNode> unknownNodes = new ArrayList<UnknownSchemaNode>();
+        for (UnknownSchemaNodeBuilder b : addedUnknownNodes) {
+            unknownNodes.add(b.build());
+        }
+        instance.setUnknownSchemaNodes(unknownNodes);
+
+        instance.setConfiguration(configuration);
+        return instance;
+    }
+
+    @Override
+    public QName getQName() {
+        return qname;
+    }
+
+    public SchemaPath getPath() {
+        return path;
+    }
+
+    @Override
+    public void setPath(final SchemaPath path) {
+        this.path = path;
+    }
+
+    @Override
+    public ConstraintsBuilder getConstraints() {
+        return constraints;
+    }
+
+    @Override
+    public void addUnknownSchemaNode(final UnknownSchemaNodeBuilder unknownNode) {
+        addedUnknownNodes.add(unknownNode);
+    }
+
+    public List<UnknownSchemaNodeBuilder> getUnknownNodes() {
+        return addedUnknownNodes;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    @Override
+    public void setDescription(final String description) {
+        this.description = description;
+    }
+
+    public String getReference() {
+        return reference;
+    }
+
+    @Override
+    public void setReference(final String reference) {
+        this.reference = reference;
+    }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    @Override
+    public void setStatus(final Status status) {
+        if (status != null) {
+            this.status = status;
+        }
+    }
+
+    @Override
+    public void setAugmenting(final boolean augmenting) {
+        throw new UnsupportedOperationException(
+                "An anyxml node cannot be augmented.");
+    }
+
+    public boolean isConfiguration() {
+        return configuration;
+    }
+
+    @Override
+    public void setConfiguration(final boolean configuration) {
+        instance.setConfiguration(configuration);
+    }
+
+    private static class AnyXmlSchemaNodeImpl implements AnyXmlSchemaNode {
+        private final QName qname;
+        private SchemaPath path;
+        private String description;
+        private String reference;
+        private Status status = Status.CURRENT;
+        private boolean configuration;
+        private ConstraintDefinition constraintsDef;
+        private List<UnknownSchemaNode> unknownNodes = Collections.emptyList();
+
+        private AnyXmlSchemaNodeImpl(final QName qname) {
+            this.qname = qname;
+        }
+
+        @Override
+        public QName getQName() {
+            return qname;
+        }
+
+        @Override
+        public SchemaPath getPath() {
+            return path;
+        }
+
+        private void setPath(final SchemaPath path) {
+            this.path = path;
+        }
+
+        @Override
+        public String getDescription() {
+            return description;
+        }
+
+        private void setDescription(String description) {
+            this.description = description;
+        }
+
+        @Override
+        public String getReference() {
+            return reference;
+        }
+
+        private void setReference(String reference) {
+            this.reference = reference;
+        }
+
+        @Override
+        public Status getStatus() {
+            return status;
+        }
+
+        private void setStatus(Status status) {
+            if (status != null) {
+                this.status = status;
+            }
+        }
+
+        @Override
+        public boolean isAugmenting() {
+            return false;
+        }
+
+        @Override
+        public boolean isConfiguration() {
+            return configuration;
+        }
+
+        private void setConfiguration(boolean configuration) {
+            this.configuration = configuration;
+        }
+
+        @Override
+        public ConstraintDefinition getConstraints() {
+            return constraintsDef;
+        }
+
+        private void setConstraints(ConstraintDefinition constraintsDef) {
+            this.constraintsDef = constraintsDef;
+        }
+
+        @Override
+        public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+            return unknownNodes;
+        }
+
+        private void setUnknownSchemaNodes(List<UnknownSchemaNode> unknownNodes) {
+            if (unknownNodes != null) {
+                this.unknownNodes = unknownNodes;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((qname == null) ? 0 : qname.hashCode());
+            result = prime * result + ((path == null) ? 0 : path.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+   &n