Merge "Add IfNewHostNotify to DeviceManager"
authorGiovanni Meo <gmeo@cisco.com>
Sat, 15 Jun 2013 09:14:15 +0000 (09:14 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 15 Jun 2013 09:14:15 +0000 (09:14 +0000)
147 files changed:
opendaylight/clustering/integrationtest/pom.xml
opendaylight/clustering/services_implementation/src/main/resources/config/infinispan-config.xml
opendaylight/commons/integrationtest/pom.xml
opendaylight/commons/opendaylight/logback.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/commons/opendaylight/sun_coding_style.xml
opendaylight/commons/parent/logback.xml
opendaylight/configuration/integrationtest/.gitignore [new file with mode: 0644]
opendaylight/configuration/integrationtest/pom.xml [new file with mode: 0644]
opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java [new file with mode: 0644]
opendaylight/configuration/integrationtest/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/containermanager/implementation/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/assemble/bin.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-server.xml
opendaylight/distribution/opendaylight/src/main/resources/run.bat
opendaylight/distribution/p2site/pom.xml
opendaylight/distribution/parents/README [new file with mode: 0644]
opendaylight/distribution/parents/pom.xml [new file with mode: 0644]
opendaylight/distribution/sdk/pom.xml
opendaylight/distribution/sdk/src/assemble/bin.xml
opendaylight/forwarding/staticrouting/pom.xml
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java
opendaylight/northbound/commons/pom.xml
opendaylight/northbound/flowprogrammer/enunciate.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/hosttracker/enunciate.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/integrationtest/pom.xml
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/northbound/integrationtest/src/test/resources/tomcat-server.xml
opendaylight/northbound/staticrouting/enunciate.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/statistics/enunciate.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/statistics/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/subnets/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/switchmanager/enunciate.xml
opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/topology/enunciate.xml
opendaylight/northbound/topology/src/main/resources/WEB-INF/web.xml
opendaylight/northboundtest/unit_test_suite/pom.xml
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/PriorityMessage.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6FlowMod.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6Match.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsRequest.java
opendaylight/protocol_plugins/stub/pom.xml
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/MacAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/address/DataLinkAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/address/EthernetAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/topology/TopoEdgeUpdate.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenEnumResolvingTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenTypesSubSetTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/Types.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedTOBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/ClassCodeGenerator.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/Constants.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/GeneratorUtil.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/ClassCodeGeneratorTest.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferIdentityObject.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/WildcardType.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/GeneratedTOBuilder.java
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/AdditionalConfig/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Correct/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest2/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Generator/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/MissingYangInDep/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoGenerators/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoOutputDir/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoYangFiles/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/UnknownGenerator/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/YangRootNotExist/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang/pom.xml
opendaylight/sal/yang-prototype/code-generator/pom.xml
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/pom.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-api/pom.xml
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/pom.xml
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataNodeContainerBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/UsesNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AugmentationSchemaBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ModuleBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/RpcDefinitionBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UsesNodeBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserListenerImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserUtils.java
opendaylight/sal/yang-prototype/yang/pom.xml
opendaylight/sal/yang-prototype/yang/yang-binding/pom.xml
opendaylight/sal/yang-prototype/yang/yang-binding/src/main/java/org/opendaylight/controller/yang/binding/BaseIdentity.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-common/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/DataNodeIterator.java
opendaylight/samples/northbound/loadbalancer/enunciate.xml
opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/web.xml
opendaylight/statisticsmanager/api/pom.xml
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Switch.java
opendaylight/switchmanager/integrationtest/pom.xml
opendaylight/topologymanager/src/test/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImplTest.java
opendaylight/usermanager/api/pom.xml [moved from opendaylight/usermanager/pom.xml with 95% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/AuthResponse.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/AuthResponse.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/AuthorizationConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/AuthorizationConfig.java with 89% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/IAAAProvider.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IAAAProvider.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ISessionManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ISessionManager.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java with 97% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ODLUserLevel.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ODLUserLevel.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ServerConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/ServerConfig.java with 97% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserConfig.java with 99% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/AuthResponseTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/AuthResponseTest.java with 100% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/AuthorizationUserConfigTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthorizationUserConfigTest.java with 96% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/ServerConfigTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/ServerConfigTest.java with 85% similarity]
opendaylight/usermanager/implementation/pom.xml [new file with mode: 0644]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/Activator.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/Activator.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUser.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUser.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java with 99% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/security/UserSecurityContextRepository.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/UserSecurityContextRepository.java with 100% similarity]
opendaylight/usermanager/implementation/src/test/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUserTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUserTest.java with 100% similarity]
opendaylight/usermanager/implementation/src/test/java/org/opendaylight/controller/usermanager/internal/UserManagerImplTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/UserManagerImplTest.java with 97% similarity]
opendaylight/web/devices/src/main/resources/WEB-INF/Devices-servlet.xml
opendaylight/web/devices/src/main/resources/WEB-INF/web.xml
opendaylight/web/flows/src/main/resources/WEB-INF/Flows-servlet.xml
opendaylight/web/flows/src/main/resources/WEB-INF/web.xml
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java
opendaylight/web/root/src/main/resources/WEB-INF/RootGUI-servlet.xml
opendaylight/web/root/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/root/src/main/resources/WEB-INF/web.xml
opendaylight/web/topology/src/main/resources/WEB-INF/Topology-servlet.xml
opendaylight/web/topology/src/main/resources/WEB-INF/web.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/Troubleshoot-servlet.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml

index 460b09e9dad81856dc5dde0892e073fdf8b2f7f6..52c568203be917dd42c347afbb616b9f907c5b9c 100644 (file)
@@ -32,7 +32,7 @@
       <artifactId>sal.implementation</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
-       <dependency>
+    <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>clustering.services-implementation</artifactId>
       <version>0.4.0-SNAPSHOT</version>
index 03a9b4d93e4ad17c89f41976c9a33a3d20bfc359..2aa3fdb849b6fb02a65eeb5a626ec293a1fd8817 100644 (file)
@@ -19,7 +19,7 @@
     <!--
         Used to register JMX statistics in any available MBean server
     -->
-    <jmxStatistics enabled="true"/>    
+    <jmxStatistics enabled="true"/>
   </default>
   <!-- transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" -->
   <namedCache name="transactional-type">
index 1f4b442ea4e1224d2c7460b3c0c263461e1bf420..4cd858274950c56e82bbc7a038c6970128e0d58b 100644 (file)
       <version>0.8.0.v201110170705</version>
     </dependency>
   </dependencies>
-  
+
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <skipTests>true</skipTests>
+        </configuration>
+      </plugin>
       <plugin>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>maven-paxexam-plugin</artifactId>
index 043ceef3293cbcc99c9b6e37f972bc34d8619bb4..05e607573e72d9fde8df6d67fbfb0e602073899e 100644 (file)
@@ -1,11 +1,11 @@
 <configuration scan="true">
-  
+
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>
   </appender>
-  
+
   <root level="error">
     <appender-ref ref="STDOUT" />
   </root>
index 4062e1839b5a112ab16fed674e1c03b6c47efebb..c3c9a5cd1ee719679ad6eab99f19427797d02ded 100644 (file)
@@ -24,7 +24,8 @@
     <projectinfo>2.6</projectinfo>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <compiler.version>2.3.2</compiler.version>
-    <surefire.version>2.13</surefire.version>
+    <surefire.version>2.15</surefire.version>
+    <failsafe.version>2.15</failsafe.version>
     <exam.version>3.0.0</exam.version>
     <url.version>1.5.0</url.version>
     <enunciate.version>1.26.2</enunciate.version>
           <configLocation>${project.parent.basedir}/space_and_tabs_checks.xml</configLocation>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
+          <sourceDirectory>${project.basedir}</sourceDirectory>
+          <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
-        <version>2.14.1</version>
+        <version>${failsafe.version}</version>
         <executions>
           <execution>
             <goals>
               <goal>integration-test</goal>
-              <goal>verify</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
index f4516b913dd89fe5eb840dd9a3412945a98d254a..cb2c2c8b20f5d3c9e3aba4b0c2a853c946ea1916 100644 (file)
@@ -74,7 +74,7 @@
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
index 043ceef3293cbcc99c9b6e37f972bc34d8619bb4..05e607573e72d9fde8df6d67fbfb0e602073899e 100644 (file)
@@ -1,11 +1,11 @@
 <configuration scan="true">
-  
+
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>
   </appender>
-  
+
   <root level="error">
     <appender-ref ref="STDOUT" />
   </root>
diff --git a/opendaylight/configuration/integrationtest/.gitignore b/opendaylight/configuration/integrationtest/.gitignore
new file mode 100644 (file)
index 0000000..f92f363
--- /dev/null
@@ -0,0 +1 @@
+configuration
diff --git a/opendaylight/configuration/integrationtest/pom.xml b/opendaylight/configuration/integrationtest/pom.xml
new file mode 100644 (file)
index 0000000..037b435
--- /dev/null
@@ -0,0 +1,91 @@
+<?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.integrationtest</artifactId>
+    <version>0.5.0-SNAPSHOT</version>
+    <relativePath>../../commons/integrationtest</relativePath>
+  </parent>
+  <artifactId>configuration.integrationtest</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>protocol_plugins.stub</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+    </dependency>
+     <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.implementation</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>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services-implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.stub</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager.implementation</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>switchmanager.implementation</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>configuration.implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+      <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topologymanager</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java b/opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java
new file mode 100644 (file)
index 0000000..8e1f34e
--- /dev/null
@@ -0,0 +1,212 @@
+package org.opendaylight.controller.configuration.internal;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.File;
+
+import javax.inject.Inject;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.IConfigurationService;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+public class ConfigurationIT {
+    private Logger logger = LoggerFactory
+            .getLogger(ConfigurationIT.class);
+    // get the OSGI bundle context
+    @Inject
+    private BundleContext bc;
+    private IClusterServices clusterService = null;
+    private IConfigurationService configService = null;
+
+    // Configure the OSGi container
+    @Configuration
+    public Option[] config() {
+        return options(
+                systemProperty("logback.configurationFile").value(
+                        "file:" + PathUtils.getBaseDir()
+                                + "/src/test/resources/logback.xml"),
+                // To start OSGi console for inspection remotely
+                systemProperty("osgi.console").value("2401"),
+                // Set the systemPackages (used by clustering)
+                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
+                // List framework bundles
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
+                        "1.0.0.v20120522-1841"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
+                        "1.0.400.v20120522-2049"),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
+                        "3.3.100.v20120522-1822"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
+                        "1.4.0.v20120522-1841"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
+                        "0.8.0.v201108120515"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
+                        "0.8.0.v201108120515"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
+                        "0.8.0.v201110170705"),
+                // List logger bundles
+                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
+                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
+                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
+                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
+                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
+                mavenBundle("org.jboss.spec.javax.transaction",
+                        "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
+                mavenBundle("org.apache.felix",
+                        "org.apache.felix.dependencymanager", "3.1.0"),
+                // List all the bundles on which the test case depends
+                mavenBundle("org.opendaylight.controller", "sal",
+                        "0.5.0-SNAPSHOT"), // SAL connects the protocols
+                                           // plug-ins to other stuff
+                mavenBundle("org.opendaylight.controller",
+                        "sal.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
+                // needed bundles by switchmanager
+                mavenBundle("org.opendaylight.controller", "containermanager",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "containermanager.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "switchmanager",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "switchmanager.implementation", "0.4.0-SNAPSHOT"),
+                // needed bundles by configuration
+                mavenBundle("org.opendaylight.controller",
+                        "clustering.services", "0.4.0-SNAPSHOT"), // what are
+                                                                  // the
+                                                                  // clustering
+                                                                  // services
+                                                                  // for
+                mavenBundle("org.opendaylight.controller", "clustering.stub",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "clustering.services-implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "configuration",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "configuration.implementation", "0.4.0-SNAPSHOT"),
+                junitBundles());
+    }
+
+    private String stateToString(int state) {
+        switch (state) {
+        case Bundle.ACTIVE:
+            return "ACTIVE";
+        case Bundle.INSTALLED:
+            return "INSTALLED";
+        case Bundle.RESOLVED:
+            return "RESOLVED";
+        case Bundle.UNINSTALLED:
+            return "UNINSTALLED";
+        default:
+            return "Not CONVERTED";
+        }
+    }
+
+    @Before
+    public void areWeReadyForClustering() {
+        assertNotNull(bc);
+        boolean debugit = false;
+        Bundle b[] = bc.getBundles();
+        for (int i = 0; i < b.length; i++) {
+            int state = b[i].getState();
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
+                logger.debug("Bundle:" + b[i].getSymbolicName() + " state:"
+                        + stateToString(state));
+                debugit = true;
+            }
+        }
+        if (debugit) {
+            logger.debug("Do some debugging because some bundle is unresolved");
+        }
+
+        // Assert if true, if false we are good to go!
+        assertFalse(debugit);
+        ServiceReference r = bc.getServiceReference(IClusterServices.class
+                .getName());
+        if (r != null) {
+            this.clusterService = (IClusterServices) bc.getService(r);
+        }
+        // If StatisticsManager is null, cannot run tests.
+        assertNotNull(this.clusterService);
+
+    }
+
+    @Before
+    public void areWeReadyForConfiguration() {
+        assertNotNull(bc);
+        boolean debugit = false;
+        Bundle b[] = bc.getBundles();
+        for (int i = 0; i < b.length; i++) {
+            int state = b[i].getState();
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
+                logger.debug("Bundle:" + b[i].getSymbolicName() + " state:"
+                        + stateToString(state));
+                debugit = true;
+            }
+        }
+        if (debugit) {
+            logger.debug("Do some debugging because some bundle is unresolved");
+        }
+
+        // Assert if true, if false we are good to go!
+        assertFalse(debugit);
+        ServiceReference r = bc.getServiceReference(IConfigurationService.class
+                .getName());
+        if (r != null) {
+            this.configService = (IConfigurationService) bc.getService(r);
+        }
+        // If StatisticsManager is null, cannot run tests.
+        assertNotNull(this.configService);
+
+    }
+
+    @Test
+    public void saveConfiguration() {
+        File f = new File(GlobalConstants.STARTUPHOME.toString());
+        boolean success = f.exists();
+        if (!success) {
+            success = f.mkdirs();
+        }
+        if(success){
+            Status status = new Status(StatusCode.SUCCESS, null);
+            if (this.configService != null) {
+                status = this.configService.saveConfigurations();
+            }
+            if (status.getCode().equals(StatusCode.SUCCESS)) {
+                Assert.assertTrue("Successfully saved config for "
+                        + configService.getClass().getSimpleName(), status
+                        .getCode().equals(StatusCode.SUCCESS));
+            } else {
+                Assert.assertFalse("Failed to save config for "
+                        + configService.getClass().getSimpleName(), status
+                        .getCode().equals(StatusCode.INTERNALERROR));
+            }
+        }
+    }
+
+}
diff --git a/opendaylight/configuration/integrationtest/src/test/resources/logback.xml b/opendaylight/configuration/integrationtest/src/test/resources/logback.xml
new file mode 100644 (file)
index 0000000..2d63ce5
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </pattern>
+    </encoder>
+  </appender>
+
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+</configuration>
index 42ff3387f7ff8e2ed7de26976789fde3d8712178..a324fca0d9f838fd905e79b66526cf3a7e7c2bac 100644 (file)
       <artifactId>containermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
-       <dependency>
+    <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
       <version>0.5.0-SNAPSHOT</version>
-       </dependency> 
+    </dependency>
   </dependencies>
 </project>
index 765dea5337bb65c0ccb218892a788d389363ea95..50b34faac847f8a084e44b42cee41d93c2cc3a81 100644 (file)
@@ -38,6 +38,7 @@
     <module>../../clustering/test</module>
     <module>../../configuration/api</module>
     <module>../../configuration/implementation</module>
+    <module>../../configuration/integrationtest</module>
     <module>../../routing/dijkstra_implementation</module>
     <module>../../arphandler</module>
     <module>../../forwardingrulesmanager/api</module>
@@ -57,7 +58,8 @@
     <module>../../statisticsmanager/implementation</module>
     <module>../../statisticsmanager/integrationtest</module>
     <module>../../topologymanager</module>
-    <module>../../usermanager</module>
+    <module>../../usermanager/api</module>
+    <module>../../usermanager/implementation</module>
     <module>../../security</module>
 
 
     <module>../../samples/northbound/loadbalancer</module>
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
-    
+
   </modules>
 
   <build>
index 8be21f6450735266c4092ffa054ef3e18c021d66..67a473581301ef749a8561dc77945aa5640e24d4 100644 (file)
@@ -1,6 +1,6 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
   <id>osgipackage</id>
   <formats>
     <format>dir</format>
@@ -12,9 +12,9 @@
       <excludes>
         <exclude>org.opendaylight.controller.thirdparty:org.openflow.openflowj</exclude>
         <exclude>org.opendaylight.controller:clustering.stub</exclude>
-               <exclude>org.opendaylight.controller:logging.bridge</exclude>
-               <exclude>org.opendaylight.controller:protocol_plugins.stub</exclude>
-               <exclude>org.opendaylight.controller:*.integrationtest</exclude>
+        <exclude>org.opendaylight.controller:logging.bridge</exclude>
+        <exclude>org.opendaylight.controller:protocol_plugins.stub</exclude>
+        <exclude>org.opendaylight.controller:*.integrationtest</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new.implementation</exclude>
       </excludes>
         <includeDependencies>false</includeDependencies>
       </binaries>
     </moduleSet>
-       <moduleSet>
-         <includes>
-               <include>org.opendaylight.controller:logging.bridge</include>
-         </includes>
-         <binaries>
-               <outputDirectory>opendaylight/lib</outputDirectory>
-               <outputFileNameMapping>
-                 ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
-               </outputFileNameMapping>
-               <unpack>false</unpack>
-               <includeDependencies>false</includeDependencies>
-         </binaries>
-       </moduleSet>
+    <moduleSet>
+      <includes>
+        <include>org.opendaylight.controller:logging.bridge</include>
+      </includes>
+      <binaries>
+        <outputDirectory>opendaylight/lib</outputDirectory>
+        <outputFileNameMapping>
+          ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
+        </outputFileNameMapping>
+        <unpack>false</unpack>
+        <includeDependencies>false</includeDependencies>
+      </binaries>
+    </moduleSet>
   </moduleSets>
   <dependencySets>
     <dependencySet>
         <exclude>virgomirror:org.eclipse.jdt.core.compiler.batch</exclude>
         <exclude>org.apache.felix:org.apache.felix.fileinstall</exclude>
         <exclude>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</exclude>
-               <exclude>org.slf4j:slf4j-api</exclude>
-               <exclude>ch.qos.logback:logback-core</exclude>
-               <exclude>ch.qos.logback:logback-classic</exclude>
-               <exclude>com.sun.jersey:jersey-core</exclude>
-               <exclude>com.sun.jersey:jersey-json</exclude>
-               <exclude>com.sun.jersey:jersey-server</exclude>
+        <exclude>org.slf4j:slf4j-api</exclude>
+        <exclude>ch.qos.logback:logback-core</exclude>
+        <exclude>ch.qos.logback:logback-classic</exclude>
+        <exclude>com.sun.jersey:jersey-core</exclude>
+        <exclude>com.sun.jersey:jersey-json</exclude>
+        <exclude>com.sun.jersey:jersey-server</exclude>
       </excludes>
       <outputFileNameMapping>
-        ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}      
+        ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
       </outputFileNameMapping>
       <unpack>false</unpack>
       <scope>runtime</scope>
         <include>virgomirror:org.eclipse.jdt.core.compiler.batch</include>
         <include>org.apache.felix:org.apache.felix.fileinstall</include>
         <include>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</include>
-               <include>org.slf4j:slf4j-api</include>
-               <include>ch.qos.logback:logback-core</include>
-               <include>ch.qos.logback:logback-classic</include>
-               <include>com.sun.jersey:jersey-core</include>
-               <include>com.sun.jersey:jersey-json</include>
-               <include>com.sun.jersey:jersey-server</include>
+        <include>org.slf4j:slf4j-api</include>
+        <include>ch.qos.logback:logback-core</include>
+        <include>ch.qos.logback:logback-classic</include>
+        <include>com.sun.jersey:jersey-core</include>
+        <include>com.sun.jersey:jersey-json</include>
+        <include>com.sun.jersey:jersey-server</include>
       </includes>
       <useTransitiveDependencies>false</useTransitiveDependencies>
       <outputFileNameMapping>
-        ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}      
+        ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
       </outputFileNameMapping>
       <unpack>false</unpack>
       <scope>runtime</scope>
index a8d7beb49b560c65f0c52c03271b31f3704cd318..460145ee8729d949dd6b0ef664be74d7947dd3ac 100644 (file)
@@ -1,13 +1,13 @@
 osgi.bundles=\
-       reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\
-       reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\
-       reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\
-       reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\
-       reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\
-       reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\
-       reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\
-       reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\
-       reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\
+    reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\
+    reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\
+    reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\
+    reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\
+    reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\
+    reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\
+    reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\
+    reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\
+    reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\
     reference\:file\:../lib/logging.bridge-0.4.0-SNAPSHOT@1:start,\
     reference\:file\:../lib/jersey-core-1.17.jar@2:start,\
     reference\:file\:../lib/jersey-json-1.17.jar@2:start,\
@@ -19,7 +19,7 @@ osgi.bundles.defaultStartLevel=4
 org.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc
 # This is not Eclipse App
 eclipse.ignoreApp=true
-# Don't shutdown equinox if the eclipse App has ended, 
+# Don't shutdown equinox if the eclipse App has ended,
 # which is our case because we are not running any eclipse application
 osgi.noShutdown=true
 # Clean any cached data on restart of the framework
@@ -33,7 +33,7 @@ felix.fileinstall.dir=./plugins
 felix.fileinstall.noInitialDelay=true
 # Auto start the bundles at level 4
 felix.fileinstall.start.level=4
-# Avoid to auto-install following bundles, that means those need 
+# Avoid to auto-install following bundles, that means those need
 # to be started manually or in other way like osgi.bundles
 felix.fileinstall.filter=^(?!org.apache.felix.fileinstall).*
 
@@ -69,7 +69,7 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 
 # TLS configuration
 # To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files.
-# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate 
+# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate
 # entries, including switches' Certification Authority (CA) certificates. For example,
 # secureChannelEnabled=true
 # controllerKeyStore=./configuration/ctlKeyStore
index a99d17d37c25de4816fc108da4a0e5879326fa2b..de70a52a3118e60fb450cc1cb57905ce996ad67b 100644 (file)
@@ -54,5 +54,5 @@
   <logger name="org.opendaylight.controller.topologymanager" level="INFO"/>
   <logger name="org.opendaylight.controller.usermanager" level="INFO"/>
   <!-- Web modules -->
-  <logger name="org.opendaylight.controller.web" level="INFO"/>        
+  <logger name="org.opendaylight.controller.web" level="INFO"/>
 </configuration>
index 4be075451e9c31f90260e6e39b7dc43008a47c1f..56d469b59932f591b93cd91eb7e491ab3c683085 100644 (file)
                connectionTimeout="20000"
                redirectPort="8443" />
 
-<!-- 
-       Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
-       Remember to add a valid keystore in the configuration folder.
-       More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration 
+<!--
+        Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
+        Remember to add a valid keystore in the configuration folder.
+        More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
 -->
- <!-- 
+
+ <!--
     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                maxThreads="150" scheme="https" secure="true"
                clientAuth="false" sslProtocol="TLS"
             unpackWARs="false" autoDeploy="false"
             deployOnStartup="false" createDirs="false">
         <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
-           <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-     
+            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
-                       prefix="web_access_log_" suffix=".txt" resolveHosts="false"
-                       rotatable="true" fileDateFormat="yyyy-MM"
-                       pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
-               
+                        prefix="web_access_log_" suffix=".txt" resolveHosts="false"
+                        rotatable="true" fileDateFormat="yyyy-MM"
+                        pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
+
       </Host>
     </Engine>
   </Service>
index 79a00f33e429db354b34e69a176e9b2a428b595c..6fb9f0655cc4bbfe310dfac27d4354f7160710f3 100644 (file)
@@ -2,7 +2,7 @@
 SETLOCAL
 SETLOCAL ENABLEDELAYEDEXPANSION
 IF EXIST "%JAVA_HOME%" (
-               set basedir=%~dp0
+        set basedir=%~dp0
 REM       Now set the classpath:
                 set cp="!basedir!lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;!basedir!lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;!basedir!lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"
 
@@ -19,4 +19,4 @@ REM echo %JAVA_HOME%\bin\java.exe %* -Djava.io.tmpdir=!basedir!work\tmp -Dosgi.i
     ECHO JAVA_HOME environment variable is not set
     PAUSE
 )
-ENDLOCAL
\ No newline at end of file
+ENDLOCAL
index 2efb6747f8c27366d692676dfb413e6dc94ae949..e7c7f4906ed3d0661e784d9c601bd8d67075422a 100644 (file)
@@ -29,7 +29,7 @@
   <artifactId>distribution.p2site</artifactId>
   <version>0.1.0-SNAPSHOT</version>
   <packaging>pom</packaging>
-  
+
   <build>
     <plugins>
       <plugin>
diff --git a/opendaylight/distribution/parents/README b/opendaylight/distribution/parents/README
new file mode 100644 (file)
index 0000000..3d6e356
--- /dev/null
@@ -0,0 +1,14 @@
+OVERVIEW
+========
+This distribution is built to allow to deploy all the commons parents
+in one shot. This is needed because the way how maven works when a
+"mvn deploy" is called on a multi-module project, only the modules
+that are listed in there are deployed. All the opendaylight modules
+has a parent, those parents module will not be deployed when deploying
+a distribution hence if someone tries to compile a module without
+compiling the whole system it will run in missing parent errors.
+To address the issue this distribution will collect all the known
+parents and deploy them in one shot.
+
+The user of this distribution is one of the Jenkins jobs and not
+developers.
diff --git a/opendaylight/distribution/parents/pom.xml b/opendaylight/distribution/parents/pom.xml
new file mode 100644 (file)
index 0000000..5387717
--- /dev/null
@@ -0,0 +1,24 @@
+<?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>
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+  <artifactId>distribution.parents</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>../../commons/concepts</module>
+    <module>../../commons/integrationtest</module>
+    <module>../../commons/opendaylight</module>
+    <module>../../../third-party/commons/thirdparty</module>
+  </modules>
+</project>
index b4afa61b61214a80c639e45eb11b66bcf891b251..07ba376a566c8c6904bb44f414d8ec16744efd1b 100644 (file)
@@ -38,7 +38,7 @@
     <!-- Northbound common hooks -->
     <module>../../northbound/commons</module>
   </modules>
-  
+
   <build>
     <plugins>
       <plugin>
index bb3c6734f694e6b598e63669c8300da83585a773..b2f45c38c907701fb2c4997a167b2c44b97d6adf 100644 (file)
@@ -1,4 +1,4 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
   <id>package</id>
index 80eea57b8f50b31e96fb91aba965b961b9336fcf..ea22c4f1ca4c03952a419c67a05b2a16daea13db 100644 (file)
@@ -70,7 +70,7 @@
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
       <version>0.4.0-SNAPSHOT</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
index 5d9a5e180310bf8bb98e042201dd45e59b442dc5..8345b5adbceb4b12d8cf03b25f330513d829ce0c 100644 (file)
@@ -18,7 +18,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Host;
 import org.opendaylight.controller.sal.core.Node;
