Merge "Configuration service uses an inconsistent hashcode in the clustered data...
authorAlessandro Boch <aboch@cisco.com>
Fri, 22 Aug 2014 15:53:59 +0000 (15:53 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 22 Aug 2014 15:53:59 +0000 (15:53 +0000)
features/base/src/main/resources/features.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight-karaf-resources/src/main/resources/configuration/tomcat-server.xml
opendaylight/karaf-tomcat-security/pom.xml [new file with mode: 0644]
opendaylight/karaf-tomcat-security/src/main/java/org/opendaylight/controller/karafsecurity/ControllerCustomRealm.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/FlowComparator.java
pom.xml

index b9107b9f62881d1fc2799ddbecc238559add943a..c335600e21d35b33e90a09e977b8a9b505dc509c 100644 (file)
@@ -13,6 +13,7 @@
       <feature>base-tomcat</feature>
       <feature>base-netty</feature>
       <feature>base-jersey</feature>
+      <feature>base-jackson</feature>
       <feature>base-spring-security</feature>
    </feature>
    <feature name="base-dummy-console" description="Temporary Dummy Console" version="1.1.0-SNAPSHOT">
@@ -44,7 +45,6 @@
       <bundle>mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
       <bundle>mvn:com.sun.jersey/jersey-client/${jersey.version}</bundle>
       <bundle>mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
-      <bundle start="true" start-level="35">mvn:javax.ws.rs/javax.ws.rs-api/2.0</bundle>
    </feature>
    <feature name="base-jersey2-osgi" description="OSGi friendly Jersey" version="${jersey2.publisher.version}">
       <feature>http</feature>
       <bundle start="true" start-level="35">mvn:orbit/javax.servlet.jsp.jstl/1.2.0.v201105211821</bundle>
       <bundle start="true" start-level="35">mvn:orbit/javax.servlet.jsp.jstl.impl/1.2.0.v201210211230</bundle>
    </feature>
-   <feature name="base-tomcat" description="OpenDaylight Tomcat" version="7.0.32">
+   <feature name="base-tomcat" description="OpenDaylight Tomcat" version="7.0.53">
       <feature>base-gemini-web</feature>
       <feature>base-eclipselink-persistence</feature>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina/7.0.32.v201211201336</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina/${commons.karaf.catalina}</bundle>
       <bundle start="true" start-level="35">mvn:geminiweb/org.eclipse.gemini.web.tomcat/${geminiweb.version}</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina.ha/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina.tribes/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.coyote/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.el/7.0.32.v201211081135</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.jasper/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.juli.extras/7.0.32.v201211081135</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.api/7.0.32.v201211081135</bundle>
-      <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.util/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">wrap:mvn:virgomirror/org.eclipse.jdt.core.compiler.batch/3.8.0.I20120518-2145</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina.ha/${commons.karaf.catalina.ha}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.catalina.tribes/${commons.karaf.catalina.tribes}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.coyote/${commons.karaf.coyote}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.el/${commons.karaf.el}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.jasper/${commons.karaf.jasper}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.juli.extras/${commons.karaf.juli.version}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.api/${commons.karaf.tomcat.api}</bundle>
+      <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.util/${commons.karaf.tomcat.util}</bundle>
+      <bundle start="true" >mvn:org.opendaylight.controller/karaf-tomcat-security/${karaf.security.version}</bundle>
+      <bundle start="true" start-level="35">wrap:mvn:virgomirror/org.eclipse.jdt.core.compiler.batch/${eclipse.jdt.core.compiler.batch.version}</bundle>
    </feature>
    <feature name="base-spring" description="Opendaylight Spring Support" version="${spring.version}">
       <bundle>mvn:org.ow2.asm/asm-all/${asm.version}</bundle>
index 1064afd82d53fcdcdf6714421b5702535a2d6180..5ead566d9d41046b42c0cd7a873ba1983f90bcf6 100644 (file)
     <commons.catalina>7.0.32.v201211201336</commons.catalina>
     <commons.catalina.ha>7.0.32.v201211201952</commons.catalina.ha>
     <commons.catalina.tribes>7.0.32.v201211201952</commons.catalina.tribes>
-    <commons.checkstyle.version>0.0.3-SNAPSHOT</commons.checkstyle.version>
     <commons.coyote>7.0.32.v201211201952</commons.coyote>
     <commons.el>7.0.32.v201211081135</commons.el>
+    <commons.jasper>7.0.32.v201211201952</commons.jasper>
+    <commons.juli.version>7.0.32.v201211081135</commons.juli.version>
+    <commons.tomcat.api>7.0.32.v201211081135</commons.tomcat.api>
+    <commons.tomcat.util>7.0.32.v201211201952</commons.tomcat.util>
+
+    <commons.karaf.catalina>7.0.53.v201406061610</commons.karaf.catalina>
+    <commons.karaf.catalina.ha>7.0.53.v201406070630</commons.karaf.catalina.ha>
+    <commons.karaf.catalina.tribes>7.0.53.v201406070630</commons.karaf.catalina.tribes>
+    <commons.karaf.coyote>7.0.53.v201406070630</commons.karaf.coyote>
+    <commons.karaf.el>7.0.53.v201406060720</commons.karaf.el>
+    <commons.karaf.jasper>7.0.53.v201406070630</commons.karaf.jasper>
+    <commons.karaf.juli.version>7.0.53.v201406060720</commons.karaf.juli.version>
+    <commons.karaf.tomcat.api>7.0.53.v201406060720</commons.karaf.tomcat.api>
+    <commons.karaf.tomcat.util>7.0.53.v201406070630</commons.karaf.tomcat.util>
+
+    <commons.checkstyle.version>0.0.3-SNAPSHOT</commons.checkstyle.version>
     <commons.fileupload.version>1.2.2</commons.fileupload.version>
     <commons.httpclient.version>0.1.2-SNAPSHOT</commons.httpclient.version>
     <commons.io.version>2.4</commons.io.version>
-    <commons.jasper>7.0.32.v201211201952</commons.jasper>
-    <commons.juli.version>7.0.32.v201211081135</commons.juli.version>
     <commons.lang3.version>3.1</commons.lang3.version>
     <commons.logback_settings.version>0.0.2-SNAPSHOT</commons.logback_settings.version>
     <commons.net.version>3.0.1</commons.net.version>
@@ -57,8 +70,6 @@
     <commons.opendaylight.concepts.version>0.5.2-SNAPSHOT</commons.opendaylight.concepts.version>
     <commons.opendaylight.version>1.4.2-SNAPSHOT</commons.opendaylight.version>
     <commons.parent.version>1.0.2-SNAPSHOT</commons.parent.version>
-    <commons.tomcat.api>7.0.32.v201211081135</commons.tomcat.api>
-    <commons.tomcat.util>7.0.32.v201211201952</commons.tomcat.util>
     <compiler.version>2.3.2</compiler.version>
     <commons.httpclient.version>0.1.2-SNAPSHOT</commons.httpclient.version>
     <concepts.version>0.5.2-SNAPSHOT</concepts.version>
@@ -82,6 +93,7 @@
     <devices.web.version>0.4.2-SNAPSHOT</devices.web.version>
     <dummy-console.version>1.1.0-SNAPSHOT</dummy-console.version>
     <eclipse.persistence.version>2.5.0</eclipse.persistence.version>
+    <eclipse.jdt.core.compiler.batch.version>3.8.0.I20120518-2145</eclipse.jdt.core.compiler.batch.version>
     <!-- enforcer version -->
     <enforcer.version>1.3.1</enforcer.version>
     <enunciate.version>1.28</enunciate.version>
     <scala.version>2.10</scala.version>
     <scala.micro.version>4</scala.micro.version>
     <security.version>0.4.2-SNAPSHOT</security.version>
+    <karaf.security.version>0.4.2-SNAPSHOT</karaf.security.version>
     <shapeless.version>1.2.4</shapeless.version>
     <sitedeploy>dav:http://nexus.opendaylight.org/content/sites/site</sitedeploy>
     <sonar.branch>${user.name}-private-view</sonar.branch>
index f6f923e0d26720bda6960c0acf21954d0f6721f5..73a46f0f8a21624365241abf7a42ec0f5403adfb 100644 (file)
@@ -48,9 +48,8 @@
       <Host name="localhost" appBase=""
             unpackWARs="false" autoDeploy="false"
             deployOnStartup="false" createDirs="false">
-<!--         <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
+            <Realm className="org.opendaylight.controller.karafsecurity.ControllerCustomRealm />
             <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"
diff --git a/opendaylight/karaf-tomcat-security/pom.xml b/opendaylight/karaf-tomcat-security/pom.xml
new file mode 100644 (file)
index 0000000..817e0fa
--- /dev/null
@@ -0,0 +1,49 @@
+<?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>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.2-SNAPSHOT</version>
+    <relativePath>../commons/opendaylight</relativePath>
+  </parent>
+
+  <artifactId>karaf-tomcat-security</artifactId>
+  <version>0.4.2-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>orbit</groupId>
+      <artifactId>org.apache.catalina</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Fragment-Host>org.apache.catalina</Fragment-Host>
+            <Import-Package>org.slf4j,
+              javax.servlet,
+              org.apache.catalina,
+              org.apache.catalina.connector,
+              org.apache.catalina.valves,
+              org.apache.catalina.realm
+            </Import-Package>
+            <Export-Package>org.opendaylight.controller.karafsecurity</Export-Package>
+          </instructions>
+          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+  </scm>
+</project>
diff --git a/opendaylight/karaf-tomcat-security/src/main/java/org/opendaylight/controller/karafsecurity/ControllerCustomRealm.java b/opendaylight/karaf-tomcat-security/src/main/java/org/opendaylight/controller/karafsecurity/ControllerCustomRealm.java
new file mode 100644 (file)
index 0000000..316067c
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.karafsecurity;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.catalina.realm.GenericPrincipal;
+import org.apache.catalina.realm.RealmBase;
+
+public class ControllerCustomRealm  extends RealmBase {
+
+    private static final String name = "ControllerCustomRealm";
+
+    @Override
+    protected String getName() {
+        return name;
+    }
+
+    @Override
+    protected String getPassword(String username) {
+        return "admin";
+    }
+
+    @Override
+    protected Principal getPrincipal(String username) {
+        List<String> controllerRoles = new ArrayList<String>();
+        controllerRoles.add("System-Admin");
+        return new GenericPrincipal(username, "", controllerRoles);
+    }
+
+    @Override
+    public Principal authenticate(String username, String credentials) {
+        return this.getPrincipal(username);
+    }
+}
index 592bc49d9e40648a53e6d448666d34c58f2f4184..ce31c3ad5738edc81db36f8666c67dc309cbdfb7 100644 (file)
@@ -27,9 +27,9 @@ public class DistributedConfigDataStoreProviderModule extends
     @Override
     public java.lang.AutoCloseable createInstance() {
         return DistributedDataStoreFactory.createInstance("config", getConfigSchemaServiceDependency(),
-                InMemoryDOMDataStoreConfigProperties.create(getMaxShardDataChangeExecutorPoolSize(),
-                        getMaxShardDataChangeExecutorQueueSize(),
-                        getMaxShardDataChangeListenerQueueSize()));
+                InMemoryDOMDataStoreConfigProperties.create(getConfigMaxShardDataChangeExecutorPoolSize(),
+                        getConfigMaxShardDataChangeExecutorQueueSize(),
+                        getConfigMaxShardDataChangeListenerQueueSize()));
     }
 
 }
