Statistics loadable / installable in Karaf 09/12909/2
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 18 Nov 2014 09:41:42 +0000 (10:41 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 18 Nov 2014 13:34:32 +0000 (14:34 +0100)
 - created new feature odl-openflowjava-stats in order to ensure correct
   module start
 - created new project openflowjava-config to properly store and delagate
   statistics config file
 - removed stats-collection as a service from configuration xml

Change-Id: If2b94c4ec9bf2a2c8157eaad546672df6e1d1500
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
features/src/main/resources/features.xml
openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/StatisticsCollectionModule.java
openflowjava-config/pom.xml [new file with mode: 0644]
openflowjava-config/src/main/resources/45-openflowjava-stats.xml [new file with mode: 0644]
pom.xml

index ace7ba147d0144af9f9a4e4be685c65697710e08..87d05699e24f6c1f73c9cbeabdff2319d372792e 100644 (file)
@@ -24,4 +24,8 @@
         <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-impl/${project.version}</bundle>
         <bundle>mvn:org.opendaylight.openflowjava/util/${project.version}</bundle>
     </feature>
+    <feature name='odl-openflowjava-stats' description="OpenDaylight :: Openflow Java :: Stats">
+        <feature version='${project.version}'>odl-openflowjava-protocol</feature>
+        <configfile finalname="etc/opendaylight/karaf/45-openflowjava-stats.xml">mvn:org.opendaylight.openflowjava/openflowjava-config/${project.version}/xml/configstats</configfile>
+    </feature>
 </features>
index ff686c16439f89b10c6ee9a1acbcdcf478bbb0ef..5de0a75f2d65c83c224090f38191babefba0f4a5 100644 (file)
@@ -50,10 +50,7 @@ public class StatisticsCollectionModule extends org.opendaylight.yang.gen.v1.urn
                     return 0;
                 }
             };
-        } else {
-            LOGGER.error("STATISTICS ARE NULL");
         }
-        LOGGER.error("config " + statsConfig);
         if (statsConfig != null) {
             statsCounter.startCounting(statsConfig.getStatisticsCollect(), statsConfig.getLogReportDelay());
         } else {
diff --git a/openflowjava-config/pom.xml b/openflowjava-config/pom.xml
new file mode 100644 (file)
index 0000000..6064765
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. \r
+    This program and the accompanying materials are made available under the \r
+    terms of the Eclipse Public License v1.0 which accompanies this distribution, \r
+    and is available at http://www.eclipse.org/legal/epl-v10.html -->
+<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">\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
+\r
+    <parent>\r
+        <groupId>org.opendaylight.openflowjava</groupId>\r
+        <artifactId>openflow-protocol-parent</artifactId>\r
+        <version>0.6.0-SNAPSHOT</version>\r
+    </parent>\r
+    <artifactId>openflowjava-config</artifactId>\r
+    <description>Configuration files for openflowjava statistics</description>\r
+    <packaging>jar</packaging>\r
+    <name>Openflow Protocol Library - CONFIG</name>\r
+    <scm>\r
+        <url>https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main</url>\r
+        <tag>HEAD</tag>\r
+    </scm>\r
+    <properties>\r
+        <configfile>45-openflowjava-stats.xml</configfile>\r
+    </properties>\r
+    <build>\r
+        <plugins>\r
+            <plugin>\r
+                <groupId>org.codehaus.mojo</groupId>\r
+                <artifactId>build-helper-maven-plugin</artifactId>\r
+                <executions>\r
+                    <execution>\r
+                        <id>attach-artifacts</id>\r
+                        <goals>\r
+                            <goal>attach-artifact</goal>\r
+                        </goals>\r
+                        <phase>package</phase>\r
+                        <configuration>\r
+                            <artifacts>\r
+                                <artifact>\r
+                                    <file>${project.build.directory}/classes/${configfile}</file>\r
+                                    <type>xml</type>\r
+                                    <classifier>configstats</classifier>\r
+                                </artifact>\r
+                            </artifacts>\r
+                        </configuration>\r
+                    </execution>\r
+                </executions>\r
+            </plugin>\r
+        </plugins>\r
+    </build>\r
+</project>\r
diff --git a/openflowjava-config/src/main/resources/45-openflowjava-stats.xml b/openflowjava-config/src/main/resources/45-openflowjava-stats.xml
new file mode 100644 (file)
index 0000000..1276195
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- vi: set et smarttab sw=4 tabstop=4: -->\r
+<!--\r
+Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+\r
+This program and the accompanying materials are made available under the\r
+terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+and is available at http://www.eclipse.org/legal/epl-v10.html\r
+-->\r
+<snapshot>\r
+  <required-capabilities>\r
+    <!-- openflowjava -->\r
+    <capability>urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider:impl?module=openflow-switch-connection-provider-impl&amp;revision=2014-03-28</capability>\r
+    <capability>urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider?module=openflow-switch-connection-provider&amp;revision=2014-03-28</capability>\r
+  </required-capabilities>\r
+\r
+  <configuration>\r
+\r
+    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\r
+      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">\r
+        <module>\r
+            <type xmlns:stats="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider:impl">stats:statistics-collection-service-impl</type>\r
+            <name>statistics-collection-service-impl</name>\r
+            <statistics>\r
+                <statistics-collect>true</statistics-collect>\r
+                <log-report-delay>10000</log-report-delay>\r
+            </statistics>\r
+            <openflow-switch-connection-provider>\r
+                <type xmlns:ofSwitch="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider">ofSwitch:openflow-switch-connection-provider</type>\r
+                <name>openflow-switch-connection-provider-default</name>\r
+            </openflow-switch-connection-provider>\r
+            <openflow-switch-connection-provider>\r
+                <type xmlns:ofSwitch="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider">ofSwitch:openflow-switch-connection-provider</type>\r
+                <name>openflow-switch-connection-provider-legacy</name>\r
+            </openflow-switch-connection-provider>\r
+        </module>\r
+      </modules>\r
+    </data>\r
+\r
+  </configuration>\r
+</snapshot>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index d2d90009ee90880e45fc5c306cdb1e9cbd97e4af..da66cf0c5f7a53fa23fa522ec0e7ff60593d0adc 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -6,6 +6,7 @@
     <version>0.6.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <modules>
+        <module>openflowjava-config</module>
         <module>openflow-protocol-api</module>
         <module>openflow-protocol-spi</module>
         <module>util</module>
@@ -13,7 +14,7 @@
         <module>openflow-protocol-it</module>
         <module>features</module>
         <module>simple-client</module>
-    </modules>
+  </modules>
     <scm>
         <connection>scm:git:ssh://git.opendaylight.org:29418/openflowjava.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowjava.git</developerConnection>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <execute></execute>
+                            <execute/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                         <pluginExecution>
                             </goals>
                           </pluginExecutionFilter>
                           <action>
-                            <ignore></ignore>
+                            <ignore/>
                           </action>
                         </pluginExecution>
                       </pluginExecutions>
             </build>
         </profile>
     </profiles>
-</project>
+</project>
\ No newline at end of file