@@ -172,15 +171,10 @@ public class HostNodeConnector extends Host {
         return !Arrays.equals(emptyArray, macaddr);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.lang.Object#toString()
-     */
     @Override
     public String toString() {
-        return "HostNodeConnector[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "HostNodeConnector [nodeConnector=" + nodeConnector + ", vlan="
+                + vlan + ", staticHost=" + staticHost + "]";
     }
 
     public boolean isV4Host() {
index 7c0835a9033b027381cc37f70d2d632468e1373a..56da363d3eaf6d748c4a4cdc0925710fe31f759e 100644 (file)
@@ -33,7 +33,7 @@
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.containermanager,
               org.opendaylight.controller.usermanager,
-              javax.servlet.http, 
+              javax.servlet.http,
               org.slf4j
             </Import-Package>
           </instructions>
index a49d9f8265f4b0a9da8b24387a4a9d58337997f9..90bf6de1d67e13b542fb4d6a2e1a6896995d0e8e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/flow"/>
   </services>
index 0a873ca0651013728d404a71798d670ac8b03eb2..c7e9a771c1d71f7c7913e2c26b1e9fe11264979b 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>    
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
@@ -43,7 +43,7 @@
               org.opendaylight.controller.northbound.commons.utils,
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.usermanager,
-                         com.sun.jersey.spi.container.servlet,                            
+                          com.sun.jersey.spi.container.servlet,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
@@ -70,7 +70,7 @@
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
       <version>${enunciate.version}</version>
     </dependency>
     <dependency>
-         <groupId>org.opendaylight.controller</groupId>
-         <artifactId>commons.northbound</artifactId>
-         <version>0.4.0-SNAPSHOT</version>
-       </dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>commons.northbound</artifactId>
+          <version>0.4.0-SNAPSHOT</version>
+        </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
index 83f7e4b35d89e9891ef99e0cebd38ec17d45b213..4cedf2df8975bd6414fd28920dcd8db5c41b3183 100644 (file)
@@ -1,51 +1,51 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
-  
-       <servlet>
-         <servlet-name>JAXRSFlowProgrammer</servlet-name>
-         <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-         <init-param>
-           <param-name>javax.ws.rs.Application</param-name>
-           <param-value>org.opendaylight.controller.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
-         </init-param>
-         <load-on-startup>1</load-on-startup>
-       </servlet>
-       
-       <servlet-mapping>
-         <servlet-name>JAXRSFlowProgrammer</servlet-name>
-         <url-pattern>/*</url-pattern>
-       </servlet-mapping>
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
+
+        <servlet>
+          <servlet-name>JAXRSFlowProgrammer</servlet-name>
+          <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+          <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.opendaylight.controller.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
+          </init-param>
+          <load-on-startup>1</load-on-startup>
+        </servlet>
+
+        <servlet-mapping>
+          <servlet-name>JAXRSFlowProgrammer</servlet-name>
+          <url-pattern>/*</url-pattern>
+        </servlet-mapping>
+
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
-    
     <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
-       
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
+
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 8f0d7e6ab8f9b5a865d4d0b5eabbc2e6c3220ae8..e0c7dcd2ac7a9e85bc293786b6fd8b1d606fa2cb 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/host"/>
   </services>
index 853c54ec2c9f36c693f68095b1d30b361c5105ea..f0caa52d6396bf2bf97fd969475cbccb707aec43 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>    
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
index 7eb940875a6b8af8366e4b4793418bcf3160149f..0fa8b95dd00368600f7cfcc26196b4eca07adda0 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSHostTracker</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index aa4469e452f32ac793a1027724a4df98a289c97e..90acc8c59f0e9358a1bd735107c5093afcaa1988 100644 (file)
       <artifactId>jersey-core</artifactId>
       <version>${jersey.version}</version>
     </dependency>
-    <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId> 
+    <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId>
       <version>${jersey.version}</version> </dependency> -->
     <dependency>
       <groupId>com.sun.jersey</groupId>
 
   </dependencies>
 </project>
-
index 112725976fa979a3ea2dce55c1f96369709cacc3..103a515607a49b043475ca59925c545d6d439586 100644 (file)
@@ -41,11 +41,9 @@ import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.controller.usermanager.IUserManager;
 
-
 @RunWith(PaxExam.class)
 public class NorthboundIT {
-    private Logger log = LoggerFactory
-            .getLogger(NorthboundIT.class);
+    private Logger log = LoggerFactory.getLogger(NorthboundIT.class);
     // get the OSGI bundle context
     @Inject
     private BundleContext bc;
@@ -257,7 +255,157 @@ public class NorthboundIT {
     }
 
     @Test
-    public void testSwitchManager() {
+    public void testSubnetsNorthbound() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/subnet/";
+
+        String name1 = "testSubnet1";
+        String subnet1 = "1.1.1.1/24";
+        String name2 = "testSubnet2";
+        String subnet2 = "2.2.2.2/24";
+
+        // Test GET subnets in default container
+        String result = getJsonResult(baseURL + "default");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertEquals("{}", result);
+
+        // Test GET subnet1 expecting 404
+        result = getJsonResult(baseURL + "default/" + name1);
+        Assert.assertEquals(404, httpResponseCode.intValue());
+
+        // Test POST subnet1
+        String queryParameter = new QueryParameter("subnetName", name1).add(
+                "subnet", subnet1).getString();
+        result = getJsonResult(baseURL + "default/" + name1 + queryParameter,
+                "POST");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test GET subnet1
+        result = getJsonResult(baseURL + "default/" + name1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertEquals(200, httpResponseCode.intValue());
+        Assert.assertEquals(name1, json.getString("@name"));
+        Assert.assertEquals(subnet1, json.getString("@subnet"));
+
+        // Test POST subnet2
+        queryParameter = new QueryParameter("subnetName", name2).add("subnet",
+                subnet2).getString();
+        result = getJsonResult(baseURL + "default/" + name2 + queryParameter,
+                "POST");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test GET all subnets in default container
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONArray subnetConfigArray = json.getJSONArray("subnetConfig");
+        JSONObject subnetConfig;
+        Assert.assertEquals(2, subnetConfigArray.length());
+        for (int i = 0; i < subnetConfigArray.length(); i++) {
+            subnetConfig = subnetConfigArray.getJSONObject(i);
+            if (subnetConfig.getString("@name").equals(name1)) {
+                Assert.assertEquals(subnet1, subnetConfig.getString("@subnet"));
+            } else if (subnetConfig.getString("@name").equals(name2)) {
+                Assert.assertEquals(subnet2, subnetConfig.getString("@subnet"));
+            } else {
+                // Unexpected config name
+                Assert.assertTrue(false);
+            }
+        }
+
+        // Test DELETE subnet1
+        result = getJsonResult(baseURL + "default/" + name1, "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Test GET deleted subnet1
+        result = getJsonResult(baseURL + "default/" + name1);
+        Assert.assertEquals(404, httpResponseCode.intValue());
+
+    }
+
+    @Test
+    public void testStaticRoutingNorthbound() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/staticroute/";
+
+        String name1 = "testRoute1";
+        String prefix1 = "192.168.1.1/24";
+        String nextHop1 = "0.0.0.0";
+        String name2 = "testRoute2";
+        String prefix2 = "192.168.1.1/16";
+        String nextHop2 = "1.1.1.1";
+
+        // Test GET static routes in default container, expecting no results
+        String result = getJsonResult(baseURL + "default");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertEquals("{}", result);
+
+        // Test insert static route
+        String requestBody = "{\"name\":\"" + name1 + "\", \"prefix\":\""
+                + prefix1 + "\", \"nextHop\":\"" + nextHop1 + "\"}";
+        result = getJsonResult(baseURL + "default/" + name1, "POST",
+                requestBody);
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        requestBody = "{\"name\":\"" + name2 + "\", \"prefix\":\"" + prefix2
+                + "\", \"nextHop\":\"" + nextHop2 + "\"}";
+        result = getJsonResult(baseURL + "default/" + name2, "POST",
+                requestBody);
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test Get all static routes
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONArray staticRoutes = json.getJSONArray("staticRoute");
+        Assert.assertEquals(2, staticRoutes.length());
+        JSONObject route;
+        for (int i = 0; i < staticRoutes.length(); i++) {
+            route = staticRoutes.getJSONObject(i);
+            if (route.getString("name").equals(name1)) {
+                Assert.assertEquals(prefix1, route.getString("prefix"));
+                Assert.assertEquals(nextHop1, route.getString("nextHop"));
+            } else if (route.getString("name").equals(name2)) {
+                Assert.assertEquals(prefix2, route.getString("prefix"));
+                Assert.assertEquals(nextHop2, route.getString("nextHop"));
+            } else {
+                // static route has unknown name
+                Assert.assertTrue(false);
+            }
+        }
+
+        // Test get specific static route
+        result = getJsonResult(baseURL + "default/" + name1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertEquals(name1, json.getString("name"));
+        Assert.assertEquals(prefix1, json.getString("prefix"));
+        Assert.assertEquals(nextHop1, json.getString("nextHop"));
+
+        result = getJsonResult(baseURL + "default/" + name2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertEquals(name2, json.getString("name"));
+        Assert.assertEquals(prefix2, json.getString("prefix"));
+        Assert.assertEquals(nextHop2, json.getString("nextHop"));
+
+        // Test delete static route
+        result = getJsonResult(baseURL + "default/" + name1, "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject singleStaticRoute = json.getJSONObject("staticRoute");
+        Assert.assertEquals(name2, singleStaticRoute.getString("name"));
+
+    }
+
+    @Test
+    public void testSwitchManager() throws JSONException {
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/switch/default/";
 
         // define Node/NodeConnector attributes for test
@@ -280,203 +428,166 @@ public class NorthboundIT {
         int ncBandwidth = 1000000000;
 
         // Test GET all nodes
-        try {
-            String result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-
-            // Test for first node
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_1, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
-
-            // Test 2nd node, properties of 2nd node same as first node
-            node = getJsonInstance(json, "nodeProperties", nodeId_2);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
-
-            // Test 3rd node, properties of 3rd node same as first node
-            node = getJsonInstance(json, "nodeProperties", nodeId_3);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_3, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        String result = getJsonResult(baseURL + "nodes");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+
+        // Test for first node
+        JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_1, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
+
+        // Test 2nd node, properties of 2nd node same as first node
+        node = getJsonInstance(json, "nodeProperties", nodeId_2);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
+
+        // Test 3rd node, properties of 3rd node same as first node
+        node = getJsonInstance(json, "nodeProperties", nodeId_3);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_3, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
 
         // Test GET nodeConnectors of a node
-        try {
-            //Test first node
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-            //Test second node
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-            //Test third node
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_3);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_3, ncType, nodeId_3, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Test first node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject nodeConnectorProperties = json
+                .getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
+
+        // Test second node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2,
+                ncType, nodeId_2, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
+
+        // Test third node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_3);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_3,
+                ncType, nodeId_3, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
 
         // Test delete node property
-        try {
-            // Delete timestamp property from node1
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/timeStamp", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            // Check node1
-            result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_1, nodeType, null, null,
-                    actionsValue_1, capabilitiesValue_1, tablesValue_1,
-                    buffersValue_1);
-
-            // Delete actions property from node2
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2
-                    + "/property/actions", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            // Check node2
-            result = getJsonResult(baseURL + "nodes");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node = getJsonInstance(json, "nodeProperties", nodeId_2);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
-                    timestampName_1, null, capabilitiesValue_1, tablesValue_1,
-                    buffersValue_1);
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Delete timestamp property from node1
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/timeStamp", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Check node1
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_1, nodeType, null, null,
+                actionsValue_1, capabilitiesValue_1, tablesValue_1,
+                buffersValue_1);
+
+        // Delete actions property from node2
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2
+                + "/property/actions", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Check node2
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_2);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
+                timestampName_1, null, capabilitiesValue_1, tablesValue_1,
+                buffersValue_1);
 
         // Test add property to node
-        try {
-            // Add Tier and Bandwidth property to node1
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/tier/1001", "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/bandwidth/1002", "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-
-            // Test for first node
-            result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            Assert.assertEquals(1001, node.getJSONObject("properties")
-                    .getJSONObject("tier").getInt("tierValue"));
-            Assert.assertEquals(1002, node.getJSONObject("properties")
-                    .getJSONObject("bandwidth").getInt("bandwidthValue"));
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Add Tier and Bandwidth property to node1
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/tier/1001", "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/bandwidth/1002", "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test for first node
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        Assert.assertEquals(1001, node.getJSONObject("properties")
+                .getJSONObject("tier").getInt("tierValue"));
+        Assert.assertEquals(1002, node.getJSONObject("properties")
+                .getJSONObject("bandwidth").getInt("bandwidthValue"));
 
         // Test delete nodeConnector property
-        try {
-            // Delete state property of nodeconnector1
-            String result = getJsonResult(baseURL + "nodeconnector/STUB/"
-                    + nodeId_1 + "/STUB/" + nodeConnectorId_1
-                    + "/property/state", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
-                    ncCapabilities, ncBandwidth);
-
-            // Delete capabilities property of nodeconnector2
-            result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2
-                    + "/STUB/" + nodeConnectorId_2 + "/property/capabilities",
-                    "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
-                    null, ncBandwidth);
+        // Delete state property of nodeconnector1
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_1
+                + "/STUB/" + nodeConnectorId_1 + "/property/state", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, null, ncCapabilities, ncBandwidth);
+
+        // Delete capabilities property of nodeconnector2
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2
+                + "/STUB/" + nodeConnectorId_2 + "/property/capabilities",
+                "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2,
+                ncType, nodeId_2, nodeType, ncState, null, ncBandwidth);
 
         // Test PUT nodeConnector property
-        try {
-            int newBandwidth = 1001;
-
-            // Add Name/Bandwidth property to nodeConnector1
-            String result = getJsonResult(baseURL + "nodeconnector/STUB/"
-                    + nodeId_1 + "/STUB/" + nodeConnectorId_1
-                    + "/property/bandwidth/" + newBandwidth, "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            // Check for new bandwidth value, state value removed from previous
-            // test
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
-                    ncCapabilities, newBandwidth);
+        int newBandwidth = 1001;
+
+        // Add Name/Bandwidth property to nodeConnector1
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_1
+                + "/STUB/" + nodeConnectorId_1 + "/property/bandwidth/"
+                + newBandwidth, "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        // Check for new bandwidth value, state value removed from previous
+        // test
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, null, ncCapabilities, newBandwidth);
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
     }
 
     @Test
-    public void testStatistics() {
+    public void testStatistics() throws JSONException {
         String actionTypes[] = { "drop", "loopback", "flood", "floodAll",
                 "controller", "swPath", "hwPath", "output", "setDlSrc",
                 "setDlDst", "setDlType", "setVlanId", "setVlanPcp",
@@ -485,262 +596,247 @@ public class NorthboundIT {
         System.out.println("Starting Statistics JAXB client.");
 
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/statistics/default/";
-        try {
-            String result = getJsonResult(baseURL + "flowstats");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject flowStatistics = getJsonInstance(json, "flowStatistics",
-                    0xCAFE);
-            JSONObject node = flowStatistics.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-
-            // test that flow statistics results are correct
-            JSONArray flowStats = flowStatistics.getJSONArray("flowStat");
-            for (int i = 0; i < flowStats.length(); i++) {
-
-                JSONObject flowStat = flowStats.getJSONObject(i);
-                testFlowStat(flowStat, actionTypes[i]);
 
-            }
+        String result = getJsonResult(baseURL + "flowstats");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        JSONObject flowStatistics = getJsonInstance(json, "flowStatistics",
+                0xCAFE);
+        JSONObject node = flowStatistics.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
 
-            // for /controller/nb/v2/statistics/default/portstats
-            result = getJsonResult(baseURL + "portstats");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            JSONObject portStatistics = getJsonInstance(json, "portStatistics",
-                    0xCAFE);
-            JSONObject node2 = portStatistics.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node2.getString("@type").equals("STUB"));
-
-            // test that port statistic results are correct
-            JSONObject portStat = portStatistics.getJSONObject("portStat");
-            Assert.assertTrue(portStat.getInt("receivePackets") == 250);
-            Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
-            Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
-            Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
-            Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
-            Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
-            Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
-            Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
-            Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
-            Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
-            Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
-            Assert.assertTrue(portStat.getInt("collisionCount") == 4);
-
-            // test for getting one specific node's stats
-            result = getJsonResult(baseURL + "flowstats/STUB/51966");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node = json.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-
-            // test that flow statistics results are correct
-            flowStats = json.getJSONArray("flowStat");
-            for (int i = 0; i < flowStats.length(); i++) {
-                JSONObject flowStat = flowStats.getJSONObject(i);
-                testFlowStat(flowStat, actionTypes[i]);
-            }
+        // test that flow statistics results are correct
+        JSONArray flowStats = flowStatistics.getJSONArray("flowStat");
+        for (int i = 0; i < flowStats.length(); i++) {
 
-            result = getJsonResult(baseURL + "portstats/STUB/51966");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node2 = json.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node2.getString("@type").equals("STUB"));
-
-            // test that port statistic results are correct
-            portStat = json.getJSONObject("portStat");
-            Assert.assertTrue(portStat.getInt("receivePackets") == 250);
-            Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
-            Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
-            Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
-            Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
-            Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
-            Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
-            Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
-            Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
-            Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
-            Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
-            Assert.assertTrue(portStat.getInt("collisionCount") == 4);
+            JSONObject flowStat = flowStats.getJSONObject(i);
+            testFlowStat(flowStat, actionTypes[i]);
 
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
+        }
 
+        // for /controller/nb/v2/statistics/default/portstats
+        result = getJsonResult(baseURL + "portstats");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject portStatistics = getJsonInstance(json, "portStatistics",
+                0xCAFE);
+        JSONObject node2 = portStatistics.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node2.getString("@type").equals("STUB"));
+
+        // test that port statistic results are correct
+        JSONObject portStat = portStatistics.getJSONObject("portStat");
+        Assert.assertTrue(portStat.getInt("receivePackets") == 250);
+        Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
+        Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
+        Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
+        Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
+        Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
+        Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
+        Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
+        Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
+        Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
+        Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
+        Assert.assertTrue(portStat.getInt("collisionCount") == 4);
+
+        // test for getting one specific node's stats
+        result = getJsonResult(baseURL + "flowstats/STUB/51966");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = json.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
+
+        // test that flow statistics results are correct
+        flowStats = json.getJSONArray("flowStat");
+        for (int i = 0; i < flowStats.length(); i++) {
+            JSONObject flowStat = flowStats.getJSONObject(i);
+            testFlowStat(flowStat, actionTypes[i]);
         }
+
+        result = getJsonResult(baseURL + "portstats/STUB/51966");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node2 = json.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node2.getString("@type").equals("STUB"));
+
+        // test that port statistic results are correct
+        portStat = json.getJSONObject("portStat");
+        Assert.assertTrue(portStat.getInt("receivePackets") == 250);
+        Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
+        Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
+        Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
+        Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
+        Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
+        Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
+        Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
+        Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
+        Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
+        Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
+        Assert.assertTrue(portStat.getInt("collisionCount") == 4);
     }
 
-    private void testFlowStat(JSONObject flowStat, String actionType) {
-        try {
-            Assert.assertTrue(flowStat.getInt("tableId") == 1);
-            Assert.assertTrue(flowStat.getInt("durationSeconds") == 40);
-            Assert.assertTrue(flowStat.getInt("durationNanoseconds") == 400);
-            Assert.assertTrue(flowStat.getInt("packetCount") == 200);
-            Assert.assertTrue(flowStat.getInt("byteCount") == 100);
-
-            // test that flow information is correct
-            JSONObject flow = flowStat.getJSONObject("flow");
-            Assert.assertTrue(flow.getInt("priority") == 3500);
-            Assert.assertTrue(flow.getInt("idleTimeout") == 1000);
-            Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
-            Assert.assertTrue(flow.getInt("id") == 12345);
-
-            JSONObject match = (flow.getJSONObject("match")
-                    .getJSONObject("matchField"));
-            Assert.assertTrue(match.getString("type").equals("NW_DST"));
-            Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
-
-            JSONObject act = flow.getJSONObject("actions");
-            Assert.assertTrue(act.getString("@type").equals(actionType));
-
-            if (act.getString("@type").equals("output")) {
-                JSONObject port = act.getJSONObject("port");
-                JSONObject port_node = port.getJSONObject("node");
-                Assert.assertTrue(port.getInt("@id") == 51966);
-                Assert.assertTrue(port.getString("@type").equals("STUB"));
-                Assert.assertTrue(port_node.getInt("@id") == 51966);
-                Assert.assertTrue(port_node.getString("@type").equals("STUB"));
-            }
+    private void testFlowStat(JSONObject flowStat, String actionType)
+            throws JSONException {
+        Assert.assertTrue(flowStat.getInt("tableId") == 1);
+        Assert.assertTrue(flowStat.getInt("durationSeconds") == 40);
+        Assert.assertTrue(flowStat.getInt("durationNanoseconds") == 400);
+        Assert.assertTrue(flowStat.getInt("packetCount") == 200);
+        Assert.assertTrue(flowStat.getInt("byteCount") == 100);
+
+        // test that flow information is correct
+        JSONObject flow = flowStat.getJSONObject("flow");
+        Assert.assertTrue(flow.getInt("priority") == 3500);
+        Assert.assertTrue(flow.getInt("idleTimeout") == 1000);
+        Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
+        Assert.assertTrue(flow.getInt("id") == 12345);
+
+        JSONObject match = (flow.getJSONObject("match")
+                .getJSONObject("matchField"));
+        Assert.assertTrue(match.getString("type").equals("NW_DST"));
+        Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
+
+        JSONObject act = flow.getJSONObject("actions");
+        Assert.assertTrue(act.getString("@type").equals(actionType));
+
+        if (act.getString("@type").equals("output")) {
+            JSONObject port = act.getJSONObject("port");
+            JSONObject port_node = port.getJSONObject("node");
+            Assert.assertTrue(port.getInt("@id") == 51966);
+            Assert.assertTrue(port.getString("@type").equals("STUB"));
+            Assert.assertTrue(port_node.getInt("@id") == 51966);
+            Assert.assertTrue(port_node.getString("@type").equals("STUB"));
+        }
 
-            if (act.getString("@type").equals("setDlSrc")) {
-                byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2,
-                        (byte) 1 };
-                String src = act.getString("address");
-                byte srcBytes[] = new byte[5];
-                srcBytes[0] = Byte.parseByte(src.substring(0, 2));
-                srcBytes[1] = Byte.parseByte(src.substring(2, 4));
-                srcBytes[2] = Byte.parseByte(src.substring(4, 6));
-                srcBytes[3] = Byte.parseByte(src.substring(6, 8));
-                srcBytes[4] = Byte.parseByte(src.substring(8, 10));
-                Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
-            }
+        if (act.getString("@type").equals("setDlSrc")) {
+            byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2,
+                    (byte) 1 };
+            String src = act.getString("address");
+            byte srcBytes[] = new byte[5];
+            srcBytes[0] = Byte.parseByte(src.substring(0, 2));
+            srcBytes[1] = Byte.parseByte(src.substring(2, 4));
+            srcBytes[2] = Byte.parseByte(src.substring(4, 6));
+            srcBytes[3] = Byte.parseByte(src.substring(6, 8));
+            srcBytes[4] = Byte.parseByte(src.substring(8, 10));
+            Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
+        }
 
-            if (act.getString("@type").equals("setDlDst")) {
-                byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4,
-                        (byte) 5 };
-                String dst = act.getString("address");
-                byte dstBytes[] = new byte[5];
-                dstBytes[0] = Byte.parseByte(dst.substring(0, 2));
-                dstBytes[1] = Byte.parseByte(dst.substring(2, 4));
-                dstBytes[2] = Byte.parseByte(dst.substring(4, 6));
-                dstBytes[3] = Byte.parseByte(dst.substring(6, 8));
-                dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
-                Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
-            }
-            if (act.getString("@type").equals("setDlType"))
-                Assert.assertTrue(act.getInt("dlType") == 10);
-            if (act.getString("@type").equals("setVlanId"))
-                Assert.assertTrue(act.getInt("vlanId") == 2);
-            if (act.getString("@type").equals("setVlanPcp"))
-                Assert.assertTrue(act.getInt("pcp") == 3);
-            if (act.getString("@type").equals("setVlanCfi"))
-                Assert.assertTrue(act.getInt("cfi") == 1);
-
-            if (act.getString("@type").equals("setNwSrc"))
-                Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
-            if (act.getString("@type").equals("setNwDst"))
-                Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
-
-            if (act.getString("@type").equals("pushVlan")) {
-                int head = act.getInt("VlanHeader");
-                // parsing vlan header
-                int id = head & 0xfff;
-                int cfi = (head >> 12) & 0x1;
-                int pcp = (head >> 13) & 0x7;
-                int tag = (head >> 16) & 0xffff;
-                Assert.assertTrue(id == 1234);
-                Assert.assertTrue(cfi == 1);
-                Assert.assertTrue(pcp == 1);
-                Assert.assertTrue(tag == 0x8100);
-            }
-            if (act.getString("@type").equals("setNwTos"))
-                Assert.assertTrue(act.getInt("tos") == 16);
-            if (act.getString("@type").equals("setTpSrc"))
-                Assert.assertTrue(act.getInt("port") == 4201);
-            if (act.getString("@type").equals("setTpDst"))
-                Assert.assertTrue(act.getInt("port") == 8080);
-        } catch (Exception e) {
-            Assert.assertTrue(false);
+        if (act.getString("@type").equals("setDlDst")) {
+            byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4,
+                    (byte) 5 };
+            String dst = act.getString("address");
+            byte dstBytes[] = new byte[5];
+            dstBytes[0] = Byte.parseByte(dst.substring(0, 2));
+            dstBytes[1] = Byte.parseByte(dst.substring(2, 4));
+            dstBytes[2] = Byte.parseByte(dst.substring(4, 6));
+            dstBytes[3] = Byte.parseByte(dst.substring(6, 8));
+            dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
+            Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
+        }
+        if (act.getString("@type").equals("setDlType"))
+            Assert.assertTrue(act.getInt("dlType") == 10);
+        if (act.getString("@type").equals("setVlanId"))
+            Assert.assertTrue(act.getInt("vlanId") == 2);
+        if (act.getString("@type").equals("setVlanPcp"))
+            Assert.assertTrue(act.getInt("pcp") == 3);
+        if (act.getString("@type").equals("setVlanCfi"))
+            Assert.assertTrue(act.getInt("cfi") == 1);
+
+        if (act.getString("@type").equals("setNwSrc"))
+            Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
+        if (act.getString("@type").equals("setNwDst"))
+            Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
+
+        if (act.getString("@type").equals("pushVlan")) {
+            int head = act.getInt("VlanHeader");
+            // parsing vlan header
+            int id = head & 0xfff;
+            int cfi = (head >> 12) & 0x1;
+            int pcp = (head >> 13) & 0x7;
+            int tag = (head >> 16) & 0xffff;
+            Assert.assertTrue(id == 1234);
+            Assert.assertTrue(cfi == 1);
+            Assert.assertTrue(pcp == 1);
+            Assert.assertTrue(tag == 0x8100);
         }
+        if (act.getString("@type").equals("setNwTos"))
+            Assert.assertTrue(act.getInt("tos") == 16);
+        if (act.getString("@type").equals("setTpSrc"))
+            Assert.assertTrue(act.getInt("port") == 4201);
+        if (act.getString("@type").equals("setTpDst"))
+            Assert.assertTrue(act.getInt("port") == 8080);
     }
 
     @Test
-    public void testFlowProgrammer() {
-        try {
-            String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
-            // Attempt to get a flow that doesn't exit. Should return 404
-            // status.
-            String result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
-            Assert.assertTrue(result.equals("404"));
-
-            // test add flow1
-            String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
-            Assert.assertTrue(httpResponseCode == 201);
-
-            // test get returns flow that was added.
-            result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
-            // check that result came out fine.
-            Assert.assertTrue(httpResponseCode == 200);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            Assert.assertTrue(json.getString("name").equals("test1"));
-            Assert.assertTrue(json.getString("actions").equals("DROP"));
-            Assert.assertTrue(json.getString("installInHw").equals("true"));
-            JSONObject node = json.getJSONObject("node");
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-            Assert.assertTrue(node.getString("@id").equals("51966"));
-            // test adding same flow again fails due to repeat name..return 409
-            // code
-            result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
-            Assert.assertTrue(result.equals("409"));
-
-            fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
-            // test should return 500 for error due to same flow being added.
-            Assert.assertTrue(result.equals("500"));
-
-            // add second flow that's different
-            fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
-            Assert.assertTrue(httpResponseCode == 201);
-
-            // check that request returns both flows given node.
-            result = getJsonResult(baseURL + "STUB/51966/", "GET");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
-            JSONArray ja = json.getJSONArray("flowConfig");
-            Integer count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            // check that request returns both flows given just container.
-            result = getJsonResult(baseURL);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
-            ja = json.getJSONArray("flowConfig");
-            count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            // delete a flow, check that it's no longer in list.
-            result = getJsonResult(baseURL + "STUB/51966/test2", "DELETE");
-            Assert.assertTrue(httpResponseCode == 200);
-
-            result = getJsonResult(baseURL + "STUB/51966/test2", "GET");
-            Assert.assertTrue(result.equals("404"));
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
-
+    public void testFlowProgrammer() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
+        // Attempt to get a flow that doesn't exit. Should return 404
+        // status.
+        String result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
+        Assert.assertTrue(result.equals("404"));
+
+        // test add flow1
+        String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
+        Assert.assertTrue(httpResponseCode == 201);
+
+        // test get returns flow that was added.
+        result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
+        // check that result came out fine.
+        Assert.assertTrue(httpResponseCode == 200);
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertTrue(json.getString("name").equals("test1"));
+        Assert.assertTrue(json.getString("actions").equals("DROP"));
+        Assert.assertTrue(json.getString("installInHw").equals("true"));
+        JSONObject node = json.getJSONObject("node");
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
+        Assert.assertTrue(node.getString("@id").equals("51966"));
+        // test adding same flow again fails due to repeat name..return 409
+        // code
+        result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
+        Assert.assertTrue(result.equals("409"));
+
+        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
+        // test should return 500 for error due to same flow being added.
+        Assert.assertTrue(result.equals("500"));
+
+        // add second flow that's different
+        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
+        Assert.assertTrue(httpResponseCode == 201);
+
+        // check that request returns both flows given node.
+        result = getJsonResult(baseURL + "STUB/51966/", "GET");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
+        JSONArray ja = json.getJSONArray("flowConfig");
+        Integer count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        // check that request returns both flows given just container.
+        result = getJsonResult(baseURL);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
+        ja = json.getJSONArray("flowConfig");
+        count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        // delete a flow, check that it's no longer in list.
+        result = getJsonResult(baseURL + "STUB/51966/test2", "DELETE");
+        Assert.assertTrue(httpResponseCode == 200);
+
+        result = getJsonResult(baseURL + "STUB/51966/test2", "GET");
+        Assert.assertTrue(result.equals("404"));
     }
 
     // method to extract a JSONObject with specified node ID from a JSONObject
@@ -792,7 +888,7 @@ public class NorthboundIT {
     }
 
     @Test
-    public void testHostTracker() {
+    public void testHostTracker() throws JSONException {
 
         System.out.println("Starting HostTracker JAXB client.");
 
@@ -818,34 +914,29 @@ public class NorthboundIT {
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/host/default";
 
         // test POST method: addHost()
-        try {
-            String queryParameter = new QueryParameter("dataLayerAddress",
-                    dataLayerAddress_1).add("nodeType", nodeType_1)
-                    .add("nodeId", nodeId_1.toString())
-                    .add("nodeConnectorType", nodeConnectorType_1)
-                    .add("nodeConnectorId", nodeConnectorId_1.toString())
-                    .add("vlan", vlan_1).getString();
-
-            String result = getJsonResult(baseURL + "/" + networkAddress_1
-                    + queryParameter, "POST");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
-
-            // vlan is not passed through query parameter but should be
-            // defaulted to "0"
-            queryParameter = new QueryParameter("dataLayerAddress",
-                    dataLayerAddress_2).add("nodeType", nodeType_2)
-                    .add("nodeId", nodeId_2.toString())
-                    .add("nodeConnectorType", nodeConnectorType_2)
-                    .add("nodeConnectorId", nodeConnectorId_2.toString())
-                    .getString();
-
-            result = getJsonResult(baseURL + "/" + networkAddress_2
-                    + queryParameter, "POST");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        String queryParameter = new QueryParameter("dataLayerAddress",
+                dataLayerAddress_1).add("nodeType", nodeType_1)
+                .add("nodeId", nodeId_1.toString())
+                .add("nodeConnectorType", nodeConnectorType_1)
+                .add("nodeConnectorId", nodeConnectorId_1.toString())
+                .add("vlan", vlan_1).getString();
+
+        String result = getJsonResult(baseURL + "/" + networkAddress_1
+                + queryParameter, "POST");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
+
+        // vlan is not passed through query parameter but should be
+        // defaulted to "0"
+        queryParameter = new QueryParameter("dataLayerAddress",
+                dataLayerAddress_2).add("nodeType", nodeType_2)
+                .add("nodeId", nodeId_2.toString())
+                .add("nodeConnectorType", nodeConnectorType_2)
+                .add("nodeConnectorId", nodeConnectorId_2.toString())
+                .getString();
+
+        result = getJsonResult(baseURL + "/" + networkAddress_2
+                + queryParameter, "POST");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
 
         // define variables for decoding returned strings
         String networkAddress;
@@ -853,69 +944,59 @@ public class NorthboundIT {
 
         // the two hosts should be in inactive host DB
         // test GET method: getInactiveHosts()
-        try {
-            String result = getJsonResult(baseURL + "/inactive", "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+        result = getJsonResult(baseURL + "/inactive", "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        // there should be at least two hosts in the DB
+        Assert.assertTrue(json.get("host") instanceof JSONArray);
+        JSONArray ja = json.getJSONArray("host");
+        Integer count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        for (int i = 0; i < count; i++) {
+            host_jo = ja.getJSONObject(i);
+            dl_jo = host_jo.getJSONObject("dataLayerAddress");
+            nc_jo = host_jo.getJSONObject("nodeConnector");
+            node_jo = nc_jo.getJSONObject("node");
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            // there should be at least two hosts in the DB
-            Assert.assertTrue(json.get("host") instanceof JSONArray);
-            JSONArray ja = json.getJSONArray("host");
-            Integer count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            for (int i = 0; i < count; i++) {
-                host_jo = ja.getJSONObject(i);
-                dl_jo = host_jo.getJSONObject("dataLayerAddress");
-                nc_jo = host_jo.getJSONObject("nodeConnector");
-                node_jo = nc_jo.getJSONObject("node");
-
-                networkAddress = host_jo.getString("networkAddress");
-                if (networkAddress.equalsIgnoreCase(networkAddress_1)) {
-                    Assert.assertTrue(dl_jo.getString("macAddress")
-                            .equalsIgnoreCase(dataLayerAddress_1));
-                    Assert.assertTrue(nc_jo.getString("@type")
-                            .equalsIgnoreCase(nodeConnectorType_1));
-                    Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
-                    Assert.assertTrue(node_jo.getString("@type")
-                            .equalsIgnoreCase(nodeType_1));
-                    Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
-                    Assert.assertTrue(host_jo.getString("vlan")
-                            .equalsIgnoreCase(vlan_1));
-                } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
-                    Assert.assertTrue(dl_jo.getString("macAddress")
-                            .equalsIgnoreCase(dataLayerAddress_2));
-                    Assert.assertTrue(nc_jo.getString("@type")
-                            .equalsIgnoreCase(nodeConnectorType_2));
-                    Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_2);
-                    Assert.assertTrue(node_jo.getString("@type")
-                            .equalsIgnoreCase(nodeType_2));
-                    Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_2);
-                    Assert.assertTrue(host_jo.getString("vlan")
-                            .equalsIgnoreCase(vlan_2));
-                } else {
-                    Assert.assertTrue(false);
-                }
+            networkAddress = host_jo.getString("networkAddress");
+            if (networkAddress.equalsIgnoreCase(networkAddress_1)) {
+                Assert.assertTrue(dl_jo.getString("macAddress")
+                        .equalsIgnoreCase(dataLayerAddress_1));
+                Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                        nodeConnectorType_1));
+                Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
+                Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                        nodeType_1));
+                Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
+                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(
+                        vlan_1));
+            } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
+                Assert.assertTrue(dl_jo.getString("macAddress")
+                        .equalsIgnoreCase(dataLayerAddress_2));
+                Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                        nodeConnectorType_2));
+                Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_2);
+                Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                        nodeType_2));
+                Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_2);
+                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(
+                        vlan_2));
+            } else {
+                Assert.assertTrue(false);
             }
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
         }
 
         // test GET method: getActiveHosts() - no host expected
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            Assert.assertFalse(hostInJson(json, networkAddress_1));
-            Assert.assertFalse(hostInJson(json, networkAddress_2));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertFalse(hostInJson(json, networkAddress_1));
+        Assert.assertFalse(hostInJson(json, networkAddress_2));
 
         // put the 1st host into active host DB
         Node nd;
@@ -931,75 +1012,57 @@ public class NorthboundIT {
         }
 
         // verify the host shows up in active host DB
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            Assert.assertTrue(hostInJson(json, networkAddress_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertTrue(hostInJson(json, networkAddress_1));
 
         // test GET method for getHostDetails()
-        try {
-            String result = getJsonResult(baseURL + "/" + networkAddress_1,
-                    "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL + "/" + networkAddress_1, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            Assert.assertFalse(json.length() == 0);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
 
-            dl_jo = json.getJSONObject("dataLayerAddress");
-            nc_jo = json.getJSONObject("nodeConnector");
-            node_jo = nc_jo.getJSONObject("node");
+        Assert.assertFalse(json.length() == 0);
 
-            Assert.assertTrue(json.getString("networkAddress")
-                    .equalsIgnoreCase(networkAddress_1));
-            Assert.assertTrue(dl_jo.getString("macAddress").equalsIgnoreCase(
-                    dataLayerAddress_1));
-            Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
-                    nodeConnectorType_1));
-            Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
-            Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
-                    nodeType_1));
-            Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
-            Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        dl_jo = json.getJSONObject("dataLayerAddress");
+        nc_jo = json.getJSONObject("nodeConnector");
+        node_jo = nc_jo.getJSONObject("node");
+
+        Assert.assertTrue(json.getString("networkAddress").equalsIgnoreCase(
+                networkAddress_1));
+        Assert.assertTrue(dl_jo.getString("macAddress").equalsIgnoreCase(
+                dataLayerAddress_1));
+        Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                nodeConnectorType_1));
+        Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
+        Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                nodeType_1));
+        Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
+        Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
 
         // test DELETE method for deleteFlow()
-        try {
-            String result = getJsonResult(baseURL + "/" + networkAddress_1,
-                    "DELETE");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        result = getJsonResult(baseURL + "/" + networkAddress_1, "DELETE");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
         // verify host_1 removed from active host DB
         // test GET method: getActiveHosts() - no host expected
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertFalse(hostInJson(json, networkAddress_1));
 
-            Assert.assertFalse(hostInJson(json, networkAddress_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
     }
 
     private Boolean hostInJson(JSONObject json, String hostIp)
@@ -1104,6 +1167,8 @@ public class NorthboundIT {
 
                 mavenBundle("org.opendaylight.controller", "usermanager",
                         "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "usermanager.implementation", "0.4.0-SNAPSHOT"),
                 mavenBundle("org.opendaylight.controller", "logging.bridge",
                         "0.4.0-SNAPSHOT"),
                 mavenBundle("org.opendaylight.controller", "clustering.test",
@@ -1290,4 +1355,4 @@ public class NorthboundIT {
                 mavenBundle("com.sun.jersey", "jersey-json", "1.17")
                         .startLevel(2), junitBundles());
     }
-}
\ No newline at end of file
+}
index 4be075451e9c31f90260e6e39b7dc43008a47c1f..56d469b59932f591b93cd91eb7e491ab3c683085 100644 (file)
                connectionTimeout="20000"
                redirectPort="8443" />
 
-<!-- 
-       Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
-       Remember to add a valid keystore in the configuration folder.
-       More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration 
+<!--
+        Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
+        Remember to add a valid keystore in the configuration folder.
+        More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
 -->
- <!-- 
+
+ <!--
     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                maxThreads="150" scheme="https" secure="true"
                clientAuth="false" sslProtocol="TLS"
             unpackWARs="false" autoDeploy="false"
             deployOnStartup="false" createDirs="false">
         <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
-           <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-     
+            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
-                       prefix="web_access_log_" suffix=".txt" resolveHosts="false"
-                       rotatable="true" fileDateFormat="yyyy-MM"
-                       pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
-               
+                        prefix="web_access_log_" suffix=".txt" resolveHosts="false"
+                        rotatable="true" fileDateFormat="yyyy-MM"
+                        pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
+
       </Host>
     </Engine>
   </Service>
index 4d6bed028a0fc3d30ff0ab932c9552af4409f902..402b6553718852daf6b4fb863a114939925ecfb4 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/staticroute"/>
   </services>
index f656faf3080a2c1277c5ee0bd81758f9c3b62cea..bb88465907191dd2bc2fea0d7f7061190a3d1aee 100644 (file)
@@ -91,6 +91,6 @@
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
       <version>1.17-SNAPSHOT</version>
-    </dependency>   
+    </dependency>
   </dependencies>
 </project>
index 37901a68a8445536e06b87aafc502f12e275a3b8..4a040c1a1f861e3f38e0bf762cb5170832710b19 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSStaticRouting</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
 
-       <servlet-mapping>
-               <servlet-name>JAXRSStaticRouting</servlet-name>
-               <url-pattern>/*</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>JAXRSStaticRouting</servlet-name>
+                <url-pattern>/*</url-pattern>
+        </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>  
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 3f2759dceaa37641f4fac291417bb58949c5e787..63ae43975858f63284e2ad2ad51c0b532efb65be 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/statistics"/>
   </services>
index 7ce5c43d12e031a0359cd09d0de06fbe4c316bb7..cad50e299834a633a03b36e95776e93120bd9abe 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>        
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
index 24242d3c4587833e6a1db737ec7b5439722a79ce..f152aa75a2b1af7321ccf33d9776563750e82967 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSStatistics</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 1c201d3b33eb590ce57d70ac180c0abee48b6fba..f7eccef6666f7d2ec8f0dc2d8b36215e0c9801a1 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">  
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSSubnets</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <servlet-name>JAXRSSubnets</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
index 9338b55826b81852f4c0c881fe7beaa49bdc0298..8a8bfdb02999941afa232187ea4c02a37bf030d7 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/switch"/>
   </services>
index a16cdfab48b88f228ae69ca3856f2c95a954bcca..188b21b24d000014c1f498f6f4e101ed8dd25c21 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSSwitchManager</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index c955d8cc5c3ae549f7ff021db27d02ddaf9f8fd6..b7c451c8e6855e09c772b42e4f7f0e52948eec6d 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/topology"/>
   </services>
index e40c5fbfbf63804c159f93505c7a6b9153af390d..a46e433054831408b9907b33f7d95443e1cf104e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSTopology</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
index 0a22a573b75028c06fe77c77737af72e39aea8b7..ed4f3300bae2220e35416b6c7a76353a6472f3bc 100644 (file)
@@ -1,50 +1,50 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <modelVersion>4.0.0</modelVersion>
+        <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>commons.opendaylight</artifactId>
     <version>1.4.0-SNAPSHOT</version>
     <relativePath>../../../opendaylight/commons/opendaylight</relativePath>
   </parent>
-  
-       <groupId>org.opendaylight.controller</groupId>
-       <artifactId>northboundtest</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>
-                                               <Import-Package>
-                                                       org.opendaylight.controller.sal.core,
-                                                       org.eclipse.osgi.framework.console,
-                                                       org.osgi.framework,
-                                       org.apache.felix.dm
-                                               </Import-Package>
-                                               <Export-Package>
-                                               </Export-Package>
-                                               <Bundle-Activator>
-                                         org.opendaylight.controller.northboundtest.unittestsuite.internal.Activator
-                                       </Bundle-Activator>
-                                               <Service-Component>
-                                               </Service-Component>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>sal</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>    
-       </dependencies>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>northboundtest</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>
+                                                <Import-Package>
+                                                        org.opendaylight.controller.sal.core,
+                                                        org.eclipse.osgi.framework.console,
+                                                        org.osgi.framework,
+                                        org.apache.felix.dm
+                                                </Import-Package>
+                                                <Export-Package>
+                                                </Export-Package>
+                                                <Bundle-Activator>
+                                          org.opendaylight.controller.northboundtest.unittestsuite.internal.Activator
+                                        </Bundle-Activator>
+                                                <Service-Component>
+                                                </Service-Component>
+                                        </instructions>
+                                </configuration>
+                        </plugin>
+                </plugins>
+        </build>
+        <dependencies>
+                <dependency>
+                        <groupId>org.opendaylight.controller</groupId>
+                        <artifactId>sal</artifactId>
+                        <version>0.4.0-SNAPSHOT</version>
+                </dependency>
+        </dependencies>
 </project>
index 0386ef6f74f7382bf8f8a7385d1db139b68a0ab4..7893ae0acca4f37e22a6fecee532b902652d2f0f 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
 
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.OFMessage;
 
 /**
index 81ee6dc07054fc57f8a4fd027f91def3b52d5423..f7edd30b01cd3424cda925cf29b05ff747020096 100644 (file)
@@ -13,7 +13,6 @@ import java.nio.ByteBuffer;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.OFPacketOut;
 import org.openflow.protocol.OFPort;
 import org.openflow.protocol.OFVendor;
@@ -229,12 +228,15 @@ public class V6FlowMod extends OFVendor implements Cloneable {
         }
     }
 
-    /**
-     * Prints the contents of V6FlowMod in a string format.
-     */
     @Override
     public String toString() {
-        return "V6FlowMod[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "V6FlowMod [match=" + match + ", cookie=" + cookie
+                + ", command=" + command + ", idleTimeout=" + idleTimeout
+                + ", hardTimeout=" + hardTimeout + ", priority=" + priority
+                + ", bufferId=" + bufferId + ", outPort=" + outPort
+                + ", flags=" + flags + ", actions=" + actions + ", match_len="
+                + match_len + ", actions_len=" + actions_len + ", pad_size="
+                + pad_size + "]";
     }
 
 }
index 0edcfead0c87fff08faf22161ab2580e9243bf3e..f31e079bc7705e64bb7c5aa80bc8afdf9d53256f 100644 (file)
@@ -9,18 +9,16 @@
 
 package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.openflow.protocol.OFMatch;
-import org.openflow.util.U16;
-import org.openflow.util.U8;
-
 import java.net.Inet6Address;
-import org.opendaylight.controller.sal.utils.HexEncode;
-
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 
+import org.opendaylight.controller.sal.utils.HexEncode;
+import org.openflow.protocol.OFMatch;
+import org.openflow.util.U16;
+import org.openflow.util.U8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1013,7 +1011,31 @@ public class V6Match extends OFMatch implements Cloneable {
 
     @Override
     public String toString() {
-        return "V6Match[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "V6Match [nwSrc=" + nwSrc + ", nwDst=" + nwDst
+                + ", inputPortMask=" + inputPortMask + ", dataLayerSourceMask="
+                + HexEncode.bytesToHexStringFormat(dataLayerSourceMask)
+                + ", dataLayerDestinationMask="
+                + HexEncode.bytesToHexStringFormat(dataLayerDestinationMask)
+                + ", dataLayerVirtualLanMask=" + dataLayerVirtualLanMask
+                + ", dataLayerVirtualLanPriorityCodePointMask="
+                + dataLayerVirtualLanPriorityCodePointMask
+                + ", dataLayerTypeMask=" + dataLayerTypeMask
+                + ", networkTypeOfServiceMask=" + networkTypeOfServiceMask
+                + ", networkProtocolMask=" + networkProtocolMask
+                + ", networkSourceMask=" + networkSourceMask
+                + ", networkDestinationMask=" + networkDestinationMask
+                + ", transportSourceMask=" + transportSourceMask
+                + ", transportDestinationMask=" + transportDestinationMask
+                + ", srcIPv6SubnetMaskbits=" + srcIPv6SubnetMaskbits
+                + ", dstIPv6SubnetMaskbits=" + dstIPv6SubnetMaskbits
+                + ", inputPortState=" + inputPortState + ", dlSourceState="
+                + dlSourceState + ", dlDestState=" + dlDestState
+                + ", dlVlanState=" + dlVlanState + ", ethTypeState="
+                + ethTypeState + ", nwTosState=" + nwTosState
+                + ", nwProtoState=" + nwProtoState + ", nwSrcState="
+                + nwSrcState + ", nwDstState=" + nwDstState + ", tpSrcState="
+                + tpSrcState + ", tpDstState=" + tpDstState + ", match_len="
+                + match_len + ", pad_size=" + pad_size + "]";
     }
 
     /**
index c96419ef11e9d465823f112ed8f81280fb22911b..1644b1147b1f008b396c089191c83a40ec2324a2 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6e
 
 import java.nio.ByteBuffer;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.statistics.OFVendorStatistics;
 
 
@@ -150,7 +149,8 @@ public class V6StatsRequest extends OFVendorStatistics {
 
     @Override
     public String toString() {
-        return "V6StatsRequest[" + ReflectionToStringBuilder.toString(this)
+        return "V6StatsRequest [msgsubtype=" + msgsubtype + ", outPort="
+                + outPort + ", match_len=" + match_len + ", tableId=" + tableId
                 + "]";
     }
 
index faefe4c629012771c238218dc3ec55c299bd668e..750c39503cd4b3aabfd1a3e9608debeae22d3005 100644 (file)
@@ -39,7 +39,7 @@
               org.opendaylight.controller.protocol_plugins.stub.internal
             </Export-Package>
             <Bundle-Activator>
-              org.opendaylight.controller.protocol_plugins.stub.internal.Activator 
+              org.opendaylight.controller.protocol_plugins.stub.internal.Activator
             </Bundle-Activator>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
@@ -60,4 +60,4 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>
index d5fbdbc74371df64bbd204ed7965e156c21512da..edb3537c1273c9f6a02cc956b64e481161914b08 100644 (file)
@@ -15,8 +15,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
+import org.opendaylight.controller.sal.utils.HexEncode;
 /**
  * The class contains MAC address property.
  */
@@ -92,6 +91,7 @@ public class MacAddress extends Property implements Cloneable {
 
     @Override
     public String toString() {
-        return "MacAddress[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "MacAddress [address=" +
+            HexEncode.bytesToHexStringFormat(address) + "]";
     }
 }
index 0c14517b192e36b7d579a417382675788af1ef2c..96a992b3c366c23d993197755d13c984298580c9 100644 (file)
@@ -14,8 +14,6 @@ import java.io.Serializable;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
 /**
  * @file   DataLinkAddress.java
  *
@@ -94,7 +92,6 @@ abstract public class DataLinkAddress implements Serializable {
 
     @Override
     public String toString() {
-        return "DataLinkAddress[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "DataLinkAddress [name=" + name + "]";
     }
 }
index 2afaea8f42f91db209d9ed30d77bce17a53d0dfe..6cd14eadce78c48235412f907188ce86c8b50059 100644 (file)
@@ -17,7 +17,6 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.utils.HexEncode;
 
@@ -117,7 +116,7 @@ public class EthernetAddress extends DataLinkAddress {
 
     @Override
     public String toString() {
-        return "EthernetAddress[" + ReflectionToStringBuilder.toString(this)
+        return "EthernetAddress [macAddress=" + HexEncode.bytesToHexStringFormat(macAddress)
                 + "]";
     }
 
index fff46eafaf99ba48b96d5d5093ad4102daa5bb23..58bf350c40e015878cad1ae01f9de3ca9e7f7596 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.sal.topology;
 
 import java.util.Set;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.Edge;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.UpdateType;
@@ -54,8 +53,8 @@ public class TopoEdgeUpdate {
 
     @Override
     public String toString() {
-        return "TopoEdgeUpdate[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "TopoEdgeUpdate [edge=" + edge + ", props=" + props + ", type="
+                + type + "]";
     }
 
     @Override
index 65d4b48dbe57b1a9b2b27f6b83b7cfdc507011b8..b89dbb44ac786756b60d866c02459097bbe615b4 100644 (file)
@@ -9,20 +9,25 @@ package org.opendaylight.controller.sal.binding.generator.impl;
 
 import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.controller.binding.generator.util.Types;
+import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;
 import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
 import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
 import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
 import org.opendaylight.controller.sal.binding.model.api.*;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.*;
 import org.opendaylight.controller.sal.binding.yang.types.TypeProviderImpl;
+import org.opendaylight.controller.yang.binding.Notification;
 import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.common.RpcResult;
 import org.opendaylight.controller.yang.model.api.*;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair;
 import org.opendaylight.controller.yang.model.util.DataNodeIterator;
 import org.opendaylight.controller.yang.model.util.ExtendedType;
+import org.opendaylight.controller.yang.model.util.SchemaContextUtil;
 
 import java.util.*;
+import java.util.concurrent.Future;
 
 import static org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil.*;
 import static org.opendaylight.controller.yang.model.util.SchemaContextUtil.findDataSchemaNode;
@@ -41,12 +46,12 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     @Override
     public List<Type> generateTypes(final SchemaContext context) {
         if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference " +
-                    "cannot be NULL!");
+            throw new IllegalArgumentException("Schema Context reference "
+                    "cannot be NULL!");
         }
         if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain " +
-                    "defined modules!");
+            throw new IllegalStateException("Schema Context does not contain "
+                    "defined modules!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
@@ -61,25 +66,27 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             generatedTypes.addAll(allListsToGenTypes(module));
             generatedTypes.addAll(allAugmentsToGenTypes(module));
             generatedTypes.addAll(allRPCMethodsToGenType(module));
-            generatedTypes.addAll(allNotifycationsToGenType(module));
+            generatedTypes.addAll(allNotificationsToGenType(module));
+            generatedTypes.addAll(allIdentitiesToGenTypes(module, context));
+            generatedTypes.addAll(allGroupingsToGenTypes(module));
         }
         return generatedTypes;
     }
 
     @Override
     public List<Type> generateTypes(final SchemaContext context,
-                                    final Set<Module> modules) {
+            final Set<Module> modules) {
         if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference " +
-                    "cannot be NULL!");
+            throw new IllegalArgumentException("Schema Context reference "
+                    "cannot be NULL!");
         }
         if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain " +
-                    "defined modules!");
+            throw new IllegalStateException("Schema Context does not contain "
+                    "defined modules!");
         }
         if (modules == null) {
-            throw new IllegalArgumentException("Sef of Modules cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Sef of Modules cannot be "
+                    "NULL!");
         }
 
         final List<Type> filteredGenTypes = new ArrayList<>();
@@ -96,7 +103,10 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             generatedTypes.addAll(allListsToGenTypes(contextModule));
             generatedTypes.addAll(allAugmentsToGenTypes(contextModule));
             generatedTypes.addAll(allRPCMethodsToGenType(contextModule));
-            generatedTypes.addAll(allNotifycationsToGenType(contextModule));
+            generatedTypes.addAll(allNotificationsToGenType(contextModule));
+            generatedTypes.addAll(allIdentitiesToGenTypes(contextModule,
+                    context));
+            generatedTypes.addAll(allGroupingsToGenTypes(contextModule));
 
             if (modules.contains(contextModule)) {
                 filteredGenTypes.addAll(generatedTypes);
@@ -107,14 +117,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allTypeDefinitionsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         if (module.getName() == null) {
             throw new IllegalArgumentException("Module name cannot be NULL!");
         }
         if (module.getTypeDefinitions() == null) {
-            throw new IllegalArgumentException("Type Definitions for module " +
-                    module.getName() + " cannot be NULL!");
+            throw new IllegalArgumentException("Type Definitions for module "
+                    module.getName() + " cannot be NULL!");
         }
 
         final Set<TypeDefinition<?>> typeDefinitions = module
@@ -122,7 +133,7 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final List<Type> generatedTypes = new ArrayList<>();
         for (final TypeDefinition<?> typedef : typeDefinitions) {
             if (typedef != null) {
-                final Type type = ((TypeProviderImpl)typeProvider)
+                final Type type = ((TypeProviderImpl) typeProvider)
                         .generatedTypeForExtendedDefinitionType(typedef);
                 if ((type != null) && !generatedTypes.contains(type)) {
                     generatedTypes.add(type);
@@ -134,7 +145,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allContainersToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -142,26 +154,25 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child " +
-                    "Nodes in module " + module.getName() + " cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Reference to Set of Child "
+                    + "Nodes in module " + module.getName() + " cannot be "
+                    "NULL!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(
-                module);
+        final DataNodeIterator it = new DataNodeIterator(module);
         final List<ContainerSchemaNode> schemaContainers = it.allContainers();
         final String basePackageName = moduleNamespaceToPackageName(module);
         for (final ContainerSchemaNode container : schemaContainers) {
-            generatedTypes.add(containerToGenType(basePackageName,
-                    container));
+            generatedTypes.add(containerToGenType(basePackageName, container));
         }
         return generatedTypes;
     }
 
     private List<Type> allListsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -169,14 +180,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child " +
-                    "Nodes in module " + module.getName() + " cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Reference to Set of Child "
+                    + "Nodes in module " + module.getName() + " cannot be "
+                    "NULL!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(
-                module);
+        final DataNodeIterator it = new DataNodeIterator(module);
         final List<ListSchemaNode> schemaLists = it.allLists();
         final String basePackageName = moduleNamespaceToPackageName(module);
         if (schemaLists != null) {
@@ -189,7 +199,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allAugmentsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -197,8 +208,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "Augmentation Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "Augmentation Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
@@ -206,37 +217,35 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String basePackageName = moduleNamespaceToPackageName(module);
         final List<AugmentationSchema> augmentations = resolveAugmentations(module);
         for (final AugmentationSchema augment : augmentations) {
-            generatedTypes.addAll(augmentationToGenTypes(basePackageName, augment));
+            generatedTypes.addAll(augmentationToGenTypes(basePackageName,
+                    augment));
         }
         return generatedTypes;
     }
 
     private List<AugmentationSchema> resolveAugmentations(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         if (module.getAugmentations() == null) {
             throw new IllegalStateException("Augmentations Set cannot be NULL!");
         }
 
-        final Set<AugmentationSchema> augmentations = module
-                .getAugmentations();
+        final Set<AugmentationSchema> augmentations = module.getAugmentations();
         final List<AugmentationSchema> sortedAugmentations = new ArrayList<>(
                 augmentations);
         Collections.sort(sortedAugmentations,
                 new Comparator<AugmentationSchema>() {
 
                     @Override
-                    public int compare(
-                            AugmentationSchema augSchema1,
+                    public int compare(AugmentationSchema augSchema1,
                             AugmentationSchema augSchema2) {
 
-                        if (augSchema1.getTargetPath().getPath()
-                                .size() > augSchema2
+                        if (augSchema1.getTargetPath().getPath().size() > augSchema2
                                 .getTargetPath().getPath().size()) {
                             return 1;
-                        } else if (augSchema1.getTargetPath()
-                                .getPath().size() < augSchema2
+                        } else if (augSchema1.getTargetPath().getPath().size() < augSchema2
                                 .getTargetPath().getPath().size()) {
                             return -1;
                         }
@@ -250,7 +259,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private GeneratedType moduleToDataType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         final GeneratedTypeBuilder moduleDataTypeBuilder = moduleTypeBuilder(
@@ -259,14 +269,16 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String basePackageName = moduleNamespaceToPackageName(module);
         if (moduleDataTypeBuilder != null) {
             final Set<DataSchemaNode> dataNodes = module.getChildNodes();
-            resolveDataSchemaNodes(basePackageName, moduleDataTypeBuilder, dataNodes);
+            resolveDataSchemaNodes(basePackageName, moduleDataTypeBuilder,
+                    dataNodes);
         }
         return moduleDataTypeBuilder.toInstance();
     }
 
-    private List<GeneratedType> allRPCMethodsToGenType(final Module module) {
+    private List<Type> allRPCMethodsToGenType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -274,37 +286,81 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "RPC Method Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "RPC Method Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
         final String basePackageName = moduleNamespaceToPackageName(module);
         final Set<RpcDefinition> rpcDefinitions = module.getRpcs();
-        final List<GeneratedType> genRPCTypes = new ArrayList<>();
-
+        final List<Type> genRPCTypes = new ArrayList<>();
+        final GeneratedTypeBuilder interfaceBuilder = moduleTypeBuilder(module,
+                "Service");
+        final Type future = Types.typeForClass(Future.class);
         for (final RpcDefinition rpc : rpcDefinitions) {
             if (rpc != null) {
+
+                String rpcName = parseToClassName(rpc.getQName()
+                        .getLocalName());
+                MethodSignatureBuilder method = interfaceBuilder
+                        .addMethod(rpcName);
+
                 final List<DataNodeIterator> rpcInOut = new ArrayList<>();
-                rpcInOut.add(new DataNodeIterator(rpc.getInput()));
-                rpcInOut.add(new DataNodeIterator(rpc.getOutput()));
 
+                ContainerSchemaNode input = rpc.getInput();
+                ContainerSchemaNode output = rpc.getOutput();
+
+                if (input != null) {
+                    rpcInOut.add(new DataNodeIterator(input));
+                    GeneratedTypeBuilder inType = addRawInterfaceDefinition(
+                            basePackageName, input, rpcName);
+                    resolveDataSchemaNodes(basePackageName, inType, input.getChildNodes());
+                    Type inTypeInstance = inType.toInstance();
+                    genRPCTypes.add(inTypeInstance);
+                    method.addParameter(inTypeInstance, "input");
+                }
+
+                Type outTypeInstance = Types.typeForClass(Void.class);
+                if (output != null) {
+                    rpcInOut.add(new DataNodeIterator(output));
+
+                    GeneratedTypeBuilder outType = addRawInterfaceDefinition(
+                            basePackageName, output, rpcName);
+                    resolveDataSchemaNodes(basePackageName, outType, output.getChildNodes());
+                    outTypeInstance = outType.toInstance();
+                    genRPCTypes.add(outTypeInstance);
+
+                }
+
+                final Type rpcRes = Types.parameterizedTypeFor(
+                        Types.typeForClass(RpcResult.class), outTypeInstance);
+                method.addReturnType(Types.parameterizedTypeFor(future, rpcRes));
                 for (DataNodeIterator it : rpcInOut) {
                     List<ContainerSchemaNode> nContainers = it.allContainers();
                     if ((nContainers != null) && !nContainers.isEmpty()) {
                         for (final ContainerSchemaNode container : nContainers) {
-                            genRPCTypes.add(containerToGenType(basePackageName, container));
+                            genRPCTypes.add(containerToGenType(basePackageName,
+                                    container));
+                        }
+                    }
+                    List<ListSchemaNode> nLists = it.allLists();
+                    if ((nLists != null) && !nLists.isEmpty()) {
+                        for (final ListSchemaNode list : nLists) {
+                            genRPCTypes.addAll(listToGenType(basePackageName,
+                                    list));
                         }
                     }
                 }
             }
         }
+        genRPCTypes.add(interfaceBuilder.toInstance());
         return genRPCTypes;
     }
 
-    private List<Type> allNotifycationsToGenType(final Module module) {
+    private List<Type> allNotificationsToGenType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -312,8 +368,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "Notification Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "Notification Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
@@ -324,33 +380,108 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
         for (final NotificationDefinition notification : notifications) {
             if (notification != null) {
-                final List<DataNodeIterator> notifyChildren = new ArrayList<>();
+                DataNodeIterator it = new DataNodeIterator(notification);
 
-                for (DataSchemaNode childNode : notification.getChildNodes()) {
-                    if (childNode instanceof DataNodeContainer) {
-                        notifyChildren.add(new DataNodeIterator((DataNodeContainer) childNode));
-                    }
+                // Containers
+                for (ContainerSchemaNode node : it.allContainers()) {
+                    genNotifyTypes
+                            .add(containerToGenType(basePackageName, node));
                 }
-
-                for (DataNodeIterator it : notifyChildren) {
-                    List<ContainerSchemaNode> nContainers = it.allContainers();
-                    List<ListSchemaNode> nLists = it.allLists();
-                    if ((nContainers != null) && !nContainers.isEmpty()) {
-                        for (final ContainerSchemaNode container : nContainers) {
-                            genNotifyTypes.add(containerToGenType(basePackageName, container));
-                        }
-                    }
-                    if ((nLists != null) && !nLists.isEmpty()) {
-                        for (final ListSchemaNode list : nLists) {
-                            genNotifyTypes.addAll(listToGenType(basePackageName, list));
-                        }
-                    }
+                // Lists
+                for (ListSchemaNode node : it.allLists()) {
+                    genNotifyTypes.addAll(listToGenType(basePackageName, node));
                 }
+                final GeneratedTypeBuilder notificationTypeBuilder = addRawInterfaceDefinition(
+                        basePackageName, notification);
+                notificationTypeBuilder.addImplementsType(Types
+                        .typeForClass(Notification.class));
+                // Notification object
+                resolveDataSchemaNodes(basePackageName,
+                        notificationTypeBuilder, notification.getChildNodes());
+                genNotifyTypes.add(notificationTypeBuilder.toInstance());
             }
         }
         return genNotifyTypes;
     }
 
+    private List<Type> allIdentitiesToGenTypes(final Module module,
+            final SchemaContext context) {
+        List<Type> genTypes = new ArrayList<Type>();
+
+        final Set<IdentitySchemaNode> schemaIdentities = module.getIdentities();
+
+        final String basePackageName = moduleNamespaceToPackageName(module);
+
+        if (schemaIdentities != null && !schemaIdentities.isEmpty()) {
+            for (final IdentitySchemaNode identity : schemaIdentities) {
+                genTypes.add(identityToGenType(basePackageName, identity,
+                        context));
+            }
+        }
+        return genTypes;
+    }
+
+    private GeneratedType identityToGenType(final String basePackageName,
+            IdentitySchemaNode identity, SchemaContext context) {
+        if (identity == null) {
+            return null;
+        }
+
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                identity.getPath());
+
+        final String genTypeName = parseToClassName(identity.getQName()
+                .getLocalName());
+        final GeneratedTOBuilderImpl newType = new GeneratedTOBuilderImpl(
+                packageName, genTypeName);
+
+        IdentitySchemaNode baseIdentity = identity.getBaseIdentity();
+        if (baseIdentity != null) {
+            Module baseIdentityParentModule = SchemaContextUtil.findParentModule(
+                    context, baseIdentity);
+
+            final String returnTypePkgName = moduleNamespaceToPackageName(baseIdentityParentModule);
+            final String returnTypeName = parseToClassName(baseIdentity
+                    .getQName().getLocalName());
+
+            GeneratedTransferObject gto = new GeneratedTOBuilderImpl(
+                    returnTypePkgName, returnTypeName).toInstance();
+            newType.addExtendsType(gto);
+        } else {
+            newType.addExtendsType(Types.getBaseIdentityTO());
+        }
+
+        return newType.toIdentityInstance();
+    }
+
+    private List<Type> allGroupingsToGenTypes(Module module) {
+        final List<Type> genTypes = new ArrayList<Type>();
+        final String basePackageName = moduleNamespaceToPackageName(module);
+        Set<GroupingDefinition> groupings = module.getGroupings();
+        if (groupings != null && !groupings.isEmpty()) {
+            for (final GroupingDefinition grouping : groupings) {
+                genTypes.add(groupingToGenType(basePackageName, grouping));
+            }
+        }
+        return genTypes;
+    }
+
+    private GeneratedType groupingToGenType(final String basePackageName,
+            GroupingDefinition grouping) {
+        if (grouping == null) {
+            return null;
+        }
+
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                grouping.getPath());
+        final Set<DataSchemaNode> schemaNodes = grouping.getChildNodes();
+        final GeneratedTypeBuilder typeBuilder = addRawInterfaceDefinition(
+                packageName, grouping);
+
+        resolveDataSchemaNodes(basePackageName, typeBuilder, schemaNodes);
+        return typeBuilder.toInstance();
+    }
+
     private EnumTypeDefinition enumTypeDefFromExtendedType(
             final TypeDefinition<?> typeDefinition) {
         if (typeDefinition != null) {
@@ -399,20 +530,20 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedTypeBuilder moduleTypeBuilder(final Module module,
-                                                   final String postfix) {
+            final String postfix) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         String packageName = moduleNamespaceToPackageName(module);
-        final String moduleName = parseToClassName(module.getName())
-                + postfix;
+        final String moduleName = parseToClassName(module.getName()) + postfix;
 
         return new GeneratedTypeBuilderImpl(packageName, moduleName);
 
     }
 
     private List<Type> augmentationToGenTypes(final String augmentPackageName,
-                                              final AugmentationSchema augSchema) {
+            final AugmentationSchema augSchema) {
         if (augmentPackageName == null) {
             throw new IllegalArgumentException("Package Name cannot be NULL!");
         }
@@ -430,23 +561,23 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         // EVERY augmented interface will extends Augmentation<T> interface
         // and DataObject interface!!!
         final SchemaPath targetPath = augSchema.getTargetPath();
-        final DataSchemaNode targetSchemaNode = findDataSchemaNode(schemaContext,
-                targetPath);
-        if ((targetSchemaNode != null) &&
-                (targetSchemaNode.getQName() != null) &&
-                (targetSchemaNode.getQName().getLocalName() != null)) {
+        final DataSchemaNode targetSchemaNode = findDataSchemaNode(
+                schemaContext, targetPath);
+        if ((targetSchemaNode != null) && (targetSchemaNode.getQName() != null)
+                && (targetSchemaNode.getQName().getLocalName() != null)) {
             final Module targetModule = findParentModule(schemaContext,
                     targetSchemaNode);
 
             final String targetBasePackage = moduleNamespaceToPackageName(targetModule);
-            final String targetPackageName = packageNameForGeneratedType(targetBasePackage,
-                    targetSchemaNode.getPath());
+            final String targetPackageName = packageNameForGeneratedType(
+                    targetBasePackage, targetSchemaNode.getPath());
 
-            final String targetSchemaNodeName = targetSchemaNode.getQName().getLocalName();
-            final Set<DataSchemaNode> augChildNodes = augSchema
-                    .getChildNodes();
+            final String targetSchemaNodeName = targetSchemaNode.getQName()
+                    .getLocalName();
+            final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
             final GeneratedTypeBuilder augTypeBuilder = addRawAugmentGenTypeDefinition(
-                    augmentPackageName, targetPackageName, targetSchemaNodeName, augSchema);
+                    augmentPackageName, targetPackageName,
+                    targetSchemaNodeName, augSchema);
             if (augTypeBuilder != null) {
                 genTypes.add(augTypeBuilder.toInstance());
             }
@@ -469,10 +600,11 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             genTypeBuilders.put(augmentPackageName, augmentBuilders);
         }
 
-        final String augTypeName = augGenTypeName(augmentBuilders, targetTypeName);
-        final Type targetTypeRef = new ReferencedTypeImpl(targetPackageName, targetTypeName);
-        final Set<DataSchemaNode> augChildNodes = augSchema
-                .getChildNodes();
+        final String augTypeName = augGenTypeName(augmentBuilders,
+                targetTypeName);
+        final Type targetTypeRef = new ReferencedTypeImpl(targetPackageName,
+                targetTypeName);
+        final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
 
         final GeneratedTypeBuilder augTypeBuilder = new GeneratedTypeBuilderImpl(
                 augmentPackageName, augTypeName);
@@ -481,13 +613,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         augTypeBuilder.addImplementsType(Types
                 .augmentationTypeFor(targetTypeRef));
 
-        augSchemaNodeToMethods(augmentPackageName, augTypeBuilder, augChildNodes);
+        augSchemaNodeToMethods(augmentPackageName, augTypeBuilder,
+                augChildNodes);
         augmentBuilders.put(augTypeName, augTypeBuilder);
         return augTypeBuilder;
     }
 
-    private List<Type> augmentationBodyToGenTypes(final String augBasePackageName,
-                                                  final Set<DataSchemaNode> augChildNodes) {
+    private List<Type> augmentationBodyToGenTypes(
+            final String augBasePackageName,
+            final Set<DataSchemaNode> augChildNodes) {
         final List<Type> genTypes = new ArrayList<>();
         final List<DataNodeIterator> augSchemaIts = new ArrayList<>();
         for (final DataSchemaNode childNode : augChildNodes) {
@@ -511,7 +645,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
             if ((augContainers != null) && !augContainers.isEmpty()) {
                 for (final ContainerSchemaNode container : augContainers) {
-                    genTypes.add(containerToGenType(augBasePackageName, container));
+                    genTypes.add(containerToGenType(augBasePackageName,
+                            container));
                 }
             }
             if ((augLists != null) && !augLists.isEmpty()) {
@@ -537,13 +672,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedType containerToGenType(final String basePackageName,
-                                             ContainerSchemaNode containerNode) {
+            ContainerSchemaNode containerNode) {
         if (containerNode == null) {
             return null;
         }
 
-        final String packageName = packageNameForGeneratedType(
-                basePackageName, containerNode.getPath());
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                containerNode.getPath());
         final Set<DataSchemaNode> schemaNodes = containerNode.getChildNodes();
         final GeneratedTypeBuilder typeBuilder = addRawInterfaceDefinition(
                 packageName, containerNode);
@@ -562,7 +697,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                 if (schemaNode.isAugmenting()) {
                     continue;
                 }
-                addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
+                addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode,
+                        typeBuilder);
             }
         }
         return typeBuilder;
@@ -576,15 +712,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         if ((schemaNodes != null) && (typeBuilder != null)) {
             for (final DataSchemaNode schemaNode : schemaNodes) {
                 if (schemaNode.isAugmenting()) {
-                    addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
+                    addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode,
+                            typeBuilder);
                 }
             }
         }
         return typeBuilder;
     }
 
-    private void addSchemaNodeToBuilderAsMethod(
-            final String basePackageName,
+    private void addSchemaNodeToBuilderAsMethod(final String basePackageName,
             final DataSchemaNode schemaNode,
             final GeneratedTypeBuilder typeBuilder) {
         if (schemaNode != null && typeBuilder != null) {
@@ -630,13 +766,14 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                                 enumBuilder.getPackageName(),
                                 enumBuilder.getName());
                     }
-                    ((TypeProviderImpl)typeProvider).putReferencedType(leaf
-                            .getPath(), returnType);
+                    ((TypeProviderImpl) typeProvider).putReferencedType(
+                            leaf.getPath(), returnType);
                 }
                 if (returnType != null) {
                     constructGetter(typeBuilder, leafName, leafDesc, returnType);
                     if (!leaf.isConfiguration()) {
-                        constructSetter(typeBuilder, leafName, leafDesc, returnType);
+                        constructSetter(typeBuilder, leafName, leafDesc,
+                                returnType);
                     }
                     return true;
                 }
@@ -707,8 +844,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private boolean resolveContainerSchemaNode(final String basePackageName,
-                                               final GeneratedTypeBuilder typeBuilder,
-                                               final ContainerSchemaNode containerNode) {
+            final GeneratedTypeBuilder typeBuilder,
+            final ContainerSchemaNode containerNode) {
         if ((containerNode != null) && (typeBuilder != null)) {
             final String nodeName = containerNode.getQName().getLocalName();
 
@@ -727,8 +864,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private boolean resolveListSchemaNode(final String basePackageName,
-                                          final GeneratedTypeBuilder typeBuilder,
-                                          final ListSchemaNode schemaNode) {
+            final GeneratedTypeBuilder typeBuilder,
+            final ListSchemaNode schemaNode) {
         if ((schemaNode != null) && (typeBuilder != null)) {
             final String listName = schemaNode.getQName().getLocalName();
 
@@ -750,7 +887,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedTypeBuilder addRawInterfaceDefinition(
-            final String packageName, final DataSchemaNode schemaNode) {
+            final String packageName, final SchemaNode schemaNode) {
+        return addRawInterfaceDefinition(packageName, schemaNode, "");
+    }
+
+    private GeneratedTypeBuilder addRawInterfaceDefinition(
+            final String packageName, final SchemaNode schemaNode,
+            final String prefix) {
         if (schemaNode == null) {
             return null;
         }
@@ -758,7 +901,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String schemaNodeName = schemaNode.getQName().getLocalName();
 
         if ((packageName != null) && (schemaNodeName != null)) {
-            final String genTypeName = parseToClassName(schemaNodeName);
+            final String genTypeName = prefix + parseToClassName(schemaNodeName)
+                    ;
             final GeneratedTypeBuilder newType = new GeneratedTypeBuilderImpl(
                     packageName, genTypeName);
 
@@ -823,9 +967,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         return setMethod;
     }
 
-
     private List<Type> listToGenType(final String basePackageName,
-                                     final ListSchemaNode list) {
+            final ListSchemaNode list) {
         if (basePackageName == null) {
             throw new IllegalArgumentException(
                     "Package Name for Generated Type cannot be NULL!");
@@ -835,8 +978,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                     "List Schema Node cannot be NULL!");
         }
 
-        final String packageName = packageNameForGeneratedType(
-                basePackageName, list.getPath());
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                list.getPath());
         final GeneratedTypeBuilder typeBuilder = resolveListTypeBuilder(
                 packageName, list);
         final List<String> listKeys = listKeys(list);
@@ -849,17 +992,16 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             if (schemaNode.isAugmenting()) {
                 continue;
             }
-            addSchemaNodeToListBuilders(basePackageName, schemaNode, typeBuilder,
-                    genTOBuilder, listKeys);
+            addSchemaNodeToListBuilders(basePackageName, schemaNode,
+                    typeBuilder, genTOBuilder, listKeys);
         }
         return typeBuildersToGenTypes(typeBuilder, genTOBuilder);
     }
 
     private void addSchemaNodeToListBuilders(final String basePackageName,
-                                             final DataSchemaNode schemaNode,
-                                             final GeneratedTypeBuilder typeBuilder,
-                                             final GeneratedTOBuilder genTOBuilder,
-                                             final List<String> listKeys) {
+            final DataSchemaNode schemaNode,
+            final GeneratedTypeBuilder typeBuilder,
+            final GeneratedTOBuilder genTOBuilder, final List<String> listKeys) {
         if (schemaNode == null) {
             throw new IllegalArgumentException(
                     "Data Schema Node cannot be NULL!");
@@ -884,7 +1026,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             resolveContainerSchemaNode(basePackageName, typeBuilder,
                     (ContainerSchemaNode) schemaNode);
         } else if (schemaNode instanceof ListSchemaNode) {
-            resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
+            resolveListSchemaNode(basePackageName, typeBuilder,
+                    (ListSchemaNode) schemaNode);
         }
     }
 
@@ -912,13 +1055,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
      * @return
      */
     private GeneratedTOBuilder resolveListKey(final String packageName,
-                                              final ListSchemaNode list) {
+            final ListSchemaNode list) {
         final String listName = list.getQName().getLocalName() + "Key";
         return schemaNodeToTransferObjectBuilder(packageName, list, listName);
     }
 
     private boolean isPartOfListKey(final LeafSchemaNode leaf,
-                                    final List<String> keys) {
+            final List<String> keys) {
         if ((leaf != null) && (keys != null) && (leaf.getQName() != null)) {
             final String leafName = leaf.getQName().getLocalName();
             if (keys.contains(leafName)) {
@@ -956,7 +1099,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String genTypeName = parseToClassName(schemaNodeName);
 
         GeneratedTypeBuilder typeBuilder = null;
-        final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders.get(packageName);
+        final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders
+                .get(packageName);
         if (builders != null) {
             typeBuilder = builders.get(genTypeName);
         }
index 03824efed06ed868709cf696e96d231e74a57c12..96069c273c071b96d3594b484055f0c32913a6f1 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.controller.sal.binding.model.api.type.builder.EnumBuilde
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
+import org.opendaylight.controller.yang.common.QName;
 import org.opendaylight.controller.yang.model.api.*;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair;
@@ -103,7 +104,8 @@ public final class TypeProviderImpl implements TypeProvider {
                 final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) baseTypeDef;
                 returnType = provideTypeForLeafref(leafref);
             } else if (baseTypeDef instanceof IdentityrefTypeDefinition) {
-
+                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition)typeDefinition;
+                returnType = returnTypeForIdentityref(idref);
             } else if (baseTypeDef instanceof EnumTypeDefinition) {
                 final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) baseTypeDef;
                 returnType = resolveEnumFromTypeDefinition(enumTypeDef,
@@ -128,7 +130,8 @@ public final class TypeProviderImpl implements TypeProvider {
                 final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) typeDefinition;
                 returnType = provideTypeForLeafref(leafref);
             } else if (typeDefinition instanceof IdentityrefTypeDefinition) {
-
+                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition)typeDefinition;
+                returnType = returnTypeForIdentityref(idref);
             } else {
                 returnType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
                         .javaTypeForSchemaDefinitionType(typeDefinition);
@@ -142,6 +145,29 @@ public final class TypeProviderImpl implements TypeProvider {
 //        }
         return returnType;
     }
+    
+    private Type returnTypeForIdentityref(IdentityrefTypeDefinition idref) {
+        QName baseIdQName = idref.getIdentity();
+        Module module = schemaContext.findModuleByNamespace(baseIdQName.getNamespace());
+        IdentitySchemaNode identity = null;
+        for(IdentitySchemaNode id : module.getIdentities()) {
+            if(id.getQName().equals(baseIdQName)) {
+                identity = id;
+            }
+        }
+        if(identity == null) {
+            throw new IllegalArgumentException("Target identity '" + baseIdQName + "' do not exists");
+        }
+
+        final String basePackageName = moduleNamespaceToPackageName(module);
+        final String packageName = packageNameForGeneratedType(basePackageName, identity.getPath());
+        final String genTypeName = parseToClassName(identity.getQName().getLocalName());
+
+        Type baseType = Types.typeForClass(Class.class);
+        Type paramType = Types.wildcardTypeFor(packageName, genTypeName);
+        Type returnType = Types.parameterizedTypeFor(baseType, paramType);
+        return returnType;
+    }
 
     public Type generatedTypeForExtendedDefinitionType(
             final TypeDefinition<?> typeDefinition) {
index 6a0e1141e5c15c26ced32c0a0010e4155a2b305d..a95eb072ba4f2bc35329fe5dd121727ccb3f7bcc 100644 (file)
@@ -61,7 +61,7 @@ public class GenEnumResolvingTest {
         assertTrue(genTypes != null);
 
         assertEquals("Expected count of all Generated Types from yang models " +
-                "is 22", 22, genTypes.size());
+                "is 22", 25, genTypes.size());
 
         GeneratedType genInterface = null;
         for (final Type type : genTypes) {
@@ -135,7 +135,7 @@ public class GenEnumResolvingTest {
         final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
         assertTrue(genTypes != null);
-        assertEquals(2, genTypes.size());
+        assertEquals(3, genTypes.size());
 
         final Type type = genTypes.get(1);
         assertTrue(type instanceof Enumeration);
index c6d9a286fdce4d6df6116587f9486d7c3f45f920..16eff0bd3761f5b8786d9e54d78b98d0c90a04d5 100644 (file)
@@ -63,7 +63,7 @@ public class GenTypesSubSetTest {
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
         assertEquals("Expected Generated Types from provided sub set of " +
-                "modules should be 23!", 23,
+                "modules should be 23!", 25,
                 genTypes.size());
     }
 
@@ -93,6 +93,6 @@ public class GenTypesSubSetTest {
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
         assertEquals("Expected Generated Types from provided sub set of "  +
-                "modules should be 25!", 25, genTypes.size());
+                "modules should be 25!", 28, genTypes.size());
     }
 }
index 0010733c43939b497dc93fe1ccc91f9e314ebd56..b226252eaea7a635cace166cb3721f307725058a 100644 (file)
@@ -56,7 +56,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(27, genTypes.size());
+        assertEquals(29, genTypes.size());
     }
 
     @Test
@@ -93,7 +93,7 @@ public class GeneratedTypesTest {
         final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
-        assertEquals(53, genTypes.size());
+        assertEquals(57, genTypes.size());
         assertTrue(genTypes != null);
 
         GeneratedTransferObject gtIfcKey = null;
@@ -261,7 +261,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(3, genTypes.size());
+        assertEquals(4, genTypes.size());
 
         final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
         final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
@@ -339,7 +339,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(3, genTypes.size());
+        assertEquals(4, genTypes.size());
 
         final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
         final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
@@ -412,7 +412,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(5, genTypes.size());
+        assertEquals(6, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -496,7 +496,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(7, genTypes.size());
+        assertEquals(8, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -529,7 +529,7 @@ public class GeneratedTypesTest {
             }
         }
 
-        assertEquals(5, genTypesCount);
+        assertEquals(6, genTypesCount);
         assertEquals(2, genTOsCount);
     }
 
@@ -544,7 +544,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(14, genTypes.size());
+        assertEquals(15, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -557,7 +557,7 @@ public class GeneratedTypesTest {
             }
         }
 
-        assertEquals(11, genTypesCount);
+        assertEquals(12, genTypesCount);
         assertEquals(3, genTOsCount);
     }
 }
index 26be94351c67b9db724d7fd27a44abfbf26c9051..2e5bbf0a07a6f0a73d41af7f92c510880aae6963 100644 (file)
@@ -11,11 +11,15 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
+import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;\r
 import org.opendaylight.controller.sal.binding.model.api.ConcreteType;\r
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;\r
 import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;\r
 import org.opendaylight.controller.sal.binding.model.api.Type;\r
+import org.opendaylight.controller.sal.binding.model.api.WildcardType;\r
 import org.opendaylight.controller.yang.binding.Augmentable;\r
 import org.opendaylight.controller.yang.binding.Augmentation;\r
+import org.opendaylight.controller.yang.binding.BaseIdentity;\r
 import org.opendaylight.controller.yang.binding.DataObject;\r
 \r
 public final class Types {\r
@@ -36,7 +40,7 @@ public final class Types {
 \r
     /**\r
      * Returns an instance of {@link ConcreteType} describing the class\r
-     * \r
+     *\r
      * @param cls\r
      *            Class to describe\r
      * @return Description of class\r
@@ -49,7 +53,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link Map}<K,V>\r
-     * \r
+     *\r
      * @param keyType\r
      *            Key Type\r
      * @param valueType\r
@@ -63,7 +67,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link Set}<V> with concrete type of value.\r
-     * \r
+     *\r
      * @param valueType\r
      *            Value Type\r
      * @return Description of generic type instance of Set\r
@@ -75,7 +79,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link List}<V> with concrete type of value.\r
-     * \r
+     *\r
      * @param valueType\r
      *            Value Type\r
      * @return Description of type instance of List\r
@@ -84,8 +88,15 @@ public final class Types {
         return parameterizedTypeFor(LIST_TYPE, valueType);\r
     }\r
 \r
+    public static GeneratedTransferObject getBaseIdentityTO() {\r
+        Class<BaseIdentity> cls = BaseIdentity.class;\r
+        GeneratedTOBuilderImpl gto = new GeneratedTOBuilderImpl(cls.getPackage().getName(),\r
+                cls.getSimpleName());\r
+        return gto.toInstance();\r
+    }\r
+\r
     /**\r
-     * \r
+     *\r
      * @param type\r
      * @param parameters\r
      * @return\r
@@ -94,17 +105,21 @@ public final class Types {
             Type... parameters) {\r
         return new ParametrizedTypeImpl(type, parameters);\r
     }\r
-    \r
+\r
+    public static WildcardType wildcardTypeFor(String packageName, String typeName) {\r
+        return new WildcardTypeImpl(packageName, typeName);\r
+    }\r
+\r
     public static ParameterizedType augmentableTypeFor(Type valueType) {\r
         final Type augmentable = typeForClass(Augmentable.class);\r
         return parameterizedTypeFor(augmentable, valueType);\r
     }\r
-    \r
+\r
     public static ParameterizedType augmentationTypeFor(Type valueType) {\r
         final Type augmentation = typeForClass(Augmentation.class);\r
         return parameterizedTypeFor(augmentation, valueType);\r
     }\r
-    \r
+\r
     private static class ConcreteTypeImpl extends AbstractBaseType implements\r
             ConcreteType {\r
         private ConcreteTypeImpl(String pkName, String name) {\r
@@ -135,4 +150,12 @@ public final class Types {
         }\r
 \r
     }\r
+\r
+    private static class WildcardTypeImpl extends AbstractBaseType\r
+            implements WildcardType {\r
+        public WildcardTypeImpl(String packageName, String typeName) {\r
+            super(packageName, typeName);\r
+        }\r
+    }\r
+\r
 }\r
index 558fb438504eda14a3c64b1b793f71f3f0a28e60..f1683fdc6435e86ccb98ea36389c1a24053b9d13 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
 import org.opendaylight.controller.sal.binding.model.api.Constant;
 import org.opendaylight.controller.sal.binding.model.api.Enumeration;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferIdentityObject;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
 import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
 import org.opendaylight.controller.sal.binding.model.api.Type;
@@ -26,11 +27,11 @@ import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedP
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.MethodSignatureBuilder;
 
-public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
+public class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
     private String packageName;
     private final String name;
     private String comment = "";
-    
+
     private GeneratedTransferObject extendsType;
     private final List<Type> implementsTypes = new ArrayList<Type>();
     private final List<EnumBuilder> enumerations = new ArrayList<EnumBuilder>();
@@ -81,7 +82,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
         return null;
     }
-    
+
     @Override
     public boolean addImplementsType(final Type genType) {
         if (genType != null) {
@@ -98,7 +99,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
         return false;
     }
-    
+
     @Override
     public EnumBuilder addEnumeration(String name) {
         final String innerPackageName = packageName + "." + this.name;
@@ -149,10 +150,20 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
 
     @Override
     public GeneratedTransferObject toInstance() {
-        return new GeneratedTransferObjectImpl(packageName, name, comment, 
-                annotationBuilders, extendsType, implementsTypes, constantDefintions, enumerations,
-                methodDefinitions, properties, equalsProperties,
-                hashProperties, toStringProperties);
+        return new GeneratedTransferObjectImpl(packageName, name, comment,
+                annotationBuilders, extendsType, implementsTypes,
+                constantDefintions, enumerations, methodDefinitions,
+                properties, equalsProperties, hashProperties,
+                toStringProperties);
+    }
+
+    @Override
+    public GeneratedTransferObject toIdentityInstance() {
+        return new GeneratedTransferIdentityObjectImpl(packageName, name, comment,
+                annotationBuilders, extendsType, implementsTypes,
+                constantDefintions, enumerations, methodDefinitions,
+                properties, equalsProperties, hashProperties,
+                toStringProperties);
     }
 
     private static final class GeneratedPropertyBuilderImpl implements
@@ -227,8 +238,9 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
 
         @Override
         public GeneratedProperty toInstance(final Type definingType) {
-            return new GeneratedPropertyImpl(name, comment, annotationBuilders, definingType,
-                    returnType, isFinal, isReadOnly, parameters, accessModifier);
+            return new GeneratedPropertyImpl(name, comment, annotationBuilders,
+                    definingType, returnType, isFinal, isReadOnly, parameters,
+                    accessModifier);
         }
     }
 
@@ -244,9 +256,10 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         private final boolean isReadOnly;
         private final List<MethodSignature.Parameter> parameters;
         private final AccessModifier modifier;
-        
+
         public GeneratedPropertyImpl(final String name, final String comment,
-                final List<AnnotationTypeBuilder> annotationBuilders, final Type parent, final Type returnType,
+                final List<AnnotationTypeBuilder> annotationBuilders,
+                final Type parent, final Type returnType,
                 final boolean isFinal, final boolean isReadOnly,
                 final List<Parameter> parameters, final AccessModifier modifier) {
             super();
@@ -284,7 +297,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public List<AnnotationType> getAnnotations() {
             return annotations;
         }
-        
+
         @Override
         public Type getReturnType() {
             return returnType;
@@ -310,8 +323,6 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             return isFinal;
         }
 
-        
-
         @Override
         public int hashCode() {
             final int prime = 31;
@@ -354,7 +365,8 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
                 if (other.returnType != null) {
                     return false;
                 }
-            } else if (!returnType.getPackageName().equals(other.returnType.getPackageName())) {
+            } else if (!returnType.getPackageName().equals(
+                    other.returnType.getPackageName())) {
                 return false;
             } else if (!returnType.getName().equals(other.returnType.getName())) {
                 return false;
@@ -394,7 +406,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
     }
 
-    private static final class GeneratedTransferObjectImpl implements
+    private static class GeneratedTransferObjectImpl implements
             GeneratedTransferObject {
 
         private final String packageName;
@@ -412,8 +424,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         private final List<Type> implementsTypes;
 
         public GeneratedTransferObjectImpl(final String packageName,
-                final String name,
-                final String comment,
+                final String name, final String comment,
                 final List<AnnotationTypeBuilder> annotationBuilders,
                 final GeneratedTransferObject extendsType,
                 final List<Type> implementsTypes,
@@ -430,7 +441,8 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             this.comment = comment;
             this.annotations = toUnmodifiableAnnotations(annotationBuilders);
             this.extendsType = extendsType;
-            this.implementsTypes = Collections.unmodifiableList(implementsTypes);
+            this.implementsTypes = Collections
+                    .unmodifiableList(implementsTypes);
             this.constants = toUnmodifiableConstant(constantBuilders);
             this.enumerations = toUnmodifiableEnumerations(enumBuilders);
             this.properties = toUnmodifiableProperties(propBuilers);
@@ -499,17 +511,17 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public Type getParentType() {
             return null;
         }
-        
+
         @Override
         public String getComment() {
             return comment;
         }
-        
+
         @Override
         public List<AnnotationType> getAnnotations() {
             return annotations;
         }
-        
+
         @Override
         public List<Type> getImplements() {
             return implementsTypes;
@@ -519,7 +531,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public GeneratedTransferObject getExtends() {
             return extendsType;
         }
-        
+
         @Override
         public List<Enumeration> getEnumDefintions() {
             return enumerations;
@@ -623,4 +635,26 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             return builder.toString();
         }
     }
+
+    private static final class GeneratedTransferIdentityObjectImpl extends
+            GeneratedTransferObjectImpl implements
+            GeneratedTransferIdentityObject {
+        public GeneratedTransferIdentityObjectImpl(final String packageName,
+                final String name, final String comment,
+                final List<AnnotationTypeBuilder> annotationBuilders,
+                final GeneratedTransferObject extendsType,
+                final List<Type> implementsTypes,
+                final List<ConstantBuilder> constantBuilders,
+                final List<EnumBuilder> enumBuilders,
+                final List<MethodSignatureBuilder> methodBuilders,
+                final List<GeneratedPropertyBuilder> propBuilers,
+                final List<GeneratedPropertyBuilder> equalsBuilers,
+                final List<GeneratedPropertyBuilder> hashCodeBuilers,
+                final List<GeneratedPropertyBuilder> stringBuilers) {
+            super(packageName, name, comment, annotationBuilders, extendsType,
+                    implementsTypes, constantBuilders, enumBuilders,
+                    methodBuilders, propBuilers, equalsBuilers,
+                    hashCodeBuilers, stringBuilers);
+        }
+    }
 }
index 0dcaa71c139be25d46bdaa250d07e9270dc13dd5..aaeec40604a61c264afef7d23e5f7111b115a1ef 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import org.opendaylight.controller.sal.binding.model.api.CodeGenerator;
 import org.opendaylight.controller.sal.binding.model.api.Enumeration;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferIdentityObject;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
 import org.opendaylight.controller.sal.binding.model.api.Type;
 
@@ -29,6 +30,8 @@ public final class ClassCodeGenerator implements CodeGenerator {
     @Override
     public Writer generate(Type type) throws IOException {
         final Writer writer = new StringWriter();
+        boolean isIdentity = type instanceof GeneratedTransferIdentityObject;
+
         if (type instanceof GeneratedTransferObject) {
             GeneratedTransferObject genTO = (GeneratedTransferObject) type;            
             imports = GeneratorUtil.createImports(genTO);
@@ -47,7 +50,7 @@ public final class ClassCodeGenerator implements CodeGenerator {
             writer.write(NL);
 
             writer.write(GeneratorUtil.createClassDeclaration(genTO, "",
-                    imports));
+                    imports, isIdentity));
             writer.write(NL);
             writer.write(NL);
             
@@ -66,7 +69,7 @@ public final class ClassCodeGenerator implements CodeGenerator {
                 }
                 writer.write(NL);
                 writer.write(GeneratorUtil.createConstructor(genTO, TAB,
-                        imports) + NL);
+                        imports, isIdentity) + NL);
                 writer.write(NL);
                 for (GeneratedProperty field : fields) {
                     writer.write(GeneratorUtil.createGetter(field, TAB,
index bd94c20ffb5b3bbdc5aaf06905771d2e18d9aa24..e5cb97f1a6e4fb7181a875f5342a40f06a7d7e87 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.java.api.generator;
 
 final class Constants {
-
     public static final String IFC = "interface";
     public static final String CLASS = "class";
     public static final String PKG = "package";
@@ -24,11 +23,13 @@ final class Constants {
     public static final String COMMA = ",";
     public static final String NL = "\n";
     public static final String SC = ";";
-    public static final String TAB = "\t";
+    public static final String TAB = "    ";
 
     public static final String PUBLIC = "public";
     public static final String PRIVATE = "private";
+    public static final String PROTECTED = "protected";
     public static final String STATIC = "static";
+    public static final String ABSTRACT = "abstract";
     public static final String FINAL = "final";
     public static final String EXTENDS = "extends";
     public static final String IMPLEMENTS = "implements";
index bb4bbbaf789191e29ff6e87a446595f84ee5bd5c..5b3b17dbf6c73334fe471dd3e797f8a18e228749 100644 (file)
@@ -26,670 +26,692 @@ import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
 import org.opendaylight.controller.sal.binding.model.api.MethodSignature.Parameter;
 import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
 import org.opendaylight.controller.sal.binding.model.api.Type;
+import org.opendaylight.controller.sal.binding.model.api.WildcardType;
 
 public final class GeneratorUtil {
 
-       private GeneratorUtil() {
-       }
-
-       public static String createIfcDeclaration(final GeneratedType genType,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               return createFileDeclaration(IFC, genType, indent, availableImports);
-       }
-
-       public static String createClassDeclaration(
-                       final GeneratedTransferObject genTransferObject,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               return createFileDeclaration(CLASS, genTransferObject, indent,
-                               availableImports);
-       }
-
-       public static String createPackageDeclaration(final String packageName) {
-               return PKG + GAP + packageName + SC;
-       }
-
-       private static String createFileDeclaration(final String type,
-                       final GeneratedType genType, final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               final StringBuilder builder = new StringBuilder();
-               final String currentPkg = genType.getPackageName();
-
-               createComment(builder, genType.getComment(), indent);
-
-               if (!genType.getAnnotations().isEmpty()) {
-                       final List<AnnotationType> annotations = genType.getAnnotations();
-                       appendAnnotations(builder, annotations);
-                       builder.append(NL);
-               }
-               builder.append(PUBLIC + GAP + type + GAP + genType.getName() + GAP);
-
-               if (genType instanceof GeneratedTransferObject) {
-                       GeneratedTransferObject genTO = (GeneratedTransferObject) genType;
-
-                       if (genTO.getExtends() != null) {
-                               builder.append(EXTENDS + GAP);
-                               builder.append(genTO.getExtends() + GAP);
-                       }
-               }
-
-               final List<Type> genImplements = genType.getImplements();
-               if (!genImplements.isEmpty()) {
-                       if (genType instanceof GeneratedTransferObject) {
-                               builder.append(IMPLEMENTS + GAP);
-                       } else {
-                               builder.append(EXTENDS + GAP);
-                       }
-                       builder.append(getExplicitType(genImplements.get(0),
-                                       availableImports, currentPkg));
-
-                       for (int i = 1; i < genImplements.size(); ++i) {
-                               builder.append(", ");
-                               builder.append(getExplicitType(genImplements.get(i),
-                                               availableImports, currentPkg));
-                       }
-               }
-
-               builder.append(GAP + LCB);
-               return builder.toString();
-       }
-
-       private static StringBuilder appendAnnotations(final StringBuilder builder,
-                       final List<AnnotationType> annotations) {
-               if ((builder != null) && (annotations != null)) {
-                       for (final AnnotationType annotation : annotations) {
-                               builder.append("@");
-                               builder.append(annotation.getPackageName());
-                               builder.append(".");
-                               builder.append(annotation.getName());
-
-                               if (annotation.containsParameters()) {
-                                       builder.append("(");
-                                       final List<AnnotationType.Parameter> parameters = annotation
-                                                       .getParameters();
-                                       appendAnnotationParams(builder, parameters);
-                                       builder.append(")");
-                               }
-                       }
-               }
-               return builder;
-       }
-
-       private static StringBuilder appendAnnotationParams(
-                       final StringBuilder builder,
-                       final List<AnnotationType.Parameter> parameters) {
-               if (parameters != null) {
-                       int i = 0;
-                       for (final AnnotationType.Parameter param : parameters) {
-                               if (param == null) {
-                                       continue;
-                               }
-                               if (i > 0) {
-                                       builder.append(", ");
-                               }
-                               final String paramName = param.getName();
-                               if (param.getValue() != null) {
-                                       builder.append(paramName);
-                                       builder.append(" = ");
-                                       builder.append(param.getValue());
-                               } else {
-                                       builder.append(paramName);
-                                       builder.append(" = {");
-                                       final List<String> values = param.getValues();
-                                       builder.append(values.get(0));
-                                       for (int j = 1; j < values.size(); ++j) {
-                                               builder.append(", ");
-                                               builder.append(values.get(j));
-                                       }
-                                       builder.append("}");
-                               }
-                               i++;
-                       }
-               }
-               return builder;
-       }
-
-       public static String createConstant(final Constant constant,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-               builder.append(indent + PUBLIC + GAP + STATIC + GAP + FINAL + GAP);
-               builder.append(getExplicitType(constant.getType(), availableImports,
-                               currentPkg) + GAP + constant.getName());
-               builder.append(GAP + "=" + GAP);
-               builder.append(constant.getValue() + SC);
-               return builder.toString();
-       }
-
-       public static String createField(final GeneratedProperty property,
-                       final String indent,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-               builder.append(indent);
-               if (!property.getAnnotations().isEmpty()) {
-                       final List<AnnotationType> annotations = property.getAnnotations();
-                       appendAnnotations(builder, annotations);
-                       builder.append(NL);
-               }
-               builder.append(indent + PRIVATE + GAP);
-               builder.append(getExplicitType(property.getReturnType(),
-                               availableImports, currentPkg) + GAP + property.getName());
-               builder.append(SC);
-               return builder.toString();
-       }
-
-       /**
-        * Create method declaration in interface.
-        * 
-        * @param method
-        * @param indent
-        * @return
-        */
-       public static String createMethodDeclaration(final MethodSignature method,
-                       final String indent,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-
-               if (method == null) {
-                       throw new IllegalArgumentException(
-                                       "Method Signature parameter MUST be specified and cannot be NULL!");
-               }
-
-               final String comment = method.getComment();
-               final String name = method.getName();
-               if (name == null) {
-                       throw new IllegalStateException("Method Name cannot be NULL!");
-               }
-
-               final Type type = method.getReturnType();
-               if (type == null) {
-                       throw new IllegalStateException(
-                                       "Method Return type cannot be NULL!");
-               }
-
-               final List<Parameter> parameters = method.getParameters();
-
-               createComment(builder, comment, indent);
-               builder.append(NL);
-               builder.append(indent);
-
-               if (!method.getAnnotations().isEmpty()) {
-                       final List<AnnotationType> annotations = method.getAnnotations();
-                       appendAnnotations(builder, annotations);
-                       builder.append(NL);
-               }
-
-               builder.append(indent
-                               + getExplicitType(type, availableImports, currentPkg) + GAP
-                               + name);
-               builder.append(LB);
-               for (int i = 0; i < parameters.size(); i++) {
-                       Parameter p = parameters.get(i);
-                       String separator = COMMA;
-                       if (i + 1 == parameters.size()) {
-                               separator = "";
-                       }
-                       builder.append(getExplicitType(p.getType(), availableImports,
-                                       currentPkg) + GAP + p.getName() + separator);
-               }
-               builder.append(RB);
-               builder.append(SC);
-
-               return builder.toString();
-       }
-
-       public static String createConstructor(
-                       GeneratedTransferObject genTransferObject, final String indent,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               final StringBuilder builder = new StringBuilder();
-
-               final String currentPkg = genTransferObject.getPackageName();
-               final List<GeneratedProperty> properties = genTransferObject
-                               .getProperties();
-               final List<GeneratedProperty> ctorParams = new ArrayList<GeneratedProperty>();
-               for (final GeneratedProperty property : properties) {
-                       if (property.isReadOnly()) {
-                               ctorParams.add(property);
-                       }
-               }
-
-               builder.append(indent);
-               builder.append(PUBLIC);
-               builder.append(GAP);
-               builder.append(genTransferObject.getName());
-               builder.append(LB);
-
-               if (!ctorParams.isEmpty()) {
-                       builder.append(getExplicitType(ctorParams.get(0).getReturnType(),
-                                       availableImports, currentPkg));
-                       builder.append(" ");
-                       builder.append(ctorParams.get(0).getName());
-                       for (int i = 1; i < ctorParams.size(); ++i) {
-                               final GeneratedProperty param = ctorParams.get(i);
-                               builder.append(", ");
-                               builder.append(getExplicitType(param.getReturnType(),
-                                               availableImports, currentPkg));
-                               builder.append(GAP);
-                               builder.append(param.getName());
-                       }
-               }
-               builder.append(RB + GAP + LCB + NL + indent + TAB + "super();" + NL);
-               if (!ctorParams.isEmpty()) {
-                       for (final GeneratedProperty property : ctorParams) {
-                               builder.append(indent);
-                               builder.append(TAB);
-                               builder.append("this.");
-                               builder.append(property.getName());
-                               builder.append(" = ");
-                               builder.append(property.getName());
-                               builder.append(SC);
-                               builder.append(NL);
-                       }
-               }
-               builder.append(indent);
-               builder.append(RCB);
-               return builder.toString();
-       }
-
-       public static String createGetter(final GeneratedProperty property,
-                       final String indent,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-
-               final Type type = property.getReturnType();
-               final String varName = property.getName();
-               final char first = Character.toUpperCase(varName.charAt(0));
-               final String methodName = "get" + first + varName.substring(1);
-
-               builder.append(indent + PUBLIC + GAP
-                               + getExplicitType(type, availableImports, currentPkg) + GAP
-                               + methodName);
-               builder.append(LB + RB + LCB + NL);
-
-               String currentIndent = indent + TAB;
-
-               builder.append(currentIndent + "return " + varName + SC + NL);
-
-               builder.append(indent + RCB);
-               return builder.toString();
-       }
-
-       public static String createSetter(final GeneratedProperty property,
-                       final String indent,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-
-               final Type type = property.getReturnType();
-               final String varName = property.getName();
-               final char first = Character.toUpperCase(varName.charAt(0));
-               final String methodName = "set" + first + varName.substring(1);
-
-               builder.append(indent + PUBLIC + GAP + "void" + GAP + methodName);
-               builder.append(LB + getExplicitType(type, availableImports, currentPkg)
-                               + GAP + varName + RB + LCB + NL);
-               String currentIndent = indent + TAB;
-               builder.append(currentIndent + "this." + varName + " = " + varName + SC
-                               + NL);
-               builder.append(indent + RCB);
-               return builder.toString();
-       }
-
-       public static String createHashCode(
-                       final List<GeneratedProperty> properties, final String indent) {
-               StringBuilder builder = new StringBuilder();
-               builder.append(indent + "public int hashCode() {" + NL);
-               builder.append(indent + TAB + "final int prime = 31;" + NL);
-               builder.append(indent + TAB + "int result = 1;" + NL);
-
-               for (GeneratedProperty property : properties) {
-                       String fieldName = property.getName();
-                       builder.append(indent + TAB + "result = prime * result + (("
-                                       + fieldName + " == null) ? 0 : " + fieldName
-                                       + ".hashCode());" + NL);
-               }
-
-               builder.append(indent + TAB + "return result;" + NL);
-               builder.append(indent + RCB + NL);
-               return builder.toString();
-       }
-
-       public static String createEquals(final GeneratedTransferObject type,
-                       final List<GeneratedProperty> properties, final String indent) {
-               StringBuilder builder = new StringBuilder();
-               final String indent1 = indent + TAB;
-               final String indent2 = indent1 + TAB;
-               final String indent3 = indent2 + TAB;
-
-               builder.append(indent + "public boolean equals(Object obj) {" + NL);
-               builder.append(indent1 + "if (this == obj) {" + NL);
-               builder.append(indent2 + "return true;" + NL);
-               builder.append(indent1 + "}" + NL);
-               builder.append(indent1 + "if (obj == null) {" + NL);
-               builder.append(indent2 + "return false;" + NL);
-               builder.append(indent1 + "}" + NL);
-               builder.append(indent1 + "if (getClass() != obj.getClass()) {" + NL);
-               builder.append(indent2 + "return false;" + NL);
-               builder.append(indent1 + "}" + NL);
-
-               String typeStr = type.getName();
-               builder.append(indent1 + typeStr + " other = (" + typeStr + ") obj;"
-                               + NL);
-
-               for (GeneratedProperty property : properties) {
-                       String fieldName = property.getName();
-                       builder.append(indent1 + "if (" + fieldName + " == null) {" + NL);
-                       builder.append(indent2 + "if (other." + fieldName + " != null) {"
-                                       + NL);
-                       builder.append(indent3 + "return false;" + NL);
-                       builder.append(indent2 + "}" + NL);
-                       builder.append(indent1 + "} else if (!" + fieldName
-                                       + ".equals(other." + fieldName + ")) {" + NL);
-                       builder.append(indent2 + "return false;" + NL);
-                       builder.append(indent1 + "}" + NL);
-               }
-
-               builder.append(indent1 + "return true;" + NL);
-
-               builder.append(indent + RCB + NL);
-               return builder.toString();
-       }
-
-       public static String createToString(final GeneratedTransferObject type,
-                       final List<GeneratedProperty> properties, final String indent) {
-               StringBuilder builder = new StringBuilder();
-               builder.append(indent);
-               builder.append("public String toString() {");
-               builder.append(NL);
-               builder.append(indent);
-               builder.append(TAB);
-               builder.append("StringBuilder builder = new StringBuilder();");
-               builder.append(NL);
-               builder.append(indent);
-               builder.append(TAB);
-               builder.append("builder.append(\"");
-               builder.append(type.getName());
-               builder.append(" [");
-
-               boolean first = true;
-               for (GeneratedProperty property : properties) {
-                       if (first) {
-                               builder.append(property.getName());
-                               builder.append("=\");");
-                               builder.append(NL);
-                               builder.append(indent);
-                               builder.append(TAB);
-                               builder.append("builder.append(");
-                               builder.append(property.getName());
-                               builder.append(");");
-                               first = false;
-                       } else {
-                               builder.append(NL);
-                               builder.append(indent);
-                               builder.append(TAB);
-                               builder.append("builder.append(\", ");
-                               builder.append(property.getName());
-                               builder.append("=\");");
-                               builder.append(NL);
-                               builder.append(indent);
-                               builder.append(TAB);
-                               builder.append("builder.append(");
-                               builder.append(property.getName());
-                               builder.append(");");
-                       }
-               }
-               builder.append(NL);
-               builder.append(indent);
-               builder.append(TAB);
-               builder.append("builder.append(\"]\");");
-               builder.append(NL);
-               builder.append(indent);
-               builder.append(TAB);
-               builder.append("return builder.toString();");
-
-               builder.append(NL);
-               builder.append(indent);
-               builder.append(RCB);
-               builder.append(NL);
-               return builder.toString();
-       }
-
-       public static String createEnum(final Enumeration enumeration,
-                       final String indent) {
-               if (enumeration == null || indent == null)
-                       throw new IllegalArgumentException();
-               final StringBuilder builder = new StringBuilder(indent + PUBLIC + GAP
-                               + ENUM + GAP + enumeration.getName() + GAP + LCB + NL);
-
-               String separator = COMMA + NL;
-               final List<Pair> values = enumeration.getValues();
-
-               for (int i = 0; i < values.size(); i++) {
-                       if (i + 1 == values.size()) {
-                               separator = SC;
-                       }
-                       builder.append(indent + TAB + values.get(i).getName() + LB
-                                       + values.get(i).getValue() + RB + separator);
-               }
-               builder.append(NL);
-               builder.append(NL);
-               final String ENUMERATION_NAME = "value";
-               final String ENUMERATION_TYPE = "int";
-               builder.append(indent + TAB + ENUMERATION_TYPE + GAP + ENUMERATION_NAME
-                               + SC);
-               builder.append(NL);
-               builder.append(indent + TAB + PRIVATE + GAP + enumeration.getName()
-                               + LB + ENUMERATION_TYPE + GAP + ENUMERATION_NAME + RB + GAP
-                               + LCB + NL);
-               builder.append(indent + TAB + TAB + "this." + ENUMERATION_NAME + GAP
-                               + "=" + GAP + ENUMERATION_NAME + SC + NL);
-               builder.append(indent + TAB + RCB + NL);
-
-               builder.append(indent + RCB);
-               builder.append(NL);
-               return builder.toString();
-       }
-
-       private static String getExplicitType(final Type type,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String currentPkg) {
-               if (type == null) {
-                       throw new IllegalArgumentException(
-                                       "Type parameter MUST be specified and cannot be NULL!");
-               }
-               String packageName = type.getPackageName();
-
-               LinkedHashMap<String, Integer> imports = availableImports.get(type
-                               .getName());
-
-               if ((imports != null && packageName
-                               .equals(findMaxValue(imports).get(0)))
-                               || packageName.equals(currentPkg)) {
-                       final StringBuilder builder = new StringBuilder(type.getName());
-                       if (type instanceof ParameterizedType) {
-                               ParameterizedType pType = (ParameterizedType) type;
-                               Type[] pTypes = pType.getActualTypeArguments();
-                               builder.append("<");
-                               builder.append(getParameters(pTypes, availableImports,
-                                               currentPkg));
-                               builder.append(">");
-                       }
-                       if (builder.toString().equals("Void")) {
-                               return "void";
-                       }
-                       return builder.toString();
-               } else {
-                       final StringBuilder builder = new StringBuilder();
-                       if (packageName.startsWith("java.lang")) {
-                               builder.append(type.getName());
-                       } else {
+    private GeneratorUtil() {
+    }
+
+    public static String createIfcDeclaration(final GeneratedType genType,
+            final String indent,
+            final Map<String, LinkedHashMap<String, Integer>> availableImports) {
+        return createFileDeclaration(IFC, genType, indent, availableImports,
+                false);
+    }
+
+    public static String createClassDeclaration(
+            final GeneratedTransferObject genTransferObject,
+            final String indent,
+            final Map<String, LinkedHashMap<String, Integer>> availableImports,
+            boolean isIdentity) {
+        return createFileDeclaration(CLASS, genTransferObject, indent,
+                availableImports, isIdentity);
+    }
+
+    public static String createPackageDeclaration(final String packageName) {
+        return PKG + GAP + packageName + SC;
+    }
+
+    private static String createFileDeclaration(final String type,
+            final GeneratedType genType, final String indent,
+            final Map<String, LinkedHashMap<String, Integer>> availableImports,
+            boolean isIdentity) {
+        final StringBuilder builder = new StringBuilder();
+        final String currentPkg = genType.getPackageName();
+
+        createComment(builder, genType.getComment(), indent);
+
+        if (!genType.getAnnotations().isEmpty()) {
+            final List<AnnotationType> annotations = genType.getAnnotations();
+            appendAnnotations(builder, annotations);
+            builder.append(NL);
+        }
+
+        if (isIdentity) {
+            if (!(CLASS.equals(type))) {
+                throw new IllegalArgumentException(
+                        "'identity' has to be generated as a class");
+            }
+            builder.append(PUBLIC + GAP + ABSTRACT + GAP + type + GAP
+                    + genType.getName() + GAP);
+        } else {
+            builder.append(PUBLIC + GAP + type + GAP + genType.getName() + GAP);
+        }
+
+        if (genType instanceof GeneratedTransferObject) {
+            GeneratedTransferObject genTO = (GeneratedTransferObject) genType;
+
+            if (genTO.getExtends() != null) {
+                builder.append(EXTENDS + GAP);
+                String gtoString = getExplicitType(genTO.getExtends(), availableImports, currentPkg);
+                builder.append(gtoString + GAP);
+            }
+        }
+
+        final List<Type> genImplements = genType.getImplements();
+        if (!genImplements.isEmpty()) {
+            if (genType instanceof GeneratedTransferObject) {
+                builder.append(IMPLEMENTS + GAP);
+            } else {
+                builder.append(EXTENDS + GAP);
+            }
+            builder.append(getExplicitType(genImplements.get(0),
+                    availableImports, currentPkg));
+
+            for (int i = 1; i < genImplements.size(); ++i) {
+                builder.append(", ");
+                builder.append(getExplicitType(genImplements.get(i),
+                        availableImports, currentPkg));
+            }
+        }
+
+        builder.append(GAP + LCB);
+        return builder.toString();
+    }
+
+    private static StringBuilder appendAnnotations(final StringBuilder builder,
+            final List<AnnotationType> annotations) {
+        if ((builder != null) && (annotations != null)) {
+            for (final AnnotationType annotation : annotations) {
+                builder.append("@");
+                builder.append(annotation.getPackageName());
+                builder.append(".");
+                builder.append(annotation.getName());
+
+                if (annotation.containsParameters()) {
+                    builder.append("(");
+                    final List<AnnotationType.Parameter> parameters = annotation
+                            .getParameters();
+                    appendAnnotationParams(builder, parameters);
+                    builder.append(")");
+                }
+            }
+        }
+        return builder;
+    }
+
+    private static StringBuilder appendAnnotationParams(
+            final StringBuilder builder,
+            final List<AnnotationType.Parameter> parameters) {
+        if (parameters != null) {
+            int i = 0;
+            for (final AnnotationType.Parameter param : parameters) {
+                if (param == null) {
+                    continue;
+                }
+                if (i > 0) {
+                    builder.append(", ");
+                }
+                final String paramName = param.getName();
+                if (param.getValue() != null) {
+                    builder.append(paramName);
+                    builder.append(" = ");
+                    builder.append(param.getValue());
+                } else {
+                    builder.append(paramName);
+                    builder.append(" = {");
+                    final List<String> values = param.getValues();
+                    builder.append(values.get(0));
+                    for (int j = 1; j < values.size(); ++j) {
+                        builder.append(", ");
+                        builder.append(values.get(j));
+                    }
+                    builder.append("}");
+                }
+                i++;
+            }
+        }
+        return builder;
+    }
+
+    public static String createConstant(final Constant constant,
+            final String indent,
+            final Map<String, LinkedHashMap<String, Integer>> availableImports,
+            final String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+        builder.append(indent + PUBLIC + GAP + STATIC + GAP + FINAL + GAP);
+        builder.append(getExplicitType(constant.getType(), availableImports,
+                currentPkg) + GAP + constant.getName());
+        builder.append(GAP + "=" + GAP);
+        builder.append(constant.getValue() + SC);
+        return builder.toString();
+    }
+
+    public static String createField(final GeneratedProperty property,
+            final String indent,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            final String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+        if (!property.getAnnotations().isEmpty()) {
+            final List<AnnotationType> annotations = property.getAnnotations();
+            appendAnnotations(builder, annotations);
+            builder.append(NL);
+        }
+        builder.append(indent + PRIVATE + GAP);
+        builder.append(getExplicitType(property.getReturnType(),
+                availableImports, currentPkg) + GAP + property.getName());
+        builder.append(SC);
+        return builder.toString();
+    }
+
+    /**
+     * Create method declaration in interface.
+     * 
+     * @param method
+     * @param indent
+     * @return
+     */
+    public static String createMethodDeclaration(final MethodSignature method,
+            final String indent,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            final String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+
+        if (method == null) {
+            throw new IllegalArgumentException(
+                    "Method Signature parameter MUST be specified and cannot be NULL!");
+        }
+
+        final String comment = method.getComment();
+        final String name = method.getName();
+        if (name == null) {
+            throw new IllegalStateException("Method Name cannot be NULL!");
+        }
+
+        final Type type = method.getReturnType();
+        if (type == null) {
+            throw new IllegalStateException(
+                    "Method Return type cannot be NULL!");
+        }
+
+        final List<Parameter> parameters = method.getParameters();
+
+        createComment(builder, comment, indent);
+        builder.append(NL);
+        builder.append(indent);
+
+        if (!method.getAnnotations().isEmpty()) {
+            final List<AnnotationType> annotations = method.getAnnotations();
+            appendAnnotations(builder, annotations);
+            builder.append(NL);
+        }
+
+        builder.append(indent
+                + getExplicitType(type, availableImports, currentPkg) + GAP
+                + name);
+        builder.append(LB);
+        for (int i = 0; i < parameters.size(); i++) {
+            Parameter p = parameters.get(i);
+            String separator = COMMA;
+            if (i + 1 == parameters.size()) {
+                separator = "";
+            }
+            builder.append(getExplicitType(p.getType(), availableImports,
+                    currentPkg) + GAP + p.getName() + separator);
+        }
+        builder.append(RB);
+        builder.append(SC);
+
+        return builder.toString();
+    }
+
+    public static String createConstructor(
+            GeneratedTransferObject genTransferObject, final String indent,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            boolean isIdentity) {
+        final StringBuilder builder = new StringBuilder();
+
+        final String currentPkg = genTransferObject.getPackageName();
+        final List<GeneratedProperty> properties = genTransferObject
+                .getProperties();
+        final List<GeneratedProperty> ctorParams = new ArrayList<GeneratedProperty>();
+        for (final GeneratedProperty property : properties) {
+            if (property.isReadOnly()) {
+                ctorParams.add(property);
+            }
+        }
+
+        builder.append(indent);
+        builder.append(isIdentity ? PROTECTED : PUBLIC);
+        builder.append(GAP);
+        builder.append(genTransferObject.getName());
+        builder.append(LB);
+
+        if (!ctorParams.isEmpty()) {
+            builder.append(getExplicitType(ctorParams.get(0).getReturnType(),
+                    availableImports, currentPkg));
+            builder.append(" ");
+            builder.append(ctorParams.get(0).getName());
+            for (int i = 1; i < ctorParams.size(); ++i) {
+                final GeneratedProperty param = ctorParams.get(i);
+                builder.append(", ");
+                builder.append(getExplicitType(param.getReturnType(),
+                        availableImports, currentPkg));
+                builder.append(GAP);
+                builder.append(param.getName());
+            }
+        }
+        builder.append(RB + GAP + LCB + NL + indent + TAB + "super();" + NL);
+        if (!ctorParams.isEmpty()) {
+            for (final GeneratedProperty property : ctorParams) {
+                builder.append(indent);
+                builder.append(TAB);
+                builder.append("this.");
+                builder.append(property.getName());
+                builder.append(" = ");
+                builder.append(property.getName());
+                builder.append(SC);
+                builder.append(NL);
+            }
+        }
+        builder.append(indent);
+        builder.append(RCB);
+        return builder.toString();
+    }
+
+    public static String createGetter(final GeneratedProperty property,
+            final String indent,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            final String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+
+        final Type type = property.getReturnType();
+        final String varName = property.getName();
+        final char first = Character.toUpperCase(varName.charAt(0));
+        final String methodName = "get" + first + varName.substring(1);
+
+        builder.append(indent + PUBLIC + GAP
+                + getExplicitType(type, availableImports, currentPkg) + GAP
+                + methodName);
+        builder.append(LB + RB + LCB + NL);
+
+        String currentIndent = indent + TAB;
+
+        builder.append(currentIndent + "return " + varName + SC + NL);
+
+        builder.append(indent + RCB);
+        return builder.toString();
+    }
+
+    public static String createSetter(final GeneratedProperty property,
+            final String indent,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+
+        final Type type = property.getReturnType();
+        final String varName = property.getName();
+        final char first = Character.toUpperCase(varName.charAt(0));
+        final String methodName = "set" + first + varName.substring(1);
+
+        builder.append(indent + PUBLIC + GAP + "void" + GAP + methodName);
+        builder.append(LB + getExplicitType(type, availableImports, currentPkg)
+                + GAP + varName + RB + LCB + NL);
+        String currentIndent = indent + TAB;
+        builder.append(currentIndent + "this." + varName + " = " + varName + SC
+                + NL);
+        builder.append(indent + RCB);
+        return builder.toString();
+    }
+
+    public static String createHashCode(
+            final List<GeneratedProperty> properties, final String indent) {
+        StringBuilder builder = new StringBuilder();
+        builder.append(indent + "public int hashCode() {" + NL);
+        builder.append(indent + TAB + "final int prime = 31;" + NL);
+        builder.append(indent + TAB + "int result = 1;" + NL);
+
+        for (GeneratedProperty property : properties) {
+            String fieldName = property.getName();
+            builder.append(indent + TAB + "result = prime * result + (("
+                    + fieldName + " == null) ? 0 : " + fieldName
+                    + ".hashCode());" + NL);
+        }
+
+        builder.append(indent + TAB + "return result;" + NL);
+        builder.append(indent + RCB + NL);
+        return builder.toString();
+    }
+
+    public static String createEquals(final GeneratedTransferObject type,
+            final List<GeneratedProperty> properties, final String indent) {
+        StringBuilder builder = new StringBuilder();
+        final String indent1 = indent + TAB;
+        final String indent2 = indent1 + TAB;
+        final String indent3 = indent2 + TAB;
+
+        builder.append(indent + "public boolean equals(Object obj) {" + NL);
+        builder.append(indent1 + "if (this == obj) {" + NL);
+        builder.append(indent2 + "return true;" + NL);
+        builder.append(indent1 + "}" + NL);
+        builder.append(indent1 + "if (obj == null) {" + NL);
+        builder.append(indent2 + "return false;" + NL);
+        builder.append(indent1 + "}" + NL);
+        builder.append(indent1 + "if (getClass() != obj.getClass()) {" + NL);
+        builder.append(indent2 + "return false;" + NL);
+        builder.append(indent1 + "}" + NL);
+
+        String typeStr = type.getName();
+        builder.append(indent1 + typeStr + " other = (" + typeStr + ") obj;"
+                + NL);
+
+        for (GeneratedProperty property : properties) {
+            String fieldName = property.getName();
+            builder.append(indent1 + "if (" + fieldName + " == null) {" + NL);
+            builder.append(indent2 + "if (other." + fieldName + " != null) {"
+                    + NL);
+            builder.append(indent3 + "return false;" + NL);
+            builder.append(indent2 + "}" + NL);
+            builder.append(indent1 + "} else if (!" + fieldName
+                    + ".equals(other." + fieldName + ")) {" + NL);
+            builder.append(indent2 + "return false;" + NL);
+            builder.append(indent1 + "}" + NL);
+        }
+
+        builder.append(indent1 + "return true;" + NL);
+
+        builder.append(indent + RCB + NL);
+        return builder.toString();
+    }
+
+    public static String createToString(final GeneratedTransferObject type,
+            final List<GeneratedProperty> properties, final String indent) {
+        StringBuilder builder = new StringBuilder();
+        builder.append(indent);
+        builder.append("public String toString() {");
+        builder.append(NL);
+        builder.append(indent);
+        builder.append(TAB);
+        builder.append("StringBuilder builder = new StringBuilder();");
+        builder.append(NL);
+        builder.append(indent);
+        builder.append(TAB);
+        builder.append("builder.append(\"");
+        builder.append(type.getName());
+        builder.append(" [");
+
+        boolean first = true;
+        for (GeneratedProperty property : properties) {
+            if (first) {
+                builder.append(property.getName());
+                builder.append("=\");");
+                builder.append(NL);
+                builder.append(indent);
+                builder.append(TAB);
+                builder.append("builder.append(");
+                builder.append(property.getName());
+                builder.append(");");
+                first = false;
+            } else {
+                builder.append(NL);
+                builder.append(indent);
+                builder.append(TAB);
+                builder.append("builder.append(\", ");
+                builder.append(property.getName());
+                builder.append("=\");");
+                builder.append(NL);
+                builder.append(indent);
+                builder.append(TAB);
+                builder.append("builder.append(");
+                builder.append(property.getName());
+                builder.append(");");
+            }
+        }
+        builder.append(NL);
+        builder.append(indent);
+        builder.append(TAB);
+        builder.append("builder.append(\"]\");");
+        builder.append(NL);
+        builder.append(indent);
+        builder.append(TAB);
+        builder.append("return builder.toString();");
+
+        builder.append(NL);
+        builder.append(indent);
+        builder.append(RCB);
+        builder.append(NL);
+        return builder.toString();
+    }
+
+    public static String createEnum(final Enumeration enumeration,
+            final String indent) {
+        if (enumeration == null || indent == null)
+            throw new IllegalArgumentException();
+        final StringBuilder builder = new StringBuilder(indent + PUBLIC + GAP
+                + ENUM + GAP + enumeration.getName() + GAP + LCB + NL);
+
+        String separator = COMMA + NL;
+        final List<Pair> values = enumeration.getValues();
+
+        for (int i = 0; i < values.size(); i++) {
+            if (i + 1 == values.size()) {
+                separator = SC;
+            }
+            builder.append(indent + TAB + values.get(i).getName() + LB
+                    + values.get(i).getValue() + RB + separator);
+        }
+        builder.append(NL);
+        builder.append(NL);
+        final String ENUMERATION_NAME = "value";
+        final String ENUMERATION_TYPE = "int";
+        builder.append(indent + TAB + ENUMERATION_TYPE + GAP + ENUMERATION_NAME
+                + SC);
+        builder.append(NL);
+        builder.append(indent + TAB + PRIVATE + GAP + enumeration.getName()
+                + LB + ENUMERATION_TYPE + GAP + ENUMERATION_NAME + RB + GAP
+                + LCB + NL);
+        builder.append(indent + TAB + TAB + "this." + ENUMERATION_NAME + GAP
+                + "=" + GAP + ENUMERATION_NAME + SC + NL);
+        builder.append(indent + TAB + RCB + NL);
+
+        builder.append(indent + RCB);
+        builder.append(NL);
+        return builder.toString();
+    }
+
+    private static String getExplicitType(final Type type,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            final String currentPkg) {
+        if (type == null) {
+            throw new IllegalArgumentException(
+                    "Type parameter MUST be specified and cannot be NULL!");
+        }
+        String packageName = type.getPackageName();
+
+        LinkedHashMap<String, Integer> imports = availableImports.get(type
+                .getName());
+
+        if ((imports != null && packageName
+                .equals(findMaxValue(imports).get(0)))
+                || packageName.equals(currentPkg)) {
+            final StringBuilder builder = new StringBuilder(type.getName());
+            if (type instanceof ParameterizedType) {
+                ParameterizedType pType = (ParameterizedType) type;
+                Type[] pTypes = pType.getActualTypeArguments();
+                builder.append("<");
+                builder.append(getParameters(pTypes, availableImports,
+                        currentPkg));
+                builder.append(">");
+            }
+            if (builder.toString().equals("Void")) {
+                return "void";
+            }
+            return builder.toString();
+        } else {
+            final StringBuilder builder = new StringBuilder();
+            if (packageName.startsWith("java.lang")) {
+                builder.append(type.getName());
+            } else {
                 if (!packageName.isEmpty()) {
                     builder.append(packageName + "." + type.getName());
                 } else {
                     builder.append(type.getName());
                 }
 
-                       }
-                       if (type instanceof ParameterizedType) {
-                               ParameterizedType pType = (ParameterizedType) type;
-                               Type[] pTypes = pType.getActualTypeArguments();
-                               builder.append("<");
-                               builder.append(getParameters(pTypes, availableImports,
-                                               currentPkg));
-                               builder.append(">");
-                       }
-                       if (builder.toString().equals("Void")) {
-                               return "void";
-                       }
-                       return builder.toString();
-               }
-       }
-
-       private static String getParameters(final Type[] pTypes,
-                       Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       String currentPkg) {
-               final StringBuilder builder = new StringBuilder();
-               for (int i = 0; i < pTypes.length; i++) {
-                       Type t = pTypes[i];
-
-                       String separator = COMMA;
-                       if (i + 1 == pTypes.length) {
-                               separator = "";
-                       }
-                       builder.append(getExplicitType(t, availableImports, currentPkg)
-                                       + separator);
-               }
-               return builder.toString();
-       }
-
-       private static List<String> findMaxValue(
-                       LinkedHashMap<String, Integer> imports) {
-               final List<String> result = new ArrayList<String>();
-
-               int maxValue = 0;
-               int currentValue = 0;
-               for (Map.Entry<String, Integer> entry : imports.entrySet()) {
-                       currentValue = entry.getValue();
-                       if (currentValue > maxValue) {
-                               result.clear();
-                               result.add(entry.getKey());
-                       } else if (currentValue == maxValue) {
-                               result.add(entry.getKey());
-                       }
-               }
-               return result;
-       }
-
-       private static void createComment(final StringBuilder builder,
-                       final String comment, final String indent) {
-               if (comment != null && comment.length() > 0) {
-                       builder.append(indent + "/*" + NL);
-                       builder.append(indent + comment + NL);
-                       builder.append(indent + "*/" + NL);
-               }
-       }
-
-       public static Map<String, LinkedHashMap<String, Integer>> createImports(
-                       GeneratedType genType) {
-               final Map<String, LinkedHashMap<String, Integer>> imports = new HashMap<String, LinkedHashMap<String, Integer>>();
-               final String genTypePkg = genType.getPackageName();
-
-               final List<Constant> constants = genType.getConstantDefinitions();
-               final List<MethodSignature> methods = genType.getMethodDefinitions();
-               List<Type> impl = genType.getImplements();
-
-               // IMPLEMENTATIONS
-               if (impl != null) {
-                       for (Type t : impl) {
-                               addTypeToImports(t, imports, genTypePkg);
-                       }
-               }
-
-               // CONSTANTS
-               if (constants != null) {
-                       for (Constant c : constants) {
-                               Type ct = c.getType();
-                               addTypeToImports(ct, imports, genTypePkg);
-                       }
-               }
-
-               // METHODS
-               if (methods != null) {
-                       for (MethodSignature m : methods) {
-                               Type ct = m.getReturnType();
-                               addTypeToImports(ct, imports, genTypePkg);
-                               for (MethodSignature.Parameter p : m.getParameters()) {
-                                       addTypeToImports(p.getType(), imports, genTypePkg);
-                               }
-                       }
-               }
-
-               // PROPERTIES
-               if (genType instanceof GeneratedTransferObject) {
-                       GeneratedTransferObject genTO = (GeneratedTransferObject) genType;
-
-                       List<GeneratedProperty> props = genTO.getProperties();
-                       if (props != null) {
-                               for (GeneratedProperty prop : props) {
-                                       Type pt = prop.getReturnType();
-                                       addTypeToImports(pt, imports, genTypePkg);
-                               }
-                       }
-               }
-
-               return imports;
-       }
-
-       private static void addTypeToImports(Type type,
-                       Map<String, LinkedHashMap<String, Integer>> importedTypes,
-                       String genTypePkg) {
-               String typeName = type.getName();
-               String typePkg = type.getPackageName();
+            }
+            if (type instanceof ParameterizedType) {
+                ParameterizedType pType = (ParameterizedType) type;
+                Type[] pTypes = pType.getActualTypeArguments();
+                builder.append("<");
+                builder.append(getParameters(pTypes, availableImports,
+                        currentPkg));
+                builder.append(">");
+            }
+            if (builder.toString().equals("Void")) {
+                return "void";
+            }
+            return builder.toString();
+        }
+    }
+
+    private static String getParameters(final Type[] pTypes,
+            Map<String, LinkedHashMap<String, Integer>> availableImports,
+            String currentPkg) {
+        final StringBuilder builder = new StringBuilder();
+        for (int i = 0; i < pTypes.length; i++) {
+            Type t = pTypes[i];
+
+            String separator = COMMA;
+            if (i + 1 == pTypes.length) {
+                separator = "";
+            }
+            
+            String wildcardParam = "";
+            if(t instanceof WildcardType) {
+                wildcardParam = "? extends ";
+            }
+            
+            builder.append(wildcardParam + getExplicitType(t, availableImports, currentPkg)
+                    + separator);
+        }
+        return builder.toString();
+    }
+
+    private static List<String> findMaxValue(
+            LinkedHashMap<String, Integer> imports) {
+        final List<String> result = new ArrayList<String>();
+
+        int maxValue = 0;
+        int currentValue = 0;
+        for (Map.Entry<String, Integer> entry : imports.entrySet()) {
+            currentValue = entry.getValue();
+            if (currentValue > maxValue) {
+                result.clear();
+                result.add(entry.getKey());
+                maxValue = currentValue;
+            } else if (currentValue == maxValue) {
+                result.add(entry.getKey());
+            }
+        }
+        return result;
+    }
+
+    private static void createComment(final StringBuilder builder,
+            final String comment, final String indent) {
+        if (comment != null && comment.length() > 0) {
+            builder.append(indent + "/*" + NL);
+            builder.append(indent + comment + NL);
+            builder.append(indent + "*/" + NL);
+        }
+    }
+
+    public static Map<String, LinkedHashMap<String, Integer>> createImports(
+            GeneratedType genType) {
+        final Map<String, LinkedHashMap<String, Integer>> imports = new HashMap<String, LinkedHashMap<String, Integer>>();
+        final String genTypePkg = genType.getPackageName();
+
+        final List<Constant> constants = genType.getConstantDefinitions();
+        final List<MethodSignature> methods = genType.getMethodDefinitions();
+        List<Type> impl = genType.getImplements();
+
+        // IMPLEMENTATIONS
+        if (impl != null) {
+            for (Type t : impl) {
+                addTypeToImports(t, imports, genTypePkg);
+            }
+        }
+
+        // CONSTANTS
+        if (constants != null) {
+            for (Constant c : constants) {
+                Type ct = c.getType();
+                addTypeToImports(ct, imports, genTypePkg);
+            }
+        }
+
+        // METHODS
+        if (methods != null) {
+            for (MethodSignature m : methods) {
+                Type ct = m.getReturnType();
+                addTypeToImports(ct, imports, genTypePkg);
+                for (MethodSignature.Parameter p : m.getParameters()) {
+                    addTypeToImports(p.getType(), imports, genTypePkg);
+                }
+            }
+        }
+
+        // PROPERTIES
+        if (genType instanceof GeneratedTransferObject) {
+            GeneratedTransferObject genTO = (GeneratedTransferObject) genType;
+
+            List<GeneratedProperty> props = genTO.getProperties();
+            if (props != null) {
+                for (GeneratedProperty prop : props) {
+                    Type pt = prop.getReturnType();
+                    addTypeToImports(pt, imports, genTypePkg);
+                }
+            }
+        }
+
+        return imports;
+    }
+
+    private static void addTypeToImports(Type type,
+            Map<String, LinkedHashMap<String, Integer>> importedTypes,
+            String genTypePkg) {
+        String typeName = type.getName();
+        String typePkg = type.getPackageName();
                if (typePkg.startsWith("java.lang") || typePkg.equals(genTypePkg) ||
                 typePkg.isEmpty()) {
-                       return;
-               }
-               LinkedHashMap<String, Integer> packages = importedTypes.get(typeName);
-               if (packages == null) {
-                       packages = new LinkedHashMap<String, Integer>();
-                       packages.put(typePkg, 1);
-                       importedTypes.put(typeName, packages);
-               } else {
-                       Integer occurrence = packages.get(typePkg);
-                       if (occurrence == null) {
-                               packages.put(typePkg, 1);
-                       } else {
-                               occurrence++;
-                               packages.put(typePkg, occurrence);
-                       }
-               }
-
-               if (type instanceof ParameterizedType) {
-                       ParameterizedType pt = (ParameterizedType) type;
-                       Type[] params = pt.getActualTypeArguments();
-                       for (Type param : params) {
-                               addTypeToImports(param, importedTypes, genTypePkg);
-                       }
-               }
-       }
-
-       public static List<String> createImportLines(
-                       Map<String, LinkedHashMap<String, Integer>> imports) {
-               List<String> importLines = new ArrayList<String>();
-
-               for (Map.Entry<String, LinkedHashMap<String, Integer>> entry : imports
-                               .entrySet()) {
-                       String typeName = entry.getKey();
-                       LinkedHashMap<String, Integer> typePkgMap = entry.getValue();
-                       String typePkg = typePkgMap.keySet().iterator().next();
-                       importLines.add("import " + typePkg + "." + typeName + SC);
-               }
-               return importLines;
-       }
+            return;
+        }
+        LinkedHashMap<String, Integer> packages = importedTypes.get(typeName);
+        if (packages == null) {
+            packages = new LinkedHashMap<String, Integer>();
+            packages.put(typePkg, 1);
+            importedTypes.put(typeName, packages);
+        } else {
+            Integer occurrence = packages.get(typePkg);
+            if (occurrence == null) {
+                packages.put(typePkg, 1);
+            } else {
+                occurrence++;
+                packages.put(typePkg, occurrence);
+            }
+        }
+
+        if (type instanceof ParameterizedType) {
+            ParameterizedType pt = (ParameterizedType) type;
+            Type[] params = pt.getActualTypeArguments();
+            for (Type param : params) {
+                addTypeToImports(param, importedTypes, genTypePkg);
+            }
+        }
+    }
+
+    public static List<String> createImportLines(
+            Map<String, LinkedHashMap<String, Integer>> imports) {
+        List<String> importLines = new ArrayList<String>();
+
+        for (Map.Entry<String, LinkedHashMap<String, Integer>> entry : imports
+                .entrySet()) {
+            String typeName = entry.getKey();
+            LinkedHashMap<String, Integer> typePkgMap = entry.getValue();
+            String typePkg = typePkgMap.keySet().iterator().next();
+            importLines.add("import " + typePkg + "." + typeName + SC);
+        }
+        return importLines;
+    }
 
 }
index cfcd6a4afc6d25f5a84cf216ae4e4f3b7cc3735d..5dd011be32afe6849716b6279d0facd12673101a 100644 (file)
@@ -49,7 +49,7 @@ public class ClassCodeGeneratorTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(7, genTypes.size());
+        assertEquals(8, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -100,7 +100,7 @@ public class ClassCodeGeneratorTest {
             }
         }
 
-        assertEquals(5, genTypesCount);
+        assertEquals(6, genTypesCount);
         assertEquals(2, genTOsCount);
     }
 
index 7ed1f9950383076e01dd7eda51e468ba2e7d1798..8bdf32706bef854692088ea601e2a3c2afe15e86 100644 (file)
@@ -138,4 +138,34 @@ module abstract-topology {
             }
         }
     }
-}
\ No newline at end of file
+    
+    identity crypto-base {
+        description "crypto-base description";
+    }
+    
+    identity crypto-alg {
+        base crypto-base;
+        description "crypto-alg description";
+    }
+    
+    grouping target {
+        container nodes {
+            leaf source {
+                type int8;
+            }
+            leaf target {
+                type int16;
+            }
+        }
+        leaf id {
+            type string;
+        }
+    }
+    
+    leaf idreftest {
+        type identityref {
+            base crypto-alg;
+        }
+    }
+    
+}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferIdentityObject.java b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferIdentityObject.java
new file mode 100644 (file)
index 0000000..80bed83
--- /dev/null
@@ -0,0 +1,6 @@
+package org.opendaylight.controller.sal.binding.model.api;
+
+public interface GeneratedTransferIdentityObject extends
+        GeneratedTransferObject {
+
+}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/WildcardType.java b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/WildcardType.java
new file mode 100644 (file)
index 0000000..ad08c2f
--- /dev/null
@@ -0,0 +1,5 @@
+package org.opendaylight.controller.sal.binding.model.api;
+
+public interface WildcardType extends Type  {
+
+}
index c01425407d0248e9b38039004cbddef179adb6cc..fc3495e184565f052f5b8a21a3f6577f1bac5e0f 100644 (file)
@@ -13,9 +13,9 @@ import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject
 
  */
 public interface GeneratedTOBuilder extends GeneratedTypeBuilder {
-    
+
     public boolean addExtendsType(final GeneratedTransferObject genTransObj);
-    
+
     public GeneratedPropertyBuilder addProperty(final String name);
 
     public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);
@@ -26,4 +26,7 @@ public interface GeneratedTOBuilder extends GeneratedTypeBuilder {
 
     @Override
     public GeneratedTransferObject toInstance();
+
+    public GeneratedTransferObject toIdentityInstance();
+
 }
index 8d846a13e60f3efa658eb56a08590c264edc5ed3..2e406da497131c66f059c6ae67caba46aa851505 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.5.1-SNAPSHOT</version>
+        <version>0.5.2-SNAPSHOT</version>
         <relativePath>../../yang/pom.xml</relativePath>
     </parent>
     <artifactId>yang-maven-plugin-it</artifactId>
index 8bd2289b116e37f0523f993028525e293113031c..3ac7ec6eee95f4f2a766a12f461c97a12a283f47 100644 (file)
@@ -10,7 +10,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>yang-maven-plugin-spi</artifactId>
-            <version>0.5.1-SNAPSHOT</version>
+            <version>0.5.2-SNAPSHOT</version>
         </dependency>
     </dependencies>
 
@@ -19,7 +19,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -56,7 +56,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index ce9389f64b9d197079aaa9f9aaf6f04d3c981c18..a397cf75123e1a974c9abbd45142397c689275cc 100644 (file)
@@ -10,7 +10,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>yang-maven-plugin-spi</artifactId>
-            <version>0.5.1-SNAPSHOT</version>
+            <version>0.5.2-SNAPSHOT</version>
         </dependency>
     </dependencies>
 
@@ -19,7 +19,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -43,7 +43,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index e1591b573399bf538b0849256f95ede52d5a236c..07b69878a9e7aa6cd70803d4808278c81a2dc1e9 100644 (file)
@@ -11,7 +11,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -35,7 +35,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index ed1fbf7c56ab895e5cc2e20435c282295ac5e86f..e094aed92a8bac3e66021989c8c289cf5539fb99 100644 (file)
@@ -11,7 +11,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>generator-test1</artifactId>
-            <version>0.5.1-SNAPSHOT</version>
+            <version>0.5.2-SNAPSHOT</version>
             <scope>system</scope>
             <systemPath>${project.basedir}/../GenerateTest1/target/generator-test1-0.5.1-SNAPSHOT.jar</systemPath>
         </dependency>
@@ -22,7 +22,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -49,7 +49,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index c64a857c1e408e26a4b627e6cbde080897920d04..dd98fea4cd3589a9e240dbceb92198a685fe5edc 100644 (file)
@@ -13,7 +13,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -40,7 +40,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index 1b73c76bb7ede04f97cb2336b8af1937257acf9a..aa0db753d7c58595c127e5db9cb2cbea045af7d3 100644 (file)
@@ -12,7 +12,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -49,7 +49,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index 9a43e893b5fb049e4eb25192d5732581418cadc6..8333b02ffc6d970508910dfa7cc8bef955bc5129 100644 (file)
@@ -11,7 +11,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -39,7 +39,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index 54bace053c57808918bb5ed9e9c29612ca9b0829..eea103cf4eb4e675a9053eac0735fdec5298dc22 100644 (file)
@@ -12,7 +12,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -36,7 +36,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index b2eeb6f66ad73e5eac7454aa37c201fd9044eca3..54056d5ca47459c96ee72b2fa0a5e482009c8600 100644 (file)
@@ -12,7 +12,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -39,7 +39,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index 96a75b969caa606bd4e41c5a8c85c22fc3d327ee..65ea6aa68e947e4c749aaf369d2af5ac20e895b1 100644 (file)
@@ -12,7 +12,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
@@ -47,7 +47,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-maven-plugin-spi</artifactId>
-                        <version>0.5.1-SNAPSHOT</version>
+                        <version>0.5.2-SNAPSHOT</version>
                         <type>test-jar</type>
                     </dependency>
                 </dependencies>
index 09df6ab23ddc4834a15d26208a5d4ba24857319d..08c0e7b3ca67e055007f13ce75915a7f6692f401 100644 (file)
@@ -12,7 +12,7 @@
             <plugin>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>0.5.1-SNAPSHOT</version>
+                <version>0.5.2-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
index 5afd588541382de8584324e028cd9f1a6d222ebb..297b8b49dee4014a7b96fd76ab8f38a3d4cca278 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.5.1-SNAPSHOT</version>
+        <version>0.5.2-SNAPSHOT</version>
         <relativePath>../../yang/pom.xml</relativePath>
     </parent>
 
index ae24c1848e5de587089796141056178da0d8b5af..bb6de3f3c70936bf91904aa4958e30ca7a7cda8b 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.5.1-SNAPSHOT</version>
+        <version>0.5.2-SNAPSHOT</version>
         <relativePath>../../yang/pom.xml</relativePath>
     </parent>
     <artifactId>yang-maven-plugin-spi</artifactId>
index 9edca3cd228b5cfd8caeead7dcd2b01a8d1376dd..eb30ea3b3b7b4c5b60966561e4bce6a429554471 100644 (file)
@@ -17,7 +17,7 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <!-- version of YANG tools dependencies -->
-        <yang.version>0.5.1-SNAPSHOT</yang.version>
+        <yang.version>0.5.2-SNAPSHOT</yang.version>
     </properties>
 
     <modules>
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/pom.xml b/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/pom.xml
new file mode 100644 (file)
index 0000000..260303e
--- /dev/null
@@ -0,0 +1,116 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <artifactId>binding-generator</artifactId>
+               <groupId>org.opendaylight.controller</groupId>
+               <version>0.5.1-SNAPSHOT</version>
+       </parent>
+       <artifactId>modeling-sample</artifactId>
+
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.opendaylight.controller</groupId>
+                               <artifactId>yang-maven-plugin</artifactId>
+                               <version>0.5.1-SNAPSHOT</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>generate-sources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <yangFilesRootDir>src/main/yang</yangFilesRootDir>
+                                                       <codeGenerators>
+                                                               <generator>
+                                                                       <codeGeneratorClass>
+                                                                               org.opendaylight.controller.maven.sal.api.gen.plugin.CodeGeneratorImpl
+                                                                       </codeGeneratorClass>
+                                                                       <outputBaseDir>
+                                                                               target/generated-sources/sal
+                                                                       </outputBaseDir>
+                                                               </generator>
+                                                       </codeGenerators>
+                                                       <inspectDependencies>false</inspectDependencies>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+
+                               <dependencies>
+                                       <dependency>
+                                               <groupId>org.opendaylight.controller</groupId>
+                                               <artifactId>maven-sal-api-gen-plugin</artifactId>
+                                               <version>0.5.1-SNAPSHOT</version>
+                                               <type>jar</type>
+                                       </dependency>
+                               </dependencies>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>build-helper-maven-plugin</artifactId>
+                               <version>1.7</version>
+                               <executions>
+                                       <execution>
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>add-source</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <sources>
+                                                               <source>target/generated-sources/sal</source>
+                                                       </sources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+               <pluginManagement>
+                       <plugins>
+                               <!--This plugin's configuration is used to store Eclipse m2e settings 
+                                       only. It has no influence on the Maven build itself. -->
+                               <plugin>
+                                       <groupId>org.eclipse.m2e</groupId>
+                                       <artifactId>lifecycle-mapping</artifactId>
+                                       <version>1.0.0</version>
+                                       <configuration>
+                                               <lifecycleMappingMetadata>
+                                                       <pluginExecutions>
+                                                               <pluginExecution>
+                                                                       <pluginExecutionFilter>
+                                                                               <groupId>
+                                                                                       org.opendaylight.controller
+                                                                               </groupId>
+                                                                               <artifactId>
+                                                                                       yang-maven-plugin
+                                                                               </artifactId>
+                                                                               <versionRange>
+                                                                                       [0.5,)
+                                                                               </versionRange>
+                                                                               <goals>
+                                                                                       <goal>
+                                                                                               generate-sources
+                                                                                       </goal>
+                                                                               </goals>
+                                                                       </pluginExecutionFilter>
+                                                                       <action>
+                                                                               <ignore></ignore>
+                                                                       </action>
+                                                               </pluginExecution>
+                                                       </pluginExecutions>
+                                               </lifecycleMappingMetadata>
+                                       </configuration>
+                               </plugin>
+                       </plugins>
+               </pluginManagement>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>yang-binding</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>yang-common</artifactId>
+               </dependency>
+       </dependencies>
+</project>
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang b/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang
new file mode 100644 (file)
index 0000000..3ecdc0a
--- /dev/null
@@ -0,0 +1,62 @@
+module sample {
+    yang-version 1;
+    namespace "sample";
+    prefix "s";
+
+    revision 2013-06-13 {
+       description "Initial demo";
+    }
+    
+
+
+    // Simple Type definition
+    
+    typedef foo-name {
+        type string;
+    }
+    
+    // Storage / data structure
+    
+    container topologies {
+        list topology {
+            leaf foo-name {
+                type string;
+            }
+        }
+    }
+    
+    
+    // Notification / Event
+    
+    notification packet-in {
+        leaf node {
+            type string;
+        }
+        leaf port {
+            type uint16;
+        }
+        leaf content {
+            type binary;
+        }
+    }
+    
+    // RPC
+    
+    rpc packet-out {
+        input {
+            leaf node {
+                type string;
+            }
+            leaf port {
+                type uint16;
+            }
+            leaf content {
+                type binary;
+            }
+        }
+        output {
+            
+        }
+    }    
+
+}
\ No newline at end of file
index 547d83adc8ed617db4d421e3835f1911b5bc5b39..53ca93140676641d935bb4ab8081e66b88ddbc30 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>yang</artifactId>
-    <version>0.5.1-SNAPSHOT</version>
+    <version>0.5.2-SNAPSHOT</version>
     <relativePath>../../yang/pom.xml</relativePath>
   </parent>
   <artifactId>yang-model-parser-api</artifactId>
index 16a746905e0fc2d5f192b05ee404aad18aa5ee44..b83d63f9b08f576c977a082164a6558c3cfd507c 100644 (file)
@@ -4,7 +4,7 @@
        <parent>\r
                <groupId>org.opendaylight.controller</groupId>\r
                <artifactId>yang</artifactId>\r
-               <version>0.5.1-SNAPSHOT</version>\r
+               <version>0.5.2-SNAPSHOT</version>\r
                <relativePath>../../yang/pom.xml</relativePath>\r
        </parent>\r
        <artifactId>yang-model-parser-impl</artifactId>\r
index 1c4a4acde47907545a63001102c251357be8cd03..c295c0eafdc824f68b04249f463cbc4630a42c10 100644 (file)
@@ -19,9 +19,13 @@ import org.opendaylight.controller.yang.parser.util.RefineHolder;
  */
 public interface UsesNodeBuilder extends Builder {
 
-    String getGroupingPathString();
+    String getGroupingName();
 
-    SchemaPath getGroupingPath();
+    void setGroupingPath(SchemaPath groupingPath);
+
+    SchemaPath getPath();
+
+    void setPath(SchemaPath path);
 
     Set<AugmentationSchemaBuilder> getAugmentations();
 
index e5ba8b17ccfe1f872070e491cf9c6396d8623557..775751a166ef7d2c58a9565d3cd9bb1bef5692c4 100644 (file)
@@ -68,6 +68,11 @@ public final class AugmentationSchemaBuilderImpl implements AugmentationSchemaBu
         return childNodes;
     }
 
+    @Override
+    public Set<GroupingBuilder> getGroupings() {
+        return groupings;
+    }
+
     @Override
     public void addGrouping(GroupingBuilder grouping) {
         groupings.add(grouping);
index ba9609b4db7f03eea305ae6b64bda80bc66b5fba..ec9c35c1bd37c14f97cc93994174bfb10c7f384d 100644 (file)
@@ -290,6 +290,7 @@ public final class LeafSchemaNodeBuilder extends AbstractTypeAwareBuilder
             }
         }
 