index 9eb72d64d0e90079b5fe1ae7a0405bc5a522b8d0..4d5b07420f7cda5d0a0c1d74740026cde5e74eab 100644 (file)
@@ -28,9 +28,9 @@ public class DistributedOperationalDataStoreProviderModule extends
     public java.lang.AutoCloseable createInstance() {
         return DistributedDataStoreFactory.createInstance("operational",
                 getOperationalSchemaServiceDependency(),
-                InMemoryDOMDataStoreConfigProperties.create(getMaxShardDataChangeExecutorPoolSize(),
-                        getMaxShardDataChangeExecutorQueueSize(),
-                        getMaxShardDataChangeListenerQueueSize()));
+                InMemoryDOMDataStoreConfigProperties.create(getOperationalMaxShardDataChangeExecutorPoolSize(),
+                        getOperationalMaxShardDataChangeExecutorQueueSize(),
+                        getOperationalMaxShardDataChangeListenerQueueSize()));
     }
 
 }
index ecb823e624709bc84f167e522efa09bba06e53f8..6bca5ce25cefe5dbcea73279fa5395f359bb8916 100644 (file)
@@ -49,19 +49,19 @@ module distributed-datastore-provider {
                 }
             }
 
-            leaf max-shard-data-change-executor-queue-size {
+            leaf config-max-shard-data-change-executor-queue-size {
                 default 1000;
                 type uint16;
                 description "The maximum queue size for each shard's data store data change notification executor.";
             }
 
-            leaf max-shard-data-change-executor-pool-size {
+            leaf config-max-shard-data-change-executor-pool-size {
                 default 20;
                 type uint16;
                 description "The maximum thread pool size for each shard's data store data change notification executor.";
             }
 
-            leaf max-shard-data-change-listener-queue-size {
+            leaf config-max-shard-data-change-listener-queue-size {
                 default 1000;
                 type uint16;
                 description "The maximum queue size for each shard's data store data change listeners.";
@@ -82,19 +82,19 @@ module distributed-datastore-provider {
                     }
                 }
 
-            leaf max-shard-data-change-executor-queue-size {
+            leaf operational-max-shard-data-change-executor-queue-size {
                 default 1000;
                 type uint16;
                 description "The maximum queue size for each shard's data store data change notification executor.";
             }
 
-            leaf max-shard-data-change-executor-pool-size {
+            leaf operational-max-shard-data-change-executor-pool-size {
                 default 20;
                 type uint16;
                 description "The maximum thread pool size for each shard's data store data change notification executor.";
             }
 
-            leaf max-shard-data-change-listener-queue-size {
+            leaf operational-max-shard-data-change-listener-queue-size {
                 default 1000;
                 type uint16;
                 description "The maximum queue size for each shard's data store data change listeners.";
index cd9738c894554a8e609eac1acb4b9fbd9534eac9..2b67edfd9d318d29cbd3508c17a1e8bafd9f4a70 100644 (file)
@@ -35,9 +35,6 @@ final class FlowComparator {
         if (statsFlow == null || storedFlow == null) {
             return false;
         }
-        if (statsFlow.getClass() != storedFlow.getClass()) {
-            return false;
-        }
         if (statsFlow.getContainerName()== null) {
             if (storedFlow.getContainerName()!= null) {
                 return false;
@@ -99,9 +96,6 @@ final class FlowComparator {
         }
         if (storedFlow == null && statsFlow != null) return false;
         if (statsFlow == null && storedFlow != null) return false;
-        if (storedFlow.getClass() != statsFlow.getClass()) {
-            return false;
-        }
         if (storedFlow.getEthernetMatch() == null) {
             if (statsFlow.getEthernetMatch() != null) {
                 return false;
diff --git a/pom.xml b/pom.xml
index f3f777f8570457488bfa21ec19c767218c39fbe1..b81378e33f067d9025ff246a116cc64dd9993fb4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,7 @@
     <module>opendaylight/connectionmanager/api</module>
     <module>opendaylight/connectionmanager/implementation</module>
     <module>opendaylight/security</module>
+    <module>opendaylight/karaf-tomcat-security</module>
 
     <!-- third-parties uncomment them if you need snapshot version of it -->
     <!-- <module>third-party/openflowj</module> -->