+        @Override
         public String getDefault() {
             return defaultStr;
         }
@@ -298,6 +299,7 @@ public final class LeafSchemaNodeBuilder extends AbstractTypeAwareBuilder
             this.defaultStr = defaultStr;
         }
 
+        @Override
         public String getUnits() {
             return unitsStr;
         }
index 67e4c6fb72cef7e1e1dd5d566a72992fb31dea6e..fa307972d49c7be12e57a12f7d9a9901881075b5 100644 (file)
@@ -240,6 +240,17 @@ public class ModuleBuilder implements Builder {
         return typedefs;
     }
 
+    public Set<GroupingBuilder> getModuleGroupings() {
+        final Set<GroupingBuilder> groupings = new HashSet<GroupingBuilder>();
+        for (Map.Entry<List<String>, GroupingBuilder> entry : addedGroupings
+                .entrySet()) {
+            if (entry.getKey().size() == 2) {
+                groupings.add(entry.getValue());
+            }
+        }
+        return groupings;
+    }
+
     public String getName() {
         return name;
     }
index 5b9638eb63dc715a7b58a6b810fe6095810fa938..6cbcec1054a1b58256fe4cec1e6731cce7ef0d41 100644 (file)
@@ -103,6 +103,10 @@ public final class RpcDefinitionBuilder implements SchemaNodeBuilder,
         addedTypedefs.add(type);
     }
 
+    public Set<GroupingBuilder> getGroupings() {
+        return addedGroupings;
+    }
+
     public void addGrouping(GroupingBuilder grouping) {
         addedGroupings.add(grouping);
     }
index dba747db1dd9bad3aa31a3d265279119d8434b85..850938161bf4c25cc30fd5d7e7270d0056d9f596 100644 (file)
@@ -15,7 +15,6 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
-import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.model.api.AugmentationSchema;\r
 import org.opendaylight.controller.yang.model.api.SchemaNode;\r
 import org.opendaylight.controller.yang.model.api.SchemaPath;\r
@@ -27,25 +26,25 @@ import org.opendaylight.controller.yang.parser.util.RefineHolder;
 \r
 public final class UsesNodeBuilderImpl implements UsesNodeBuilder {\r
     private boolean isBuilt;\r
-    private final UsesNodeImpl instance;\r
+    private UsesNodeImpl instance;\r
     private final int line;\r
-    private final String groupingPathStr;\r
-    private final SchemaPath groupingPath;\r
+    private SchemaPath schemaPath;\r
+    private final String groupingName;\r
+    private SchemaPath groupingPath;\r
     private boolean augmenting;\r
     private final Set<AugmentationSchemaBuilder> addedAugments = new HashSet<AugmentationSchemaBuilder>();\r
     private List<SchemaNodeBuilder> refineBuilders = new ArrayList<SchemaNodeBuilder>();\r
     private List<RefineHolder> refines = new ArrayList<RefineHolder>();\r
 \r
-    public UsesNodeBuilderImpl(final String groupingPathStr, final int line) {\r
-        this.groupingPathStr = groupingPathStr;\r
-        this.groupingPath = parseUsesPath(groupingPathStr);\r
+    public UsesNodeBuilderImpl(final String groupingName, final int line) {\r
+        this.groupingName = groupingName;\r
         this.line = line;\r
-        instance = new UsesNodeImpl(groupingPath);\r
     }\r
 \r
     @Override\r
     public UsesNode build() {\r
         if (!isBuilt) {\r
+            instance = new UsesNodeImpl(groupingPath);\r
             instance.setAugmenting(augmenting);\r
 \r
             // AUGMENTATIONS\r
@@ -74,13 +73,23 @@ public final class UsesNodeBuilderImpl implements UsesNodeBuilder {
     }\r
 \r
     @Override\r
-    public String getGroupingPathString() {\r
-        return groupingPathStr;\r
+    public void setGroupingPath(SchemaPath groupingPath) {\r
+        this.groupingPath = groupingPath;\r
     }\r
 \r
     @Override\r
-    public SchemaPath getGroupingPath() {\r
-        return groupingPath;\r
+    public SchemaPath getPath() {\r
+        return schemaPath;\r
+    }\r
+\r
+    @Override\r
+    public void setPath(SchemaPath path) {\r
+        this.schemaPath = path;\r
+    }\r
+\r
+    @Override\r
+    public String getGroupingName() {\r
+        return groupingName;\r
     }\r
 \r
     @Override\r
@@ -123,23 +132,6 @@ public final class UsesNodeBuilderImpl implements UsesNodeBuilder {
         refines.add(refine);\r
     }\r
 \r
-    private SchemaPath parseUsesPath(final String groupingPathStr) {\r
-        final String[] splittedPath = groupingPathStr.split("/");\r
-        final List<QName> path = new ArrayList<QName>();\r
-        QName name;\r
-        for (String pathElement : splittedPath) {\r
-            final String[] splittedElement = pathElement.split(":");\r
-            if (splittedElement.length == 1) {\r
-                name = new QName(null, null, null, splittedElement[0]);\r
-            } else {\r
-                name = new QName(null, null, splittedElement[0],\r
-                        splittedElement[1]);\r
-            }\r
-            path.add(name);\r
-        }\r
-        final boolean absolute = groupingPathStr.startsWith("/");\r
-        return new SchemaPath(path, absolute);\r
-    }\r
 \r
     private final class UsesNodeImpl implements UsesNode {\r
         private final SchemaPath groupingPath;\r
index 4520405bbebc615e71ef6749016d11c31e417a95..94437170f4be3c8ef91ae774debd26cb1d4f8963 100644 (file)
@@ -761,15 +761,15 @@ public final class YangParserImpl implements YangModelParser {
                 .getUsesNodes();
         for (Map.Entry<List<String>, UsesNodeBuilder> entry : moduleUses
                 .entrySet()) {
-            final List<String> key = entry.getKey();
             final UsesNodeBuilder usesNode = entry.getValue();
             final int line = usesNode.getLine();
 
-            final String groupingName = key.get(key.size() - 1);
+            GroupingBuilder targetGrouping = getTargetGrouping(usesNode, modules, module);
+            usesNode.setGroupingPath(targetGrouping.getPath());
 
             for (RefineHolder refine : usesNode.getRefines()) {
                 SchemaNodeBuilder refineTarget = getRefineNodeBuilderCopy(
-                        groupingName, refine, modules, module);
+                        targetGrouping, refine, modules, module);
                 ParserUtils.checkRefine(refineTarget, refine);
                 ParserUtils.refineDefault(refineTarget, refine, line);
                 if (refineTarget instanceof LeafSchemaNodeBuilder) {
@@ -805,6 +805,82 @@ public final class YangParserImpl implements YangModelParser {
         }
     }
 
+    private GroupingBuilder getTargetGrouping(
+            final UsesNodeBuilder usesBuilder,
+            final Map<String, TreeMap<Date, ModuleBuilder>> modules,
+            final ModuleBuilder module) {
+        final int line = usesBuilder.getLine();
+        String groupingString = usesBuilder.getGroupingName();
+        String groupingPrefix;
+        String groupingName;
+
+        if(groupingString.contains(":")) {
+            String[] splitted = groupingString.split(":");
+            if(splitted.length != 2 || groupingString.contains("/")) {
+                throw new YangParseException(module.getName(), line, "Invalid name of target grouping");
+            }
+            groupingPrefix = splitted[0];
+            groupingName = splitted[1];
+        } else {
+            groupingPrefix = module.getPrefix();
+            groupingName = groupingString;
+        }
+
+        ModuleBuilder dependentModule = null;
+        if(groupingPrefix.equals(module.getPrefix())) {
+            dependentModule = module;
+        } else {
+            dependentModule = findDependentModule(modules, module, groupingPrefix, line);
+        }
+
+
+        List<QName> path = usesBuilder.getPath().getPath();
+        GroupingBuilder result = null;
+        Set<GroupingBuilder> groupings = dependentModule.getModuleGroupings();
+        result = findGrouping(groupings, groupingName);
+
+        if (result == null) {
+            Builder currentNode = null;
+            final List<String> currentPath = new ArrayList<String>();
+            currentPath.add(dependentModule.getName());
+
+            for (int i = 0; i < path.size(); i++) {
+                QName qname = path.get(i);
+                currentPath.add(qname.getLocalName());
+                currentNode = dependentModule.getModuleNode(currentPath);
+
+                if (currentNode instanceof RpcDefinitionBuilder) {
+                    groupings = ((RpcDefinitionBuilder) currentNode).getGroupings();
+                } else if (currentNode instanceof DataNodeContainerBuilder) {
+                    groupings = ((DataNodeContainerBuilder) currentNode).getGroupings();
+                } else {
+                    groupings = Collections.emptySet();
+                }
+
+                result = findGrouping(groupings, groupingName);
+                if (result != null) {
+                    break;
+                }
+            }
+        }
+
+        if (result != null) {
+            return result;
+        }
+        throw new YangParseException(module.getName(), line,
+                "Referenced grouping '" + groupingName + "' not found.");
+    }
+
+    private GroupingBuilder findGrouping(Set<GroupingBuilder> groupings,
+            String name) {
+        for (GroupingBuilder grouping : groupings) {
+            if (grouping.getQName().getLocalName().equals(name)) {
+                return grouping;
+            }
+        }
+        return null;
+    }
+
     /**
      * Find original builder of node to refine and return copy of this builder.
      * <p>
@@ -825,11 +901,11 @@ public final class YangParserImpl implements YangModelParser {
      *         otherwise
      */
     private SchemaNodeBuilder getRefineNodeBuilderCopy(
-            final String groupingPath, final RefineHolder refine,
+            final GroupingBuilder targetGrouping, final RefineHolder refine,
             final Map<String, TreeMap<Date, ModuleBuilder>> modules,
             final ModuleBuilder module) {
         Builder result = null;
-        final Builder lookedUpBuilder = findRefineTargetBuilder(groupingPath,
+        final Builder lookedUpBuilder = findRefineTargetBuilder(targetGrouping,
                 refine, modules, module);
         if (lookedUpBuilder instanceof LeafSchemaNodeBuilder) {
             result = ParserUtils
@@ -876,28 +952,11 @@ public final class YangParserImpl implements YangModelParser {
      * @return Builder object of refine node if it is present in grouping, null
      *         otherwise
      */
-    private Builder findRefineTargetBuilder(final String groupingPath,
+    private Builder findRefineTargetBuilder(final GroupingBuilder builder,
             final RefineHolder refine,
             final Map<String, TreeMap<Date, ModuleBuilder>> modules,
             final ModuleBuilder module) {
         final String refineNodeName = refine.getName();
-        final SchemaPath path = ParserUtils.parseUsesPath(groupingPath);
-        final List<String> builderPath = new ArrayList<String>();
-        String prefix = null;
-        for (QName qname : path.getPath()) {
-            builderPath.add(qname.getLocalName());
-            prefix = qname.getPrefix();
-        }
-        if (prefix == null) {
-            prefix = module.getPrefix();
-        }
-
-        final ModuleBuilder dependentModule = findDependentModule(modules,
-                module, prefix, refine.getLine());
-        builderPath.add(0, dependentModule.getName());
-        final GroupingBuilder builder = dependentModule
-                .getGrouping(builderPath);
-
         Builder result = builder.getChildNode(refineNodeName);
         if (result == null) {
             Set<GroupingBuilder> grps = builder.getGroupings();
index 40a3289745f10a4010df3cd1797bb081f034c714..1c01cd4a82b56cdbc016ed0e3f0c23eec5b833d8 100644 (file)
@@ -410,15 +410,15 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
         GroupingBuilder builder = moduleBuilder.addGrouping(groupQName,
                 actualPath, ctx.getStart().getLine());
         moduleBuilder.enterNode(builder);
-        updatePath("grouping");
         updatePath(groupName);
+        builder.setPath(createActualSchemaPath(actualPath, namespace, revision,
+                yangModelPrefix));
         parseSchemaNodeArgs(ctx, builder);
     }
 
     @Override
     public void exitGrouping_stmt(YangParser.Grouping_stmtContext ctx) {
         String actContainer = actualPath.pop();
-        actContainer += "-" + actualPath.pop();
         logger.debug("exiting " + actContainer);
         moduleBuilder.exitNode();
     }
@@ -495,8 +495,11 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
         final String groupingPathStr = stringFromNode(ctx);
         UsesNodeBuilder builder = moduleBuilder.addUsesNode(groupingPathStr,
                 actualPath, ctx.getStart().getLine());
+
         moduleBuilder.enterNode(builder);
         updatePath(groupingPathStr);
+        builder.setPath(createActualSchemaPath(actualPath, namespace, revision,
+                yangModelPrefix));
     }
 
     @Override
index 8361d4715631ff4e2afad6d7f588ba17c1b86027..d38bc5e7adf22f74f6678e9614d38e2872a8099d 100644 (file)
@@ -907,7 +907,7 @@ public final class ParserUtils {
 
     public static UsesNodeBuilder copyUsesNodeBuilder(UsesNodeBuilder old) {
         final UsesNodeBuilder copy = new UsesNodeBuilderImpl(
-                old.getGroupingPathString(), old.getLine());
+                old.getGroupingName(), old.getLine());
         for (AugmentationSchemaBuilder augment : old.getAugmentations()) {
             copy.addAugment(augment);
         }
index e79e70028b6cdacdbd8ffc0130ad6a9669ab137c..4e15f8d47c632c43e11742a6d7a943162a4eac71 100644 (file)
@@ -6,7 +6,7 @@
                <artifactId>yang-prototype</artifactId>
                <version>0.5-SNAPSHOT</version>
        </parent>
-       <version>0.5.1-SNAPSHOT</version>
+       <version>0.5.2-SNAPSHOT</version>
        <artifactId>yang</artifactId>
        <packaging>pom</packaging>
 
index f7df24f53f9a69ecf3e709de1bdf608fe4eddf99..6362eb9accfab637b27f998f4c37674fab548399 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-binding</artifactId>\r
 </project>
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/yang/yang-binding/src/main/java/org/opendaylight/controller/yang/binding/BaseIdentity.java b/opendaylight/sal/yang-prototype/yang/yang-binding/src/main/java/org/opendaylight/controller/yang/binding/BaseIdentity.java
new file mode 100644 (file)
index 0000000..004287a
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * 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.binding;
+
+public abstract class BaseIdentity {
+    
+    protected BaseIdentity() {
+    }
+
+}
index 987b9b11a18a11ffb901a2adff7e8e764e8ebc3a..7f5538692567b6d2ef44383fd78567f4bed3d742 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-common</artifactId>\r
   <dependencies>\r
index 749c9c66f439eabddf25c5da6ad3798c02003132..02562172e89099ae8fbf8f80851f2f02708da2ae 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-data-api</artifactId>\r
   \r
index 15b391f5b896146565a785fa8e459435dfb43be4..bce9e9134698189cec00228ac5a4cae4e05a7dc6 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-data-util</artifactId>\r
   <dependencies>\r
index 3eabd7ff9f4aec09ddb4964f7b8fce95187347e3..fc601e32b442e5b9ae043815d513a22cad81078a 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-model-api</artifactId>\r
   <dependencies>\r
index 3390837be919feae17cd0484802402b7fda0f0e9..d95b23957b15a7f2e4d181aff7144545aba5d0d6 100644 (file)
@@ -3,7 +3,7 @@
   <parent>\r
     <groupId>org.opendaylight.controller</groupId>\r
     <artifactId>yang</artifactId>\r
-    <version>0.5.1-SNAPSHOT</version>\r
+    <version>0.5.2-SNAPSHOT</version>\r
   </parent>\r
   <artifactId>yang-model-util</artifactId>\r
   <dependencies>\r
index df111acf0854603d453f1c1bd6cefb40a449d48c..7c26531f37efbddd520b31623539d011511719f7 100644 (file)
@@ -8,29 +8,30 @@ import java.util.Set;
 import org.opendaylight.controller.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.controller.yang.model.api.DataNodeContainer;
 import org.opendaylight.controller.yang.model.api.DataSchemaNode;
+import org.opendaylight.controller.yang.model.api.GroupingDefinition;
 import org.opendaylight.controller.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.controller.yang.model.api.LeafSchemaNode;
 import org.opendaylight.controller.yang.model.api.ListSchemaNode;
 
 public class DataNodeIterator implements Iterator<DataSchemaNode> {
-    
+
     private final DataNodeContainer container;
     private List<ListSchemaNode> allLists;
     private List<ContainerSchemaNode> allContainers;
     private List<LeafSchemaNode> allLeafs;
     private List<LeafListSchemaNode> allLeafLists;
     private List<DataSchemaNode> allChilds;
-    
+
     public DataNodeIterator(final DataNodeContainer container) {
         if (container == null) {
             throw new IllegalArgumentException("Data Node Container MUST be specified and cannot be NULL!");
         }
-        
+
         init();
         this.container = container;
         traverse(this.container);
     }
-    
+
     private void init() {
         this.allContainers = new ArrayList<ContainerSchemaNode>();
         this.allLists = new ArrayList<ListSchemaNode>();
@@ -38,28 +39,28 @@ public class DataNodeIterator implements Iterator<DataSchemaNode> {
         this.allLeafLists = new ArrayList<LeafListSchemaNode>();
         this.allChilds = new ArrayList<DataSchemaNode>();
     }
-    
+
     public List<ContainerSchemaNode> allContainers() {
         return allContainers;
     }
-    
+
     public List<ListSchemaNode> allLists() {
         return allLists;
     }
-    
+
     public List<LeafSchemaNode> allLeafs() {
         return allLeafs;
     }
-    
+
     public List<LeafListSchemaNode> allLeafLists() {
         return allLeafLists;
     }
-    
+
     private void traverse(final DataNodeContainer dataNode) {
         if (dataNode == null) {
             return;
         }
-        
+
         final Set<DataSchemaNode> childs = dataNode.getChildNodes();
         if (childs != null) {
             for (DataSchemaNode childNode : childs) {
@@ -83,15 +84,21 @@ public class DataNodeIterator implements Iterator<DataSchemaNode> {
                     allLeafLists.add(leafList);
                 }
             }
-            return;
+        }
+
+        final Set<GroupingDefinition> groupings = dataNode.getGroupings();
+        if(groupings != null) {
+            for(GroupingDefinition grouping : groupings) {
+                traverse(grouping);
+            }
         }
     }
-    
+
     @Override
     public boolean hasNext() {
         if (container.getChildNodes() != null) {
             Set<DataSchemaNode> childs = container.getChildNodes();
-            
+
             if ((childs != null) && !childs.isEmpty()) {
                 return childs.iterator().hasNext();
             }
index e666af7e512a72ae1c11005274436df16316a8d0..13ec7ca5ecdadfd1dfd95029b6d656119f1c12f3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/one/nb/v2/lb"/>
   </services>
index 365e4b22d6493a194ce273adc12b846ff1445606..aac4647de669a930dbd0ffa39d30130434946054 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
   <servlet>
     <servlet-name>JAXRSLoadBalancer</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
index 7ee475ed2b01be2b8efb4c1eb0704c2816359f83..1bf1c7ca74785b890c2263d712bfa6232edf04a1 100644 (file)
@@ -29,7 +29,7 @@
               org.apache.felix.dm
             </Import-Package>
             <Export-Package>
-              org.opendaylight.controller.statisticsmanager 
+              org.opendaylight.controller.statisticsmanager
             </Export-Package>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
index eae01a6487cd5351783eb0e24292a3e947a9da7d..a665096e8b529ee54e7b851c566a04aaddb51b7b 100644 (file)
@@ -16,9 +16,9 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
+import org.opendaylight.controller.sal.utils.HexEncode;
 
 /**
  * The class describes switch related information including L2 address, ports,
@@ -164,6 +164,8 @@ public class Switch implements Serializable {
 
     @Override
     public String toString() {
-        return "Switch[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "Switch [dataLayerAddress=" + HexEncode.bytesToHexStringFormat(dataLayerAddress)
+                + ", nodeConnectors=" + nodeConnectors + ", spanPorts="
+                + spanPorts + ", node=" + node + "]";
     }
 }
index 44ad73c4968679a95cd38c1e72dc12f621c4bf46..e774dae115d4617bc3c7548fe4a8b9f7388aa628 100644 (file)
@@ -21,7 +21,7 @@
       <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager.implementation</artifactId>
-         <version>0.4.0-SNAPSHOT</version>
+      <version>0.4.0-SNAPSHOT</version>
     </dependency>
      <dependency>
       <groupId>org.opendaylight.controller</groupId>
index 850563fe95b07774b13b2e645bb7de52bec8daee..65487a614a85af96fabbac4e7df289d2f28c20e8 100644 (file)
@@ -73,16 +73,16 @@ public class TopologyManagerImplTest {
             NodeConnector tailnc1 = NodeConnectorCreator
                     .createOFNodeConnector((short) (i + 10),
                             NodeCreator.createOFNode((long) (i + 10)));
-            Edge e1 = new Edge(headnc1, tailnc1);
+            Edge e1 = new Edge(tailnc1, headnc1);
             TopoEdgeUpdate teu1 = new TopoEdgeUpdate(e1, props,
                     UpdateType.ADDED);
             topoedgeupdateList.add(teu1);
 
-            NodeConnector headnc2 = NodeConnectorCreator.createOFNodeConnector(
-                    (short) (i + 1), headnc1.getNode());
             NodeConnector tailnc2 = NodeConnectorCreator.createOFNodeConnector(
+                    (short) (i + 1), headnc1.getNode());
+            NodeConnector headnc2 = NodeConnectorCreator.createOFNodeConnector(
                     (short) (i + 11), tailnc1.getNode());
-            Edge e2 = new Edge(headnc2, tailnc2);
+            Edge e2 = new Edge(tailnc2, headnc2);
             TopoEdgeUpdate teu2 = new TopoEdgeUpdate(e2, props,
                     UpdateType.ADDED);
             topoedgeupdateList.add(teu2);
@@ -111,25 +111,12 @@ public class TopologyManagerImplTest {
                         .longValue();
                 Long tailNcId = ((Short) edge.getTailNodeConnector().getID())
                         .longValue();
-                if (nodeId == 1 || nodeId == 3 || nodeId == 5) {
-                    Assert.assertTrue((headNcId.equals(nodeId) && tailNcId
-                            .equals(nodeId + 10))
-                            || (headNcId.equals(nodeId + 10) && tailNcId
-                                    .equals(nodeId))
-                                    || (headNcId.equals(nodeId + 1) && tailNcId
-                                            .equals(nodeId + 11))
-                                            || (headNcId.equals(nodeId + 11) && tailNcId
-                                                    .equals(nodeId + 1)));
-                } else if (nodeId == 11 || nodeId == 13 || nodeId == 15) {
-                    Assert.assertTrue((headNcId.equals(nodeId) && tailNcId
-                            .equals(nodeId - 10))
-                            || (headNcId.equals(nodeId) && tailNcId
-                                    .equals(nodeId - 10))
-                                    || (headNcId.equals(nodeId - 9) && tailNcId
-                                            .equals(nodeId + 1))
-                                            || (headNcId.equals(nodeId + 1) && tailNcId
-                                                    .equals(nodeId - 9)));
-                }
+                Assert.assertTrue(
+                        (headNcId.equals(nodeId) && tailNcId.equals(nodeId + 10))
+                        || (headNcId.equals(nodeId + 11) && tailNcId.equals(nodeId + 1))
+                        || (headNcId.equals(nodeId + 1) && tailNcId.equals(nodeId - 9))
+                        || (headNcId.equals(nodeId - 10) && tailNcId.equals(nodeId))
+                        );
             }
             i.remove();
         }
similarity index 95%
rename from opendaylight/usermanager/pom.xml
rename to opendaylight/usermanager/api/pom.xml
index 1859e8ed4c5d6b0fe2bfdc3b26bc2be6a8ec655f..877461daaaeed0ae970f554cb2c36f07c877c707 100644 (file)
@@ -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>
 
   <artifactId>usermanager</artifactId>
             </Import-Package>
             <Export-Package>
               org.opendaylight.controller.usermanager,
+<!--
               org.opendaylight.controller.usermanager.internal
-            </Export-Package>
+ -->
+             </Export-Package>
             <Bundle-Activator>
+<!--
               org.opendaylight.controller.usermanager.internal.Activator
-            </Bundle-Activator>
+ -->
+             </Bundle-Activator>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
         </configuration>
similarity index 89%
rename from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/AuthorizationConfig.java
rename to opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/AuthorizationConfig.java
index 038ccca2fcf6f998273056e2717719900f7c7731..bad8fa511f76b382d79d1a0b00b0c8fd8756f466 100644 (file)
@@ -6,9 +6,10 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.controller.usermanager.internal;
+package org.opendaylight.controller.usermanager;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.opendaylight.controller.sal.utils.Status;
@@ -44,4 +45,9 @@ public class AuthorizationConfig extends UserConfig {
     public String toString() {
         return "AuthorizationConfig=[user: " + user + ", roles: " + roles + "]";
     }
+
+    public String getRolesString() {
+        return super.getRolesString();
+    }
+
 }
similarity index 97%
rename from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java
rename to opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java
index 85a97f0b852e99fa728ab4366e69e8dda775dd93..cd86ed73fe6935cc2c437d4b3be1b03fb35d1689 100644 (file)
@@ -15,9 +15,9 @@ import java.util.Set;
 import org.opendaylight.controller.sal.authorization.AuthResultEnum;
 import org.opendaylight.controller.sal.authorization.UserLevel;
 import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.usermanager.internal.AuthorizationConfig;
-import org.opendaylight.controller.usermanager.internal.ServerConfig;
-import org.opendaylight.controller.usermanager.internal.UserConfig;
+import org.opendaylight.controller.usermanager.AuthorizationConfig;
+import org.opendaylight.controller.usermanager.ServerConfig;
+import org.opendaylight.controller.usermanager.UserConfig;
 import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.web.context.SecurityContextRepository;
 
similarity index 99%
rename from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserConfig.java
rename to opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java
index c7ddd4a6ecfd2918508924fe0fc78be2339268eb..0e6a48ab52b32bdc66eb114ad26021ef07aa56ad 100644 (file)
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.controller.usermanager.internal;
+package org.opendaylight.controller.usermanager;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -5,7 +5,7 @@
  * 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.usermanager.internal;
+package org.opendaylight.controller.usermanager;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -18,6 +18,8 @@ import org.junit.Test;
 import org.opendaylight.controller.sal.authorization.AuthResultEnum;
 import org.opendaylight.controller.sal.authorization.UserLevel;
 import org.opendaylight.controller.usermanager.AuthResponse;
+import org.opendaylight.controller.usermanager.AuthorizationConfig;
+import org.opendaylight.controller.usermanager.UserConfig;
 
 /*
  * This test case includes tests for UserConfig and the extending class AuthorizationConfig
diff --git a/opendaylight/usermanager/implementation/pom.xml b/opendaylight/usermanager/implementation/pom.xml
new file mode 100644 (file)
index 0000000..a558fa2
--- /dev/null
@@ -0,0 +1,97 @@
+<?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>
+
+  <artifactId>usermanager.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>
+            <Import-Package>
+              org.opendaylight.controller.clustering.services,
+              org.opendaylight.controller.configuration,
+              org.opendaylight.controller.sal.authorization,
+              org.opendaylight.controller.sal.core,
+              org.opendaylight.controller.sal.packet,
+              org.opendaylight.controller.sal.utils,
+              org.opendaylight.controller.switchmanager,
+              org.opendaylight.controller.containermanager,
+              org.slf4j,
+              org.eclipse.osgi.framework.console,
+              org.osgi.framework,
+              org.apache.felix.dm,
+              org.apache.commons.lang3.builder,
+              org.apache.commons.logging,
+              javax.servlet,
+              javax.servlet.http,
+              org.springframework.security.web.context,
+              org.springframework.security.core,
+              org.springframework.security.core.context,
+              org.apache.commons.lang3,
+              org.springframework.security.authentication,
+              org.springframework.security.core.authority,
+              org.springframework.security.core.userdetails,
+              org.opendaylight.controller.usermanager
+            </Import-Package>
+            <Export-Package>
+<!--
+              org.opendaylight.controller.usermanager,
+              org.opendaylight.controller.usermanager.internal
+ -->
+             </Export-Package>
+            <Bundle-Activator>
+              org.opendaylight.controller.usermanager.internal.Activator
+            </Bundle-Activator>
+          </instructions>
+          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>usermanager</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>containermanager</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>configuration</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
@@ -43,11 +43,16 @@ import org.opendaylight.controller.sal.utils.ObjectReader;
 import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.usermanager.AuthResponse;
+import org.opendaylight.controller.usermanager.AuthorizationConfig;
 import org.opendaylight.controller.usermanager.IAAAProvider;
 import org.opendaylight.controller.usermanager.ISessionManager;
 import org.opendaylight.controller.usermanager.IUserManager;
+import org.opendaylight.controller.usermanager.ServerConfig;
+import org.opendaylight.controller.usermanager.UserConfig;
 import org.opendaylight.controller.usermanager.security.SessionManager;
 import org.opendaylight.controller.usermanager.security.UserSecurityContextRepository;
+import org.opendaylight.controller.usermanager.internal.AuthenticatedUser;
+
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.slf4j.Logger;
@@ -25,6 +25,9 @@ import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.usermanager.AuthResponse;
 import org.opendaylight.controller.usermanager.IAAAProvider;
 import org.opendaylight.controller.usermanager.IUserManager;
+import org.opendaylight.controller.usermanager.ServerConfig;
+import org.opendaylight.controller.usermanager.UserConfig;
+import org.opendaylight.controller.usermanager.AuthorizationConfig;
 
 /**
  * Unit Tests for UserManagerImpl
@@ -157,7 +160,7 @@ public class UserManagerImplTest {
 
     /**
      * Test method for
-     * {@link org.opendaylight.controller.usermanager.internal.UserManagerImpl#addRemoveLocalUser(org.opendaylight.controller.usermanager.internal.UserConfig, boolean)}
+     * {@link org.opendaylight.controller.usermanager.internal.UserManagerImpl#addRemoveLocalUser(org.opendaylight.controller.usermanager.org.opendaylight.controller.usermanager.internal.UserConfig, boolean)}
      * .
      */
     @Test
index 6b0a731b99cc445df4c262beebb1e2407b8666f9..af5cd8d4569650ecbd719167171d2762bfb993cd 100644 (file)
@@ -3,19 +3,19 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
   xmlns:context="http://www.springframework.org/schema/context"\r
   xmlns:mvc="http://www.springframework.org/schema/mvc"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd \r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
                       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\r
                       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">\r
 \r
   <context:component-scan base-package="org.opendaylight.controller.devices.web"/>\r
-  \r
+\r
   <mvc:resources mapping="/js/**" location="/js/" />\r
   <mvc:resources mapping="/css/**" location="/css/" />\r
   <mvc:resources mapping="/img/**" location="/img/" />\r
   <mvc:annotation-driven/>\r
-  \r
+\r
   <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">\r
-       <property name="prefix" value="/WEB-INF/jsp/"/>\r
-       <property name="suffix" value=".jsp"/>\r
+        <property name="prefix" value="/WEB-INF/jsp/"/>\r
+        <property name="suffix" value=".jsp"/>\r
   </bean>\r
 </beans>\r
index 0c7edce24979757d351c68260e842d9f2ac4017a..6294a9fb5b794dbd0b23e7edb88d7cb0c7918612 100644 (file)
@@ -1,75 +1,75 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>free access</web-resource-name>
-                       <url-pattern>/js/*</url-pattern>
-                       <url-pattern>/images/*</url-pattern>
-                       <url-pattern>/css/*</url-pattern>
-                       <url-pattern>/favicon.ico</url-pattern>
-               </web-resource-collection>
-       </security-constraint>
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>free access</web-resource-name>
+                        <url-pattern>/js/*</url-pattern>
+                        <url-pattern>/images/*</url-pattern>
+                        <url-pattern>/css/*</url-pattern>
+                        <url-pattern>/favicon.ico</url-pattern>
+                </web-resource-collection>
+        </security-constraint>
 
-       <security-constraint>
-               <display-name>DevicesApp</display-name>
-               <web-resource-collection>
-                       <web-resource-name>DevicesGUI</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <display-name>DevicesApp</display-name>
+                <web-resource-collection>
+                        <web-resource-name>DevicesGUI</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>FORM</auth-method>
-               <form-login-config>
-                       <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
-                       <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
-               </form-login-config>
-       </login-config>
+        <login-config>
+                <auth-method>FORM</auth-method>
+                <form-login-config>
+                        <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
+                        <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
+                </form-login-config>
+        </login-config>
 
     <error-page>
             <error-code>403</error-code>
             <location>/WEB-INF/jsp/autherror.jsp</location>
     </error-page>
 
-       <servlet>
-               <servlet-name>Devices</servlet-name>
-               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-               <load-on-startup>1</load-on-startup>
-       </servlet>
+        <servlet>
+                <servlet-name>Devices</servlet-name>
+                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+                <load-on-startup>1</load-on-startup>
+        </servlet>
 
-       <servlet-mapping>
-               <servlet-name>Devices</servlet-name>
-               <url-pattern>/</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>Devices</servlet-name>
+                <url-pattern>/</url-pattern>
+        </servlet-mapping>
 
-       <listener>
-               <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
-       </listener>
-       <session-config>
-               <cookie-config>
-                       <path>/</path>
-               </cookie-config>
-       </session-config>
+        <listener>
+                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
+        </listener>
+        <session-config>
+                <cookie-config>
+                        <path>/</path>
+                </cookie-config>
+        </session-config>
 
 </web-app>
index fbe69795c2c73a3858e6f1e2750ab59821e7a2e5..293fa77ef11c29dbb6c9c5ffd9d5490cf65feb45 100644 (file)
@@ -3,19 +3,19 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
   xmlns:context="http://www.springframework.org/schema/context"\r
   xmlns:mvc="http://www.springframework.org/schema/mvc"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd \r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
                       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\r
                       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">\r
 \r
   <context:component-scan base-package="org.opendaylight.controller.flows.web"/>\r
-  \r
+\r
   <mvc:resources mapping="/js/**" location="/js/" />\r
   <mvc:resources mapping="/css/**" location="/css/" />\r
   <mvc:resources mapping="/img/**" location="/img/" />\r
   <mvc:annotation-driven/>\r
-  \r
+\r
   <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">\r
-       <property name="prefix" value="/WEB-INF/jsp/"/>\r
-       <property name="suffix" value=".jsp"/>\r
+        <property name="prefix" value="/WEB-INF/jsp/"/>\r
+        <property name="suffix" value=".jsp"/>\r
   </bean>\r
 </beans>\r
index 5660a37a14df775b87bb2b3396cd658f2b0866bb..c5d2479f6b8029c43617715a772392265343e51b 100644 (file)
@@ -1,79 +1,79 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
 
 
-       <servlet>
-               <servlet-name>Flows</servlet-name>
-               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-               <load-on-startup>1</load-on-startup>
-       </servlet>
+        <servlet>
+                <servlet-name>Flows</servlet-name>
+                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+                <load-on-startup>1</load-on-startup>
+        </servlet>
 
-       <servlet-mapping>
-               <servlet-name>Flows</servlet-name>
-               <url-pattern>/</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>Flows</servlet-name>
+                <url-pattern>/</url-pattern>
+        </servlet-mapping>
 
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>free access</web-resource-name>
-                       <url-pattern>/js/*</url-pattern>
-                       <url-pattern>/images/*</url-pattern>
-                       <url-pattern>/css/*</url-pattern>
-                       <url-pattern>/favicon.ico</url-pattern>
-               </web-resource-collection>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>free access</web-resource-name>
+                        <url-pattern>/js/*</url-pattern>
+                        <url-pattern>/images/*</url-pattern>
+                        <url-pattern>/css/*</url-pattern>
+                        <url-pattern>/favicon.ico</url-pattern>
+                </web-resource-collection>
+        </security-constraint>
 
-       <security-constraint>
-               <display-name>FlowApp</display-name>
-               <web-resource-collection>
-                       <web-resource-name>FlowMgrGUI</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-constraint>
+                <display-name>FlowApp</display-name>
+                <web-resource-collection>
+                        <web-resource-name>FlowMgrGUI</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>FORM</auth-method>
-               <form-login-config>
-                       <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
-                       <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
-               </form-login-config>
-       </login-config>
+        <login-config>
+                <auth-method>FORM</auth-method>
+                <form-login-config>
+                        <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
+                        <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
+                </form-login-config>
+        </login-config>
 
     <error-page>
             <error-code>403</error-code>
             <location>/WEB-INF/jsp/autherror.jsp</location>
     </error-page>
 
-       <listener>
-               <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
-       </listener>
+        <listener>
+                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
+        </listener>
 
-       <session-config>
-               <cookie-config>
-                       <path>/</path>
-               </cookie-config>
-       </session-config>
+        <session-config>
+                <cookie-config>
+                        <path>/</path>
+                </cookie-config>
+        </session-config>
 
 
 
index c748171685ebcbe7886229987d1eda67c62d03ab..ba2075ddb6a50c198e4d3fbb4d38369391c4fa13 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.usermanager.IUserManager;
-import org.opendaylight.controller.usermanager.internal.UserConfig;
+import org.opendaylight.controller.usermanager.UserConfig;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
index a818c8e6c9fbf10ff467bd5d1d935c361526964f..a8cb864367781639330bb03689c6d3f663b2cfb0 100644 (file)
@@ -3,19 +3,19 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:mvc="http://www.springframework.org/schema/mvc"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
   <context:component-scan base-package="org.opendaylight.controller.web"/>
-  
+
   <mvc:resources mapping="/js/**" location="/js/" />
   <mvc:resources mapping="/css/**" location="/css/" />
   <mvc:resources mapping="/img/**" location="/img/" />
   <mvc:annotation-driven/>
-  
+
   <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
-       <property name="prefix" value="/WEB-INF/jsp/"/>
-       <property name="suffix" value=".jsp"/>
+        <property name="prefix" value="/WEB-INF/jsp/"/>
+        <property name="suffix" value=".jsp"/>
   </bean>
 </beans>
\ No newline at end of file
index 18ac6e7ecb1cc84d7f3b85ecbb74207a713382a5..1e373fb56cd43d8d25550559e1b8878ee44b9db3 100644 (file)
@@ -1,82 +1,82 @@
 <beans:beans xmlns="http://www.springframework.org/schema/security"
-       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/security
            http://www.springframework.org/schema/security/spring-security-3.1.xsd">
 
 
-       <http pattern="/css/**" security="none" />
-       <http pattern="/js/**" security="none" />
-       <http pattern="/images/**" security="none" />
-       <http pattern="/favicon.ico" security="none" />
-       <http pattern="/controller/web/css/**" security="none" />
-       <http pattern="/controller/web/js/**" security="none" />
-       <http pattern="/controller/web/images/**" security="none" />
-
-
-       <http auto-config="false" authentication-manager-ref="authenticationManager"
-               security-context-repository-ref="securityContextRepo" entry-point-ref="loginUrlAuthenticationEntryPoint">
-               <intercept-url pattern="/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
-               <intercept-url pattern="/logout*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
-
-
-               <intercept-url pattern="/**"
-                       access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
-               <custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER" />
-               <custom-filter position="LOGOUT_FILTER" ref="logoutFilter" />
-               <custom-filter position="LAST" ref="controllerFilter" />
-               <remember-me services-ref="rememberMeServices" key="SDN" />
-       </http>
-       
-       <beans:bean id="controllerFilter"
-               class="org.opendaylight.controller.web.ControllerCustomFilter" />
-
-       <authentication-manager id="authenticationManager">
-               <authentication-provider ref="authenticationProviderWrapper" />
-       </authentication-manager>
-
-       <beans:bean id="authenticationFilter"
-               class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
-               <beans:property name="authenticationManager" ref="authenticationManager" />
-               <beans:property name="authenticationFailureHandler"
-                       ref="authenticationFailureHandler" />
-               <beans:property name="authenticationSuccessHandler">
-                       <beans:bean
-                               class="org.opendaylight.controller.web.ControllerAuthenticationSuccessHandler">
-                               <beans:property name="targetUrlParameter" value="x-page-url" />
-                               <beans:property name="defaultTargetUrl" value="/" />
-                       </beans:bean>
-               </beans:property>
-               <beans:property name="rememberMeServices" ref="rememberMeServices" />
-       </beans:bean>
-
-       <beans:bean id="securityContextRepo"
-               class="org.opendaylight.controller.web.ControllerWebSecurityContextRepository" />
-
-       <beans:bean id="authenticationFailureHandler"
-               class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
-               <beans:property name="useForward" value="false" />
-               <beans:property name="defaultFailureUrl" value="/login" />              
-       </beans:bean>
-
-       <beans:bean id="loginUrlAuthenticationEntryPoint"
-               class="org.opendaylight.controller.web.ControllerLoginUrlAuthEntryPoint">
-               <beans:property name="loginFormUrl" value="/login" />
-       </beans:bean>
-
-       <beans:bean id="authenticationProviderWrapper"
-               class="org.opendaylight.controller.web.AuthenticationProviderWrapper" />
+        <http pattern="/css/**" security="none" />
+        <http pattern="/js/**" security="none" />
+        <http pattern="/images/**" security="none" />
+        <http pattern="/favicon.ico" security="none" />
+        <http pattern="/controller/web/css/**" security="none" />
+        <http pattern="/controller/web/js/**" security="none" />
+        <http pattern="/controller/web/images/**" security="none" />
+
+
+        <http auto-config="false" authentication-manager-ref="authenticationManager"
+                security-context-repository-ref="securityContextRepo" entry-point-ref="loginUrlAuthenticationEntryPoint">
+                <intercept-url pattern="/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
+                <intercept-url pattern="/logout*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
+
+
+                <intercept-url pattern="/**"
+                        access="ROLE_SYSTEM-ADMIN, ROLE_NETWORK-ADMIN, ROLE_NETWORK-OPERATOR, ROLE_CONTAINER-USER" />
+                <custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER" />
+                <custom-filter position="LOGOUT_FILTER" ref="logoutFilter" />
+                <custom-filter position="LAST" ref="controllerFilter" />
+                <remember-me services-ref="rememberMeServices" key="SDN" />
+        </http>
+
+        <beans:bean id="controllerFilter"
+                class="org.opendaylight.controller.web.ControllerCustomFilter" />
+
+        <authentication-manager id="authenticationManager">
+                <authentication-provider ref="authenticationProviderWrapper" />
+        </authentication-manager>
+
+        <beans:bean id="authenticationFilter"
+                class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
+                <beans:property name="authenticationManager" ref="authenticationManager" />
+                <beans:property name="authenticationFailureHandler"
+                        ref="authenticationFailureHandler" />
+                <beans:property name="authenticationSuccessHandler">
+                        <beans:bean
+                                class="org.opendaylight.controller.web.ControllerAuthenticationSuccessHandler">
+                                <beans:property name="targetUrlParameter" value="x-page-url" />
+                                <beans:property name="defaultTargetUrl" value="/" />
+                        </beans:bean>
+                </beans:property>
+                <beans:property name="rememberMeServices" ref="rememberMeServices" />
+        </beans:bean>
+
+        <beans:bean id="securityContextRepo"
+                class="org.opendaylight.controller.web.ControllerWebSecurityContextRepository" />
+
+        <beans:bean id="authenticationFailureHandler"
+                class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
+                <beans:property name="useForward" value="false" />
+                <beans:property name="defaultFailureUrl" value="/login" />
+        </beans:bean>
+
+        <beans:bean id="loginUrlAuthenticationEntryPoint"
+                class="org.opendaylight.controller.web.ControllerLoginUrlAuthEntryPoint">
+                <beans:property name="loginFormUrl" value="/login" />
+        </beans:bean>
+
+        <beans:bean id="authenticationProviderWrapper"
+                class="org.opendaylight.controller.web.AuthenticationProviderWrapper" />
 
     <!-- logout related -->
-    
+
     <beans:bean id="logoutHandler"
         class="org.opendaylight.controller.web.ControllerLogoutHandler" />
-        
+
     <beans:bean id="securityContextLogoutHandler"
-        class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />    
-        
-            
+        class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
+
+
     <beans:bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
         <!-- if logout succeed then this is the URL -->
         <beans:constructor-arg value="/login" />
             </beans:list>
         </beans:constructor-arg>
         <beans:property name="filterProcessesUrl" value="/logout" />
-    </beans:bean>       
-        
+    </beans:bean>
+
+
 
 
+        <!-- remember me related -->
+        <beans:bean id="rememberMeFilter"
+                class="org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter">
+                <beans:property name="rememberMeServices" ref="rememberMeServices" />
+                <beans:property name="authenticationManager" ref="authenticationManager" />
+        </beans:bean>
 
-       <!-- remember me related -->
-       <beans:bean id="rememberMeFilter"
-               class="org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter">
-               <beans:property name="rememberMeServices" ref="rememberMeServices" />
-               <beans:property name="authenticationManager" ref="authenticationManager" />
-       </beans:bean>
+        <beans:bean id="rememberMeServices"
+                class="org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
+                <beans:property name="userDetailsService" ref="userDetailsServiceRef" />
+                <beans:property name="key" value="SDN" />
+                <beans:property name="alwaysRemember" value="true"></beans:property>
+                <beans:property name="tokenValiditySeconds" value="3600" />
+                <beans:property name="cookieName" value="SDN-Controller" />
+        </beans:bean>
 
-       <beans:bean id="rememberMeServices"
-               class="org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
-               <beans:property name="userDetailsService" ref="userDetailsServiceRef" />
-               <beans:property name="key" value="SDN" />
-               <beans:property name="alwaysRemember" value="true"></beans:property>
-               <beans:property name="tokenValiditySeconds" value="3600" />
-               <beans:property name="cookieName" value="SDN-Controller" />
-       </beans:bean>
+        <beans:bean id="userDetailsServiceRef" class="org.opendaylight.controller.web.ControllerUserDetailsService" />
 
-       <beans:bean id="userDetailsServiceRef" class="org.opendaylight.controller.web.ControllerUserDetailsService" />
 
+        <beans:bean id="rememberMeAuthenticationProvider"
+                class="org.springframework.security.authentication.RememberMeAuthenticationProvider">
+                <beans:property name="key" value="SDN" />
+        </beans:bean>
 
-       <beans:bean id="rememberMeAuthenticationProvider"
-               class="org.springframework.security.authentication.RememberMeAuthenticationProvider">
-               <beans:property name="key" value="SDN" />
-       </beans:bean>
-       
 </beans:beans>
index d96fb6eba249a5d883a6aa00287e3919276fff70..557b9c74f5a0b3fd28cb53281339105c242d9698 100644 (file)
@@ -1,84 +1,84 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
-       version="2.4"> -->
+<!-- <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+        version="2.4"> -->
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>free access</web-resource-name>
-                       <url-pattern>/js/*</url-pattern>
-                       <url-pattern>/images/*</url-pattern>
-                       <url-pattern>/css/*</url-pattern>
-                       <url-pattern>/favicon.ico</url-pattern>
-               </web-resource-collection>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>free access</web-resource-name>
+                        <url-pattern>/js/*</url-pattern>
+                        <url-pattern>/images/*</url-pattern>
+                        <url-pattern>/css/*</url-pattern>
+                        <url-pattern>/favicon.ico</url-pattern>
+                </web-resource-collection>
+        </security-constraint>
 
-       <security-constraint>
-               <display-name>RootApp</display-name>
-               <web-resource-collection>
-                       <web-resource-name>RootGUI</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <display-name>RootApp</display-name>
+                <web-resource-collection>
+                        <web-resource-name>RootGUI</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
 
-       <login-config>
-               <auth-method>FORM</auth-method>
-               <form-login-config>
-                       <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
-                       <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
-               </form-login-config>
-       </login-config>
+        <login-config>
+                <auth-method>FORM</auth-method>
+                <form-login-config>
+                        <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
+                        <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
+                </form-login-config>
+        </login-config>
 
     <error-page>
             <error-code>403</error-code>
             <location>/WEB-INF/jsp/autherror.jsp</location>
     </error-page>
 
-       <servlet>
-               <servlet-name>RootGUI</servlet-name>
-               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-               <load-on-startup>1</load-on-startup>
-       </servlet>
+        <servlet>
+                <servlet-name>RootGUI</servlet-name>
+                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+                <load-on-startup>1</load-on-startup>
+        </servlet>
 
-       <servlet-mapping>
-               <servlet-name>RootGUI</servlet-name>
-               <url-pattern>/</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>RootGUI</servlet-name>
+                <url-pattern>/</url-pattern>
+        </servlet-mapping>
 
-       <display-name>OpenDaylight Controller</display-name>
-       <description>OpenDaylight Controller</description>
+        <display-name>OpenDaylight Controller</display-name>
+        <description>OpenDaylight Controller</description>
 
-       <listener>
-               <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
-       </listener>
+        <listener>
+                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
+        </listener>
 
-       <session-config>
-               <cookie-config>
-                       <path>/</path>
-               </cookie-config>
-       </session-config>
+        <session-config>
+                <cookie-config>
+                        <path>/</path>
+                </cookie-config>
+        </session-config>
 
 </web-app>
index 1c05bbcd7ea94dd6459b46f76a277bf5930ded2f..cb6f2b6973863f9bb2cb937f38fd51d2eb55668c 100644 (file)
@@ -3,19 +3,19 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
   xmlns:context="http://www.springframework.org/schema/context"\r
   xmlns:mvc="http://www.springframework.org/schema/mvc"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd \r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
                       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\r
                       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">\r
 \r
   <context:component-scan base-package="org.opendaylight.controller.topology.web"/>\r
-  \r
+\r
   <mvc:resources mapping="/js/**" location="/js/" />\r
   <mvc:resources mapping="/css/**" location="/css/" />\r
   <mvc:resources mapping="/img/**" location="/img/" />\r
   <mvc:annotation-driven/>\r
-  \r
+\r
   <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">\r
-       <property name="prefix" value="/WEB-INF/jsp/"/>\r
-       <property name="suffix" value=".jsp"/>\r
+        <property name="prefix" value="/WEB-INF/jsp/"/>\r
+        <property name="suffix" value=".jsp"/>\r
   </bean>\r
 </beans>\r
index 274908caec7610ff8d541a36eed882ce7e8a57b4..c37fffe500402c9229337e38735781a7b55176e8 100644 (file)
@@ -1,78 +1,78 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>free access</web-resource-name>
-                       <url-pattern>/js/*</url-pattern>
-                       <url-pattern>/images/*</url-pattern>
-                       <url-pattern>/css/*</url-pattern>
-                       <url-pattern>/favicon.ico</url-pattern>
-               </web-resource-collection>
-       </security-constraint>
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>free access</web-resource-name>
+                        <url-pattern>/js/*</url-pattern>
+                        <url-pattern>/images/*</url-pattern>
+                        <url-pattern>/css/*</url-pattern>
+                        <url-pattern>/favicon.ico</url-pattern>
+                </web-resource-collection>
+        </security-constraint>
 
-       <security-constraint>
-               <display-name>TopologyApp</display-name>
-               <web-resource-collection>
-                       <web-resource-name>TopoGUI</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-constraint>
+                <display-name>TopologyApp</display-name>
+                <web-resource-collection>
+                        <web-resource-name>TopoGUI</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>FORM</auth-method>
-               <form-login-config>
-                       <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
-                       <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
-               </form-login-config>
-       </login-config>
+        <login-config>
+                <auth-method>FORM</auth-method>
+                <form-login-config>
+                        <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
+                        <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
+                </form-login-config>
+        </login-config>
 
     <error-page>
             <error-code>403</error-code>
             <location>/WEB-INF/jsp/autherror.jsp</location>
     </error-page>
 
-       <servlet>
-               <servlet-name>Topology</servlet-name>
-               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-               <load-on-startup>1</load-on-startup>
-       </servlet>
+        <servlet>
+                <servlet-name>Topology</servlet-name>
+                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+                <load-on-startup>1</load-on-startup>
+        </servlet>
 
 
 
-       <servlet-mapping>
-               <servlet-name>Topology</servlet-name>
-               <url-pattern>/</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>Topology</servlet-name>
+                <url-pattern>/</url-pattern>
+        </servlet-mapping>
 
-       <listener>
-               <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
-       </listener>
+        <listener>
+                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
+        </listener>
 
-       <session-config>
-               <cookie-config>
-                       <path>/</path>
-               </cookie-config>
-       </session-config>
+        <session-config>
+                <cookie-config>
+                        <path>/</path>
+                </cookie-config>
+        </session-config>
 
 
 </web-app>
index 877617a97567704ee93e4b17e82dc432ec7db6c9..91e22f6dad05a7491979a83c728dafdcfec79811 100644 (file)
@@ -3,19 +3,19 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
   xmlns:context="http://www.springframework.org/schema/context"\r
   xmlns:mvc="http://www.springframework.org/schema/mvc"\r
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd \r
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
                       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\r
                       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">\r
 \r
   <context:component-scan base-package="org.opendaylight.controller.troubleshoot.web"/>\r
-  \r
+\r
   <mvc:resources mapping="/js/**" location="/js/" />\r
   <mvc:resources mapping="/css/**" location="/css/" />\r
   <mvc:resources mapping="/img/**" location="/img/" />\r
   <mvc:annotation-driven/>\r
-  \r
+\r
   <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">\r
-       <property name="prefix" value="/WEB-INF/jsp/"/>\r
-       <property name="suffix" value=".jsp"/>\r
+        <property name="prefix" value="/WEB-INF/jsp/"/>\r
+        <property name="suffix" value=".jsp"/>\r
   </bean>\r
 </beans>\r
index 47d38f9a5379837eea18988565bc14b052e671c8..2d89e9d9753b464b0d7a6af4b23a57ac4449c20c 100644 (file)
@@ -1,81 +1,81 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-       version="3.0">
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
 
-       <servlet>
-               <servlet-name>Troubleshoot</servlet-name>
-               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-               <load-on-startup>1</load-on-startup>
-       </servlet>
+        <servlet>
+                <servlet-name>Troubleshoot</servlet-name>
+                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+                <load-on-startup>1</load-on-startup>
+        </servlet>
 
-       <servlet-mapping>
-               <servlet-name>Troubleshoot</servlet-name>
-               <url-pattern>/</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>Troubleshoot</servlet-name>
+                <url-pattern>/</url-pattern>
+        </servlet-mapping>
 
 
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>free access</web-resource-name>
-                       <url-pattern>/js/*</url-pattern>
-                       <url-pattern>/images/*</url-pattern>
-                       <url-pattern>/css/*</url-pattern>
-                       <url-pattern>/favicon.ico</url-pattern>
-               </web-resource-collection>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>free access</web-resource-name>
+                        <url-pattern>/js/*</url-pattern>
+                        <url-pattern>/images/*</url-pattern>
+                        <url-pattern>/css/*</url-pattern>
+                        <url-pattern>/favicon.ico</url-pattern>
+                </web-resource-collection>
+        </security-constraint>
 
-       <security-constraint>
-               <display-name>TroubleShootApp</display-name>
-               <web-resource-collection>
-                       <web-resource-name>TroubleShootGUI</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <display-name>TroubleShootApp</display-name>
+                <web-resource-collection>
+                        <web-resource-name>TroubleShootGUI</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
 
-       <login-config>
-               <auth-method>FORM</auth-method>
-               <form-login-config>
-                       <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
-                       <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
-               </form-login-config>
-       </login-config>
+        <login-config>
+                <auth-method>FORM</auth-method>
+                <form-login-config>
+                        <form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
+                        <form-error-page>/WEB-INF/jsp/error.jsp</form-error-page>
+                </form-login-config>
+        </login-config>
 
     <error-page>
             <error-code>403</error-code>
             <location>/WEB-INF/jsp/autherror.jsp</location>
     </error-page>
 
-       <listener>
-               <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
-       </listener>
+        <listener>
+                <listener-class>org.opendaylight.controller.web.ControllerUISessionManager</listener-class>
+        </listener>
 
-       <session-config>
-               <cookie-config>
-                       <path>/</path>
-               </cookie-config>
-       </session-config>
+        <session-config>
+                <cookie-config>
+                        <path>/</path>
+                </cookie-config>
+        </session-config>