Merge "Bug-915: Adding static document generation. Currently the API Explorer can...
authorMoiz Raja <moraja@cisco.com>
Wed, 26 Nov 2014 17:35:38 +0000 (17:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 26 Nov 2014 17:35:38 +0000 (17:35 +0000)
87 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigRegistryClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigRegistryJMXClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigTransactionClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigTransactionJMXClient.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/AttributeEntryTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/ConfigRegistryClientsTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/ConfigTransactionClientsTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/TestingConfigRegistry.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/TestingConfigTransactionController.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/Activator.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigUtil.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigurationLoader.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/LogbackConfigurationLoaderTest.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/TestAppender.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Debugger.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Errorer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Informer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Tracer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Warner.java
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/MockSchemaService.java
opendaylight/md-sal/md-sal-config/src/main/resources/initial/01-md-sal.xml
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/GlobalBundleScanningSchemaServiceImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java
opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointTest.java
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MockSchemaService.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/DefaultCommitNotificationProducer.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListenerFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/CapabilityProvider.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/AdditionalHeaderParserTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSessionTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommitTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchemaTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExiTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryTrackerTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandlerTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITMonitoringTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/SSLUtil.java
opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/Capability.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringServiceTracker.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializer.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/MonitoringSchema.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/MonitoringSession.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/NetconfState.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/package-info.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivatorTest.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationServiceTest.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringServiceTrackerTest.java

index f61094a..b2585ad 100644 (file)
@@ -71,7 +71,7 @@
     <config.configfile.directory>etc/opendaylight/karaf</config.configfile.directory>
     <config.clustering.configfile>05-clustering.xml</config.clustering.configfile>
     <config.netty.configfile>00-netty.xml</config.netty.configfile>
-    <config.mdsal.configfile>01-mdsal.xml</config.mdsal.configfile>
+    <config.mdsal.configfile>01-md-sal.xml</config.mdsal.configfile>
     <config.xsql.configfile>04-xsql.xml</config.xsql.configfile>
     <config.netconf.client.configfile>01-netconf.xml</config.netconf.client.configfile>
     <config.toaster.configfile>03-toaster-sample.xml</config.toaster.configfile>
index 11f64e9..099d010 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.controller.config.util;
 
-import org.opendaylight.controller.config.api.ConflictingVersionException;
-import org.opendaylight.controller.config.api.ValidationException;
-import org.opendaylight.controller.config.api.jmx.CommitStatus;
-import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
 import javax.management.JMException;
@@ -22,10 +20,11 @@ import javax.management.MBeanServer;
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.api.jmx.ServiceReferenceMXBean;
 
 public class ConfigRegistryJMXClient implements ConfigRegistryClient {
index f538142..359035d 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.config.util;
 import javax.management.Attribute;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
index 20e26f6..a0af197 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.util;
 
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.Attribute;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
@@ -18,7 +17,6 @@ import javax.management.JMX;
 import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
index fc1c3f8..d0fcc7b 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
+
 import com.google.common.collect.Sets;
 import java.lang.management.ManagementFactory;
 import java.util.HashMap;
index 2f50513..37b08e4 100644 (file)
@@ -12,16 +12,15 @@ import static org.junit.Assert.assertNull;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 
+import com.google.common.collect.Sets;
 import java.lang.management.ManagementFactory;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.Attribute;
 import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -31,8 +30,6 @@ import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.ValidationException.ExceptionMessageWithStackTrace;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class ConfigTransactionClientsTest {
     private final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
     private TestingConfigTransactionController transactionController;
@@ -156,7 +153,7 @@ public class ConfigTransactionClientsTest {
     @Ignore
     public void testAssertVersion() {
         jmxTransactionClient.assertVersion((int)jmxTransactionClient.getParentVersion(),
-        (int)jmxTransactionClient.getVersion());
+            (int)jmxTransactionClient.getVersion());
     }
 
     @Test(expected = NullPointerException.class)
index 3bc362b..f9d0a5c 100644 (file)
@@ -7,8 +7,20 @@
  */
 package org.opendaylight.controller.config.util;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -17,19 +29,6 @@ import org.opendaylight.controller.config.api.LookupRegistry;
 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 public class LookupTest {
 
     private TestingConfigRegistry testingRegistry;
index ab6cda9..8732aa7 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.config.util;
 
+import com.google.common.collect.Sets;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.ValidationException;
@@ -22,8 +21,6 @@ import org.opendaylight.controller.config.api.jmx.CommitStatus;
 import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class TestingConfigRegistry implements ConfigRegistryMXBean {
 
     static final ObjectName conf1, conf2, conf3, run1, run2, run3;
index ee1e619..e1138ad 100644 (file)
@@ -7,20 +7,17 @@
  */
 package org.opendaylight.controller.config.util;
 
+import com.google.common.collect.Sets;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class TestingConfigTransactionController implements
         ConfigTransactionControllerMXBean {
 
index 99866d5..fa67009 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.logback.config.loader;
 
 import java.io.File;
 import java.util.List;
-
 import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigUtil;
 import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigurationLoader;
 import org.osgi.framework.BundleActivator;
@@ -27,7 +26,7 @@ public class Activator implements BundleActivator {
      * logback configurations
      */
     private static final String LOGBACK_CONFIG_D = "logback.config.d";
-    private static Logger LOG = LoggerFactory.getLogger(Activator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
 
     @Override
     public void start(BundleContext context) {
index 2aa6b1a..accb6e1 100644 (file)
@@ -7,18 +7,16 @@
  */
 package org.opendaylight.controller.logback.config.loader.impl;
 
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.core.joran.spi.JoranException;
+import ch.qos.logback.core.util.StatusPrinter;
 import java.io.File;
 import java.net.URL;
-
 import org.slf4j.ILoggerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.joran.JoranConfigurator;
-import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.util.StatusPrinter;
-
 /**
  * Logback configuration loader.
  * Strategy:
index adbb9f4..44a84b7 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.logback.config.loader.test;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -33,7 +32,7 @@ public class LogbackConfigurationLoaderTest {
 
     /** logback config root */
     private static final String LOGBACK_D = "/logback.d";
-    private static Logger LOG = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(LogbackConfigurationLoaderTest.class);
 
     /**
index b273d27..a950c81 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.controller.logback.config.loader.test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import ch.qos.logback.classic.spi.LoggingEvent;
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.Context;
@@ -17,6 +14,8 @@ import ch.qos.logback.core.LogbackException;
 import ch.qos.logback.core.filter.Filter;
 import ch.qos.logback.core.spi.FilterReply;
 import ch.qos.logback.core.status.Status;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * dummy appender for collecting log messages
index b4876a3..f6f594b 100644 (file)
@@ -8,14 +8,13 @@
 package test.mock.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index 1c0861a..b9159dc 100644 (file)
                         </schema-service>
                     </inmemory-operational-datastore-provider>
                 </module>
+
+                <!-- PingPong broker -->
+                <module>
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong">prefix:pingpong-data-broker</type>
+                    <name>pingpong-data-broker</name>
+                    <data-broker>
+                        <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                        <name>inmemory-data-broker</name>
+                    </data-broker>
+                </module>
+                <module>
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-forwarded-data-broker</type>
+                    <name>pingpong-binding-data-broker</name>
+                    <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+                        <dom-async-broker>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                            <name>pingpong-broker</name>
+                        </dom-async-broker>
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
+                        <binding-mapping-service>
+                            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
+                            <name>runtime-mapping-singleton</name>
+                        </binding-mapping-service>
+                    </binding-forwarded-data-broker>
+                </module>
+
                 <!--
                      Tree-based in-memory data store. This is the data store which is currently
                      recommended for single-node deployments.
                             <name>binding-data-broker</name>
                             <provider>/modules/module[type='binding-forwarded-data-broker'][name='binding-async-data-broker']</provider>
                         </instance>
+                        <instance>
+                            <name>pingpong-binding-data-broker</name>
+                            <provider>/modules/module[type='binding-forwarded-data-broker'][name='pingpong-binding-data-broker']</provider>
+                        </instance>
                     </service>
 
                     <service>
                             <name>inmemory-data-broker</name>
                             <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
                         </instance>
+                        <instance>
+                            <name>pingpong-broker</name>
+                            <provider>/modules/module[type='pingpong-data-broker'][name='pingpong-data-broker']</provider>
+                        </instance>
                     </service>
             </services>
         </data>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&amp;revision=2013-10-28</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong?module=opendaylight-pingpong-broker&amp;revision=2014-11-07</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:config-dom-store?module=opendaylight-config-dom-datastore&amp;revision=2014-06-17</capability>
index f8bc204..d7763d8 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressWarnings("deprecation")
+@Deprecated
 public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDataBroker implements DataProviderService, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(ForwardedBackwardsCompatibleDataBroker.class);
index 356a4b8..8fc60e4 100644 (file)
@@ -8,14 +8,13 @@
 package org.opendaylight.controller.sal.binding.test.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index 60581f9..7940866 100644 (file)
                             org.opendaylight.controller.sal.dom.broker.osgi,
                             org.opendaylight.controller.sal.dom.broker.util,
                             org.opendaylight.controller.config.yang.md.sal.dom.impl,
+                            org.opendaylight.controller.config.yang.md.sal.dom.pingpong,
                             org.opendaylight.controller.config.yang.md.sal.dom.statistics,\
                             org.opendaylight.controller.md.sal.dom.broker.impl,
                             org.opendaylight.controller.md.sal.dom.broker.impl.*,
                             org.opendaylight.yangtools.yang.util,
-                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*</Private-Package>
+                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*,
+                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.pingpong.rev141107.*
+            </Private-Package>
             <Import-Package>*</Import-Package>
           </instructions>
         </configuration>
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java
new file mode 100644 (file)
index 0000000..1664a37
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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.config.yang.md.sal.dom.pingpong;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.md.sal.dom.broker.impl.PingPongDataBroker;
+
+public class PingpongDataBrokerModule extends AbstractPingpongDataBrokerModule {
+    public PingpongDataBrokerModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public PingpongDataBrokerModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final PingpongDataBrokerModule oldModule, final java.lang.AutoCloseable oldInstance) {
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        return new PingPongDataBroker(getDataBrokerDependency());
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java
new file mode 100644 (file)
index 0000000..8ec17fd
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * 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.config.yang.md.sal.dom.pingpong;
+
+public class PingpongDataBrokerModuleFactory extends AbstractPingpongDataBrokerModuleFactory {
+
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java
new file mode 100644 (file)
index 0000000..715a136
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataBroker;
+
+/**
+ * An implementation of a {@link DOMDataBroker}, which forwards most requests to a delegate.
+ *
+ * Its interpretation of the API contract is somewhat looser, specifically it does not
+ * guarantee transaction ordering between transactions allocated directly from the broker
+ * and its transaction chains.
+ */
+public final class PingPongDataBroker extends ForwardingDOMDataBroker implements AutoCloseable {
+    private final DOMDataBroker delegate;
+
+    /**
+     * Instantiate a new broker, backed by the the specified delegate
+     * {@link DOMDataBroker}.
+     *
+     * @param delegate Backend broker, may not be null.
+     */
+    public PingPongDataBroker(final @Nonnull DOMDataBroker delegate) {
+        this.delegate = Preconditions.checkNotNull(delegate);
+    }
+
+    @Override
+    protected DOMDataBroker delegate() {
+        return delegate;
+    }
+
+    @Override
+    public PingPongTransactionChain createTransactionChain(final TransactionChainListener listener) {
+        return new PingPongTransactionChain(delegate, listener);
+    }
+
+    @Override
+    public void close() {
+        // TODO Auto-generated method stub
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java
new file mode 100644 (file)
index 0000000..1dfc607
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.AbstractCheckedFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+
+/**
+ * A {@link Future} used to report the status of an future {@link java.util.concurrent.Future}.
+ */
+final class PingPongFuture extends AbstractCheckedFuture<Void, TransactionCommitFailedException> {
+    protected PingPongFuture(final ListenableFuture<Void> delegate) {
+        super(delegate);
+    }
+
+    @Override
+    protected TransactionCommitFailedException mapException(final Exception e) {
+        Preconditions.checkArgument(e instanceof TransactionCommitFailedException);
+        return (TransactionCommitFailedException) e;
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java
new file mode 100644 (file)
index 0000000..fdb80eb
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+/**
+ * Transaction context. Tracks the relationship with the backend transaction.
+ * We never leak this class to the user and have it implement the {@link FutureCallback}
+ * interface so we have a simple way of propagating the result.
+ */
+final class PingPongTransaction implements FutureCallback<Void> {
+    private final CheckedFuture<Void, TransactionCommitFailedException> submitFuture;
+    private final ListenableFuture<RpcResult<TransactionStatus>> commitFuture;
+    private final DOMDataReadWriteTransaction delegate;
+    private final SettableFuture<Void> future;
+    private DOMDataReadWriteTransaction frontendTransaction;
+
+    PingPongTransaction(final DOMDataReadWriteTransaction delegate) {
+        this.delegate = Preconditions.checkNotNull(delegate);
+        future = SettableFuture.create();
+        submitFuture = new PingPongFuture(future);
+        commitFuture = AbstractDataTransaction.convertToLegacyCommitFuture(submitFuture);
+    }
+
+    DOMDataReadWriteTransaction getTransaction() {
+        return delegate;
+    }
+
+    DOMDataReadWriteTransaction getFrontendTransaction() {
+        return frontendTransaction;
+    }
+
+    CheckedFuture<Void, TransactionCommitFailedException> getSubmitFuture() {
+        return submitFuture;
+    }
+
+    ListenableFuture<RpcResult<TransactionStatus>> getCommitFuture() {
+        return commitFuture;
+    }
+
+    @Override
+    public void onSuccess(final Void result) {
+        future.set(result);
+    }
+
+    @Override
+    public void onFailure(final Throwable t) {
+        future.setException(t);
+    }
+
+    void recordFrontendTransaction(final DOMDataReadWriteTransaction tx) {
+        if (frontendTransaction != null) {
+            frontendTransaction = tx;
+        }
+    }
+
+    @Override
+    public String toString() {
+        return addToStringAttributes(Objects.toStringHelper(this)).toString();
+    }
+
+    protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
+        return toStringHelper.add("delegate", delegate);
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java
new file mode 100644 (file)
index 0000000..83f31b9
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import javax.annotation.concurrent.GuardedBy;
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
+import org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataReadWriteTransaction;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An implementation of {@link DOMTransactionChain}, which has a very specific
+ * behavior, which some users may find surprising. If keeps the general
+ * intent of the contract, but it makes sure there are never more than two
+ * transactions allocated at any given time: one of them is being committed,
+ * and while that is happening, the other one acts as the scratch pad. Once
+ * the committing transaction completes successfully, the scratch transaction
+ * is enqueued as soon as it is ready.
+ *
+ * This mode of operation means that there is no inherent isolation between
+ * the front-end transactions and transactions cannot be reasonably cancelled.
+ *
+ * It furthermore means that the transactions returned by {@link #newReadOnlyTransaction()}
+ * counts as an outstanding transaction and the user may not allocate multiple
+ * read-only transactions at the same time.
+ */
+public final class PingPongTransactionChain implements DOMTransactionChain {
+    private static final Logger LOG = LoggerFactory.getLogger(PingPongTransactionChain.class);
+    private final DOMTransactionChain delegate;
+
+    @GuardedBy("this")
+    private PingPongTransaction bufferTransaction;
+    @GuardedBy("this")
+    private PingPongTransaction inflightTransaction;
+    @GuardedBy("this")
+    private boolean haveLocked;
+    @GuardedBy("this")
+    private boolean failed;
+
+    PingPongTransactionChain(final DOMDataBroker broker, final TransactionChainListener listener) {
+        this.delegate = broker.createTransactionChain(new TransactionChainListener() {
+            @Override
+            public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
+                LOG.debug("Delegate chain {} reported failure in {}", chain, transaction, cause);
+
+                final DOMDataReadWriteTransaction frontend;
+                if (inflightTransaction == null) {
+                    LOG.warn("Transaction chain {} failed with no pending transactions", chain);
+                    frontend = null;
+                } else {
+                    frontend = inflightTransaction.getFrontendTransaction();
+                }
+
+                listener.onTransactionChainFailed(PingPongTransactionChain.this, frontend , cause);
+                delegateFailed();
+            }
+
+            @Override
+            public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
+                listener.onTransactionChainSuccessful(PingPongTransactionChain.this);
+            }
+        });
+    }
+
+    private synchronized void delegateFailed() {
+        failed = true;
+        if (!haveLocked) {
+            processBuffer();
+        }
+    }
+
+    private synchronized PingPongTransaction allocateTransaction() {
+        Preconditions.checkState(!haveLocked, "Attempted to start a transaction while a previous one is still outstanding");
+        Preconditions.checkState(!failed, "Attempted to use a failed chain");
+
+        if (bufferTransaction == null) {
+            bufferTransaction = new PingPongTransaction(delegate.newReadWriteTransaction());
+        }
+
+        haveLocked = true;
+        return bufferTransaction;
+    }
+
+    @GuardedBy("this")
+    private void processBuffer() {
+        final PingPongTransaction tx = bufferTransaction;
+
+        if (tx != null) {
+            if (failed) {
+                LOG.debug("Cancelling transaction {}", tx);
+                tx.getTransaction().cancel();
+                bufferTransaction = null;
+                return;
+            }
+
+            LOG.debug("Submitting transaction {}", tx);
+            final CheckedFuture<Void, ?> f = tx.getTransaction().submit();
+            bufferTransaction = null;
+            inflightTransaction = tx;
+
+            Futures.addCallback(f, new FutureCallback<Void>() {
+                @Override
+                public void onSuccess(final Void result) {
+                    transactionSuccessful(tx, result);
+                }
+
+                @Override
+                public void onFailure(final Throwable t) {
+                    transactionFailed(tx, t);
+                }
+            });
+        }
+    }
+
+    private void transactionSuccessful(final PingPongTransaction tx, final Void result) {
+        LOG.debug("Transaction {} completed successfully", tx);
+
+        synchronized (this) {
+            Preconditions.checkState(inflightTransaction == tx, "Successful transaction %s while %s was submitted", tx, inflightTransaction);
+            inflightTransaction = null;
+
+            if (!haveLocked) {
+                processBuffer();
+            }
+        }
+
+        // Can run unsynchronized
+        tx.onSuccess(result);
+    }
+
+    private void transactionFailed(final PingPongTransaction tx, final Throwable t) {
+        LOG.debug("Transaction {} failed", tx, t);
+
+        synchronized (this) {
+            Preconditions.checkState(inflightTransaction == tx, "Failed transaction %s while %s was submitted", tx, inflightTransaction);
+            inflightTransaction = null;
+        }
+
+        tx.onFailure(t);
+    }
+
+    private synchronized void readyTransaction(final PingPongTransaction tx) {
+        Preconditions.checkState(haveLocked, "Attempted to submit transaction while it is not outstanding");
+        Preconditions.checkState(bufferTransaction == tx, "Attempted to submit transaction %s while we have %s", tx, bufferTransaction);
+
+        haveLocked = false;
+        LOG.debug("Transaction {} unlocked", bufferTransaction);
+
+        if (inflightTransaction == null) {
+            processBuffer();
+        }
+    }
+
+    @Override
+    public synchronized void close() {
+        Preconditions.checkState(!haveLocked, "Attempted to close chain while a transaction is outstanding");
+        processBuffer();
+        delegate.close();
+    }
+
+    @Override
+    public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
+        final PingPongTransaction tx = allocateTransaction();
+
+        return new DOMDataReadOnlyTransaction() {
+            @Override
+            public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
+                    final YangInstanceIdentifier path) {
+                return tx.getTransaction().read(store, path);
+            }
+
+            @Override
+            public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+                    final YangInstanceIdentifier path) {
+                return tx.getTransaction().exists(store, path);
+            }
+
+            @Override
+            public Object getIdentifier() {
+                return tx.getTransaction().getIdentifier();
+            }
+
+            @Override
+            public void close() {
+                readyTransaction(tx);
+            }
+        };
+    }
+
+    @Override
+    public DOMDataReadWriteTransaction newReadWriteTransaction() {
+        final PingPongTransaction tx = allocateTransaction();
+        final DOMDataReadWriteTransaction ret = new ForwardingDOMDataReadWriteTransaction() {
+            @Override
+            protected DOMDataReadWriteTransaction delegate() {
+                return tx.getTransaction();
+            }
+
+            @Override
+            public CheckedFuture<Void, TransactionCommitFailedException> submit() {
+                readyTransaction(tx);
+                return tx.getSubmitFuture();
+            }
+
+            @Override
+            public ListenableFuture<RpcResult<TransactionStatus>> commit() {
+                readyTransaction(tx);
+                return tx.getCommitFuture();
+            }
+
+            @Override
+            public boolean cancel() {
+                throw new UnsupportedOperationException("Transaction cancellation is not supported");
+            }
+        };
+
+        tx.recordFrontendTransaction(ret);
+        return ret;
+    }
+
+    @Override
+    public DOMDataWriteTransaction newWriteOnlyTransaction() {
+        return newReadWriteTransaction();
+    }
+}
index 5c9f5f1..9e1134e 100644 (file)
@@ -61,7 +61,6 @@ import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
 import org.opendaylight.controller.sal.dom.broker.impl.NotificationRouterImpl;
 import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter;
 import org.opendaylight.controller.sal.dom.broker.util.ProxySchemaContext;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -74,6 +73,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 @Deprecated
 public class BackwardsCompatibleMountPoint implements MountProvisionInstance, SchemaContextProvider, SchemaService {
index 4911bfe..68edea7 100644 (file)
@@ -8,26 +8,23 @@
 package org.opendaylight.controller.sal.dom.broker;
 
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
-
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
-
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.opendaylight.yangtools.yang.parser.repo.URLSchemaContextResolver;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
index d7ff8e6..385d400 100644 (file)
@@ -29,7 +29,6 @@ import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
 import org.opendaylight.controller.sal.dom.broker.impl.NotificationRouterImpl;
 import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -38,6 +37,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 @Deprecated
 public class MountPointImpl implements MountProvisionInstance, SchemaContextProvider {
index b4d7d2d..9a3cee7 100644 (file)
@@ -9,18 +9,15 @@ package org.opendaylight.controller.sal.dom.broker.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.base.Preconditions;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
 import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils;
@@ -43,6 +40,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index df985cb..0d1e1af 100644 (file)
@@ -10,10 +10,11 @@ package org.opendaylight.controller.sal.dom.broker.impl;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 public class SchemaContextProviders {
 
-    public static final SchemaContextProvider fromSchemaService(SchemaService schemaService) {
+    public static final SchemaContextProvider fromSchemaService(final SchemaService schemaService) {
         if (schemaService instanceof SchemaContextProvider) {
             return (SchemaContextProvider) schemaService;
         }
@@ -24,7 +25,7 @@ public class SchemaContextProviders {
 
         private final SchemaService service;
 
-        public SchemaServiceAdapter(SchemaService service) {
+        public SchemaServiceAdapter(final SchemaService service) {
             super();
             this.service = service;
         }
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang b/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang
new file mode 100644 (file)
index 0000000..0ed1bbd
--- /dev/null
@@ -0,0 +1,39 @@
+module opendaylight-pingpong-broker {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong";
+    prefix "pingpong";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-dom {prefix sal;}
+    import opendaylight-md-sal-common {prefix common;}
+    import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
+    import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
+
+    description
+        "Service definition for Ping-Pong DOM broker";
+
+    revision "2014-11-07" {
+        description
+            "Initial revision";
+    }
+
+    identity pingpong-data-broker {
+        base config:module-type;
+        config:provided-service sal:dom-async-data-broker;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case pingpong-data-broker {
+            when "/config:modules/config:module/config:type = 'pingpong-data-broker'";
+
+            container data-broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal:dom-async-data-broker;
+                    }
+                }
+            }
+        }
+    }
+}
index f1b7261..fac1c24 100644 (file)
@@ -29,11 +29,11 @@ import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizat
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
 import org.opendaylight.controller.sal.core.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.core.api.data.DataProviderService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index b4876a3..f6f594b 100644 (file)
@@ -8,14 +8,13 @@
 package test.mock.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index 91385ba..13cc973 100644 (file)
@@ -11,25 +11,24 @@ package org.opendaylight.controller.netconf.impl;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
-import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
-import org.opendaylight.controller.netconf.mapping.api.Capability;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.mapping.api.Capability;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CapabilityProviderImpl implements CapabilityProvider {
     private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
     private final Set<String> capabilityURIs;
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CapabilityProviderImpl.class);
 
     public CapabilityProviderImpl(NetconfOperationServiceSnapshot netconfOperationServiceSnapshot) {
         this.netconfOperationServiceSnapshot = netconfOperationServiceSnapshot;
@@ -49,7 +48,7 @@ public class CapabilityProviderImpl implements CapabilityProvider {
             for (Capability cap : caps) {
 
                 if(capabilityMap.containsKey(cap.getCapabilityUri())) {
-                    logger.debug("Duplicate capability {} from service {}", cap.getCapabilityUri(), netconfOperationService);
+                    LOG.debug("Duplicate capability {} from service {}", cap.getCapabilityUri(), netconfOperationService);
                 }
 
                 capabilityMap.put(cap.getCapabilityUri(), cap);
index 203fdf2..ab37bac 100644 (file)
@@ -8,13 +8,7 @@
 
 package org.opendaylight.controller.netconf.impl;
 
-import org.opendaylight.controller.netconf.api.jmx.CommitJMXNotification;
-import org.opendaylight.controller.netconf.api.jmx.DefaultCommitOperationMXBean;
-import org.opendaylight.controller.netconf.api.jmx.NetconfJMXNotification;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-
+import java.util.Set;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanRegistrationException;
@@ -22,12 +16,17 @@ import javax.management.MBeanServer;
 import javax.management.NotCompliantMBeanException;
 import javax.management.NotificationBroadcasterSupport;
 import javax.management.ObjectName;
-import java.util.Set;
+import org.opendaylight.controller.netconf.api.jmx.CommitJMXNotification;
+import org.opendaylight.controller.netconf.api.jmx.DefaultCommitOperationMXBean;
+import org.opendaylight.controller.netconf.api.jmx.NetconfJMXNotification;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
 
 public class DefaultCommitNotificationProducer extends NotificationBroadcasterSupport implements
         DefaultCommitOperationMXBean, AutoCloseable {
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
 
     private final MBeanServer mbeanServer;
 
@@ -35,7 +34,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
 
     public DefaultCommitNotificationProducer(MBeanServer mBeanServer) {
         this.mbeanServer = mBeanServer;
-        logger.debug("Registering to JMX under {}", on);
+        LOG.debug("Registering to JMX under {}", on);
         registerMBean(this, mbeanServer, on);
     }
 
@@ -49,7 +48,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
 
     public void sendCommitNotification(String message, Element cfgSnapshot, Set<String> capabilities) {
         CommitJMXNotification notif = NetconfJMXNotification.afterCommit(this, message, cfgSnapshot, capabilities);
-        logger.debug("Notification about commit {} sent", notif);
+        LOG.debug("Notification about commit {} sent", notif);
         sendNotification(notif);
     }
 
@@ -58,7 +57,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
         try {
             mbeanServer.unregisterMBean(on);
         } catch (InstanceNotFoundException | MBeanRegistrationException e) {
-            logger.warn("Ignoring exception while unregistering {} as {}", this, on, e);
+            LOG.warn("Ignoring exception while unregistering {} as {}", this, on, e);
         }
     }
 }
index 7d40909..ca604a4 100644 (file)
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
 
 public final class NetconfServerSession extends AbstractNetconfSession<NetconfServerSession, NetconfServerSessionListener> implements NetconfManagementSession {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfServerSession.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSession.class);
 
     private final NetconfHelloMessageAdditionalHeader header;
 
@@ -50,7 +50,7 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
             NetconfHelloMessageAdditionalHeader header) {
         super(sessionListener, channel, sessionId);
         this.header = header;
-        logger.debug("Session {} created", toString());
+        LOG.debug("Session {} created", toString());
     }
 
     @Override
@@ -111,9 +111,12 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
 
     private Class<? extends Transport> getTransportForString(String transport) {
         switch(transport) {
-        case "ssh" : return NetconfSsh.class;
-        case "tcp" : return NetconfTcp.class;
-        default: throw new IllegalArgumentException("Unknown transport type " + transport);
+        case "ssh" :
+            return NetconfSsh.class;
+        case "tcp" :
+            return NetconfTcp.class;
+        default:
+            throw new IllegalArgumentException("Unknown transport type " + transport);
         }
     }
 
index 4f2f65c..b2b8c50 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.netconf.impl;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.api.NetconfSessionListener;
@@ -31,7 +30,7 @@ import org.w3c.dom.Node;
 
 public class NetconfServerSessionListener implements NetconfSessionListener<NetconfServerSession> {
 
-    static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionListener.class);
     private final SessionMonitoringService monitoringService;
     private final NetconfOperationRouter operationRouter;
     private final AutoCloseable onSessionDownCloseable;
@@ -50,7 +49,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
     @Override
     public void onSessionDown(NetconfServerSession netconfNetconfServerSession, Exception cause) {
-        logger.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
+        LOG.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
         onDown(netconfNetconfServerSession);
     }
 
@@ -60,19 +59,19 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
         try {
             operationRouter.close();
         } catch (Exception closingEx) {
-            logger.debug("Ignoring exception while closing operationRouter", closingEx);
+            LOG.debug("Ignoring exception while closing operationRouter", closingEx);
         }
         try {
             onSessionDownCloseable.close();
         } catch(Exception ex){
-            logger.debug("Ignoring exception while closing onSessionDownCloseable", ex);
+            LOG.debug("Ignoring exception while closing onSessionDownCloseable", ex);
         }
     }
 
     @Override
     public void onSessionTerminated(NetconfServerSession netconfNetconfServerSession,
             NetconfTerminationReason netconfTerminationReason) {
-        logger.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
+        LOG.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
                 netconfTerminationReason.getErrorMessage());
         onDown(netconfNetconfServerSession);
     }
@@ -86,7 +85,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
             // schemas
             final NetconfMessage message = processDocument(netconfMessage,
                     session);
-            logger.debug("Responding with message {}", XmlUtil.toString(message.getDocument()));
+            LOG.debug("Responding with message {}", XmlUtil.toString(message.getDocument()));
             session.sendMessage(message);
 
             if (isCloseSession(netconfMessage)) {
@@ -95,11 +94,11 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
         } catch (final RuntimeException e) {
             // TODO: should send generic error or close session?
-            logger.error("Unexpected exception", e);
+            LOG.error("Unexpected exception", e);
             session.onIncommingRpcFail();
             throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Error occurred while processing message",e);
+            LOG.trace("Error occurred while processing message",e);
             session.onOutgoingRpcError();
             session.onIncommingRpcFail();
             SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
@@ -109,7 +108,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
     private void closeNetconfSession(NetconfServerSession session) {
         // destroy NetconfOperationService
         session.close();
-        logger.info("Session {} closed successfully", session.getSessionId());
+        LOG.info("Session {} closed successfully", session.getSessionId());
     }
 
 
@@ -148,7 +147,9 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
     }
 
     private void checkMessageId(Node rootNode) throws NetconfDocumentedException {
-            NamedNodeMap attributes = rootNode.getAttributes();
+
+        NamedNodeMap attributes = rootNode.getAttributes();
+
         if(attributes.getNamedItemNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.MESSAGE_ID)!=null) {
             return;
         }
@@ -159,8 +160,9 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
         throw new NetconfDocumentedException("Missing attribute" + rootNode.getNodeName(),
                 NetconfDocumentedException.ErrorType.protocol, NetconfDocumentedException.ErrorTag.missing_attribute,
-                NetconfDocumentedException.ErrorSeverity.error, ImmutableMap.of(NetconfDocumentedException.ErrorTag.missing_attribute.toString(),
-                XmlNetconfConstants.MESSAGE_ID));
+                NetconfDocumentedException.ErrorSeverity.error,
+                ImmutableMap.of(NetconfDocumentedException.ErrorTag.missing_attribute.toString(),
+                        XmlNetconfConstants.MESSAGE_ID));
     }
 
     private static boolean isCloseSession(final NetconfMessage incomingDocument) {
index 34a8bc4..4be8b91 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.controller.netconf.impl;
 
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouterImpl;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
index f7bb281..2f72ad4 100644 (file)
@@ -13,6 +13,10 @@ import io.netty.channel.Channel;
 import io.netty.channel.local.LocalAddress;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.util.AbstractMap;
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSessionNegotiator;
@@ -21,17 +25,12 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.util.AbstractMap;
-import java.util.Map;
-
 public class NetconfServerSessionNegotiator
         extends
         AbstractNetconfSessionNegotiator<NetconfServerSessionPreferences, NetconfServerSession, NetconfServerSessionListener> {
 
-    static final Logger logger = LoggerFactory
-            .getLogger(NetconfServerSessionNegotiator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class);
+    
     private static final String UNKNOWN = "unknown";
 
     protected NetconfServerSessionNegotiator(
@@ -71,7 +70,7 @@ public class NetconfServerSessionNegotiator
 
         }
 
-        logger.debug("Additional header from hello parsed as {} from {}",
+        LOG.debug("Additional header from hello parsed as {} from {}",
                 parsedHeader, additionalHeader);
 
         return new NetconfServerSession(sessionListener, channel,
index 487ffd6..34f4f0e 100644 (file)
@@ -12,9 +12,11 @@ import static org.opendaylight.controller.netconf.mapping.api.NetconfOperationPr
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
-
+import com.google.common.collect.Sets;
+import io.netty.channel.Channel;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.Promise;
 import java.util.Set;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
@@ -26,13 +28,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 import org.opendaylight.protocol.framework.SessionNegotiatorFactory;
-
-import com.google.common.collect.Sets;
-
-import io.netty.channel.Channel;
-import io.netty.util.Timer;
-import io.netty.util.concurrent.Promise;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,7 +46,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     private final long connectionTimeoutMillis;
     private final DefaultCommitNotificationProducer commitNotificationProducer;
     private final SessionMonitoringService monitoringService;
-    private static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
     private final Set<String> baseCapabilities;
 
     // TODO too many params, refactor
@@ -112,7 +107,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
             proposal = new NetconfServerSessionPreferences(
                     createHelloMessage(sessionId, capabilityProvider), sessionId);
         } catch (NetconfDocumentedException e) {
-            logger.error("Unable to create hello mesage for session {} with capability provider {}", sessionId,capabilityProvider);
+            LOG.error("Unable to create hello mesage for session {} with capability provider {}", sessionId,capabilityProvider);
             throw new IllegalStateException(e);
         }
 
index 8b2ca86..2e7acca 100644 (file)
@@ -28,14 +28,14 @@ import org.xml.sax.SAXException;
  * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
  */
 public class SubtreeFilter {
-    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilter.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SubtreeFilter.class);
 
     static Document applySubtreeFilter(Document requestDocument, Document rpcReply) throws NetconfDocumentedException {
         // FIXME: rpcReply document must be reread otherwise some nodes do not inherit namespaces. (services/service)
         try {
             rpcReply = XmlUtil.readXmlToDocument(XmlUtil.toString(rpcReply, true));
         } catch (SAXException | IOException e) {
-            logger.error("Cannot transform document", e);
+            LOG.error("Cannot transform document", e);
             throw new NetconfDocumentedException("Cannot transform document");
         }
 
@@ -49,8 +49,8 @@ public class SubtreeFilter {
                     XmlNetconfConstants.FILTER, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
             if (maybeFilter.isPresent() && (
                     "subtree".equals(maybeFilter.get().getAttribute("type"))||
-                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0))
-            )) {
+                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)))
+            ) {
 
 
                 // do
@@ -160,7 +160,7 @@ public class SubtreeFilter {
         if (result == null) {
             result = MatchingResult.NO_MATCH;
         }
-        logger.debug("Matching {} to {} resulted in {}", src, filter, result);
+        LOG.debug("Matching {} to {} resulted in {}", src, filter, result);
         return result;
     }
 
index b7a98ba..8c7465b 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import com.google.common.base.Optional;
+import java.util.Collections;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
@@ -16,10 +18,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import com.google.common.base.Optional;
-
-import java.util.Collections;
-
 public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
     public static final String CLOSE_SESSION = "close-session";
     private final AutoCloseable sessionResources;
@@ -49,7 +47,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
                     + getNetconfSessionIdForReporting(), NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
                     NetconfDocumentedException.ErrorSeverity.error, Collections.singletonMap(
-                    NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage()));
+                        NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage()));
         }
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
     }
index 67b782c..fbe855f 100644 (file)
@@ -9,12 +9,12 @@
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
 import com.google.common.base.Preconditions;
-
+import java.io.InputStream;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation;
@@ -25,11 +25,9 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.io.InputStream;
-
 public class DefaultCommit extends AbstractNetconfOperation {
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommit.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultCommit.class);
 
     private static final String NOTIFY_ATTR = "notify";
 
@@ -69,12 +67,12 @@ public class DefaultCommit extends AbstractNetconfOperation {
                 "Subsequent netconf operation expected by %s", this);
 
         if (isCommitWithoutNotification(requestMessage)) {
-            logger.debug("Skipping commit notification");
+            LOG.debug("Skipping commit notification");
         } else {
             // Send commit notification if commit was not issued by persister
             removePersisterAttributes(requestMessage);
             Element cfgSnapshot = getConfigSnapshot(operationRouter);
-            logger.debug("Config snapshot retrieved successfully {}", cfgSnapshot);
+            LOG.debug("Config snapshot retrieved successfully {}", cfgSnapshot);
             notificationProducer.sendCommitNotification("ok", cfgSnapshot, cap.getCapabilities());
         }
 
@@ -101,7 +99,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
             xmlElement = XmlElement.fromDomElementWithExpected(message.getDocumentElement(),
                     XmlNetconfConstants.RPC_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Commit operation is not valid due to  {}",e);
+            LOG.trace("Commit operation is not valid due to ",e);
             return false;
         }
 
@@ -110,7 +108,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
         if (attr == null || attr.equals("")){
             return false;
         } else if (attr.equals(Boolean.toString(false))) {
-            logger.debug("Commit operation received with notify=false attribute {}", message);
+            LOG.debug("Commit operation received with notify=false attribute {}", message);
             return true;
         } else {
             return false;
index 6db74ea..5310704 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.netconf.impl.mapping.operations;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Maps;
-
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
@@ -23,14 +23,12 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.Map;
-
 public final class DefaultGetSchema extends AbstractLastNetconfOperation {
     public static final String GET_SCHEMA = "get-schema";
     public static final String IDENTIFIER = "identifier";
     public static final String VERSION = "version";
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultGetSchema.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultGetSchema.class);
     private final CapabilityProvider cap;
 
     public DefaultGetSchema(CapabilityProvider cap, String netconfSessionIdForReporting) {
@@ -60,7 +58,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
         } catch (IllegalStateException e) {
             Map<String, String> errorInfo = Maps.newHashMap();
             errorInfo.put(entry.identifier, e.getMessage());
-            logger.warn("Rpc error: {}", NetconfDocumentedException.ErrorTag.operation_failed, e);
+            LOG.warn("Rpc error: {}", NetconfDocumentedException.ErrorTag.operation_failed, e);
             throw new NetconfDocumentedException(e.getMessage(), NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
                     NetconfDocumentedException.ErrorSeverity.error, errorInfo);
@@ -69,7 +67,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
         Element getSchemaResult;
         getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema,
                 Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING));
-        logger.trace("{} operation successful", GET_SCHEMA);
+        LOG.trace("{} operation successful", GET_SCHEMA);
 
         return getSchemaResult;
     }
@@ -86,7 +84,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
             try {
                 identifierElement = getSchemaElement.getOnlyChildElementWithSameNamespace(IDENTIFIER);
             } catch (MissingNameSpaceException e) {
-                logger.trace("Can't get identifier element as only child element with same namespace due to {}",e);
+                LOG.trace("Can't get identifier element as only child element with same namespace due to ",e);
                 throw NetconfDocumentedException.wrap(e);
             }
             identifier = identifierElement.getTextContent();
index 6de185a..3f0ae27 100644 (file)
@@ -11,8 +11,8 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType;
-import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.impl.NetconfServerSession;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
@@ -25,7 +25,7 @@ import org.w3c.dom.Element;
 public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
     public static final String START_EXI = "start-exi";
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultStartExi.class);
     private NetconfServerSession netconfSession;
 
     public DefaultStartExi(String netconfSessionIdForReporting) {
@@ -35,7 +35,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     @Override
     public Document handle(Document message,
                            NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
-        logger.debug("Received start-exi message {} ", XmlUtil.toString(message));
+        LOG.debug("Received start-exi message {} ", XmlUtil.toString(message));
 
         try {
             netconfSession.startExiCommunication(new NetconfMessage(message));
@@ -50,7 +50,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     @Override
     protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
         Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
-        logger.trace("{} operation successful", START_EXI);
+        LOG.trace("{} operation successful", START_EXI);
         return getSchemaResult;
     }
 
index 233638d..2b90a61 100644 (file)
@@ -23,8 +23,8 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
     public static final String STOP_EXI = "stop-exi";
     private NetconfServerSession netconfSession;
 
-    private static final Logger logger = LoggerFactory
-            .getLogger(DefaultStartExi.class);
+    private static final Logger LOG = LoggerFactory
+            .getLogger(DefaultStopExi.class);
 
     public DefaultStopExi(String netconfSessionIdForReporting) {
         super(netconfSessionIdForReporting);
@@ -32,12 +32,12 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
 
     @Override
     protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
-        logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
+        LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
 
         netconfSession.stopExiCommunication();
 
         Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
-        logger.trace("{} operation successful", STOP_EXI);
+        LOG.trace("{} operation successful", STOP_EXI);
         return getSchemaResult;
     }
 
index 6ab62ef..27423c0 100644 (file)
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfImplActivator implements BundleActivator {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfImplActivator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfImplActivator.class);
 
     private NetconfOperationServiceFactoryTracker factoriesTracker;
     private DefaultCommitNotificationProducer commitNot;
@@ -62,7 +62,7 @@ public class NetconfImplActivator implements BundleActivator {
         NetconfServerDispatcher dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup);
 
         LocalAddress address = NetconfConfigUtil.getNetconfLocalAddress();
-        logger.trace("Starting local netconf server at {}", address);
+        LOG.trace("Starting local netconf server at {}", address);
         dispatch.createLocalServer(address);
 
         context.registerService(NetconfOperationProvider.class, factoriesListener, null);
@@ -84,7 +84,7 @@ public class NetconfImplActivator implements BundleActivator {
 
     @Override
     public void stop(final BundleContext context) {
-        logger.info("Shutting down netconf because YangStoreService service was removed");
+        LOG.info("Shutting down netconf because YangStoreService service was removed");
 
         commitNot.close();
         eventLoopGroup.shutdownGracefully(0, 1, TimeUnit.SECONDS);
index 2a45e17..3f44ff4 100644 (file)
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, SessionMonitoringService {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class);
 
     private final Set<NetconfManagementSession> sessions = new ConcurrentSet<>();
     private final NetconfOperationProvider netconfOperationProvider;
@@ -49,14 +49,14 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S
 
     @Override
     public void onSessionUp(NetconfManagementSession session) {
-        logger.debug("Session {} up", session);
+        LOG.debug("Session {} up", session);
         Preconditions.checkState(!sessions.contains(session), "Session %s was already added", session);
         sessions.add(session);
     }
 
     @Override
     public void onSessionDown(NetconfManagementSession session) {
-        logger.debug("Session {} down", session);
+        LOG.debug("Session {} down", session);
         Preconditions.checkState(sessions.contains(session), "Session %s not present", session);
         sessions.remove(session);
     }
index aa59060..6915ee4 100644 (file)
@@ -10,6 +10,12 @@ package org.opendaylight.controller.netconf.impl.osgi;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer;
 import org.opendaylight.controller.netconf.impl.NetconfServerSession;
@@ -30,16 +36,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Set;
-import java.util.TreeMap;
-
 public class NetconfOperationRouterImpl implements NetconfOperationRouter {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfOperationRouterImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfOperationRouterImpl.class);
 
     private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
     private Set<NetconfOperation> allNetconfOperations;
@@ -104,7 +103,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
             messageAsString = XmlUtil.toString(message);
             netconfOperationExecution = getNetconfOperationWithHighestPriority(message, session);
         } catch (IllegalArgumentException | IllegalStateException e) {
-            logger.warn("Unable to handle rpc {} on session {}", messageAsString, session, e);
+            LOG.warn("Unable to handle rpc {} on session {}", messageAsString, session, e);
 
             String errorMessage = String.format("Unable to handle rpc %s on session %s", messageAsString, session);
             Map<String, String> errorInfo = Maps.newHashMap();
@@ -137,7 +136,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     }
 
     private NetconfDocumentedException handleUnexpectedEx(String s, Exception e) throws NetconfDocumentedException {
-        logger.error(s, e);
+        LOG.error(s, e);
 
         Map<String, String> info = Maps.newHashMap();
         info.put(NetconfDocumentedException.ErrorSeverity.error.toString(), e.toString());
@@ -150,7 +149,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     private Document executeOperationWithHighestPriority(Document message,
             NetconfOperationExecution netconfOperationExecution, String messageAsString)
             throws NetconfDocumentedException {
-        logger.debug("Forwarding netconf message {} to {}", messageAsString, netconfOperationExecution.netconfOperation);
+        LOG.debug("Forwarding netconf message {} to {}", messageAsString, netconfOperationExecution.netconfOperation);
         return netconfOperationExecution.execute(message);
     }
 
index 63cd0ba..6c55c35 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.netconf.impl.osgi;
 
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
-
 import java.util.HashSet;
 import java.util.Set;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 
 public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperationServiceFactoryListener,
         NetconfOperationProvider {
index ce31254..1a35e4d 100644 (file)
@@ -8,15 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
 import org.opendaylight.controller.netconf.util.CloseableUtil;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
 public class NetconfOperationServiceSnapshotImpl implements NetconfOperationServiceSnapshot {
 
     private final Set<NetconfOperationService> services;
index 31c4d4f..e336914 100644 (file)
@@ -11,18 +11,15 @@ package org.opendaylight.controller.netconf.impl.util;
 import com.google.common.collect.Maps;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Map;
-
-public final class
-        DeserializerExceptionHandler implements ChannelHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
+public final class DeserializerExceptionHandler implements ChannelHandler {
 
+    private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
 
     @Override
     public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
@@ -36,7 +33,7 @@ public final class
 
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-        logger.warn("An exception occurred during message handling", cause);
+        LOG.warn("An exception occurred during message handling", cause);
         handleDeserializerException(ctx, cause);
     }
 
index 5f8bc06..3b83daa 100644 (file)
@@ -18,13 +18,11 @@ import static org.mockito.Mockito.mock;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
-
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.concurrent.GlobalEventExecutor;
-
 import java.io.DataOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -42,7 +40,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicLong;
-
 import org.apache.commons.io.IOUtils;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -57,9 +54,9 @@ import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.client.NetconfClientDispatcher;
 import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
 import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
+import org.opendaylight.controller.netconf.client.TestingNetconfClient;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
-import org.opendaylight.controller.netconf.client.TestingNetconfClient;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.mapping.api.Capability;
@@ -80,7 +77,7 @@ import org.w3c.dom.Document;
 
 @RunWith(Parameterized.class)
 public class ConcurrentClientsTest {
-    private static final Logger logger = LoggerFactory.getLogger(ConcurrentClientsTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConcurrentClientsTest.class);
 
     private static ExecutorService clientExecutor;
 
@@ -99,16 +96,14 @@ public class ConcurrentClientsTest {
 
     @Parameterized.Parameters()
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][]{
-                {4, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
-                {1, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
-                // empty set of capabilities = only base 1.0 netconf capability
-                {4, TestingNetconfClientRunnable.class, Collections.emptySet()},
-                {4, TestingNetconfClientRunnable.class, getOnlyExiServerCaps()},
-                {4, TestingNetconfClientRunnable.class, getOnlyChunkServerCaps()},
-
-                {4, BlockingClientRunnable.class, getOnlyExiServerCaps()},
-                {1, BlockingClientRunnable.class, getOnlyExiServerCaps()},
+        return Arrays.asList(new Object[][]{{4, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
+                                            {1, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
+                                            // empty set of capabilities = only base 1.0 netconf capability
+                                            {4, TestingNetconfClientRunnable.class, Collections.emptySet()},
+                                            {4, TestingNetconfClientRunnable.class, getOnlyExiServerCaps()},
+                                            {4, TestingNetconfClientRunnable.class, getOnlyChunkServerCaps()},
+                                            {4, BlockingClientRunnable.class, getOnlyExiServerCaps()},
+                                            {1, BlockingClientRunnable.class, getOnlyExiServerCaps()},
         });
     }
 
@@ -174,7 +169,7 @@ public class ConcurrentClientsTest {
         try {
             nettyGroup.shutdownGracefully().get();
         } catch (InterruptedException | ExecutionException e) {
-            logger.warn("Ignoring exception while cleaning up after test", e);
+            LOG.warn("Ignoring exception while cleaning up after test", e);
         }
     }
 
@@ -198,7 +193,7 @@ public class ConcurrentClientsTest {
             } catch (InterruptedException e) {
                 throw new IllegalStateException(e);
             } catch (ExecutionException e) {
-                logger.error("Thread for testing client failed", e);
+                LOG.error("Thread for testing client failed", e);
                 fail("Client failed: " + e.getMessage());
             }
         }
@@ -241,7 +236,7 @@ public class ConcurrentClientsTest {
         @Override
         public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
             try {
-                logger.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
+                LOG.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
                 counter.getAndIncrement();
                 return XmlUtil.readXmlToDocument("<test/>");
             } catch (Exception e) {
@@ -310,7 +305,7 @@ public class ConcurrentClientsTest {
             while (sb.toString().endsWith("]]>]]>") == false) {
                 sb.append((char) inFromServer.read());
             }
-            logger.info(sb.toString());
+            LOG.info(sb.toString());
 
             outToServer.write(IOUtils.toByteArray(clientHello));
             outToServer.write("]]>]]>".getBytes());
@@ -324,7 +319,7 @@ public class ConcurrentClientsTest {
             while (sb.toString().endsWith("]]>]]>") == false) {
                 sb.append((char) inFromServer.read());
             }
-            logger.info(sb.toString());
+            LOG.info(sb.toString());
             clientSocket.close();
         }
     }
@@ -340,19 +335,19 @@ public class ConcurrentClientsTest {
                 final TestingNetconfClient netconfClient =
                         new TestingNetconfClient(Thread.currentThread().getName(), netconfClientDispatcher, getClientConfig());
                 long sessionId = netconfClient.getSessionId();
-                logger.info("Client with session id {}: hello exchanged", sessionId);
+                LOG.info("Client with session id {}: hello exchanged", sessionId);
 
                 final NetconfMessage getMessage = XmlFileLoader
                         .xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
                 NetconfMessage result = netconfClient.sendRequest(getMessage).get();
-                logger.info("Client with session id {}: got result {}", sessionId, result);
+                LOG.info("Client with session id {}: got result {}", sessionId, result);
 
                 Preconditions.checkState(NetconfMessageUtil.isErrorMessage(result) == false,
                         "Received error response: " + XmlUtil.toString(result.getDocument()) + " to request: "
                                 + XmlUtil.toString(getMessage.getDocument()));
 
                 netconfClient.close();
-                logger.info("Client with session id {}: ended", sessionId);
+                LOG.info("Client with session id {}: ended", sessionId);
             } catch (final Exception e) {
                 throw new IllegalStateException(Thread.currentThread().getName(), e);
             }
index 42bd033..ecc33ca 100644 (file)
@@ -12,14 +12,13 @@ import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
+import java.lang.management.ManagementFactory;
+import java.net.InetSocketAddress;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
 
-import java.lang.management.ManagementFactory;
-import java.net.InetSocketAddress;
-
 public class NetconfDispatcherImplTest {
 
     private EventLoopGroup nettyGroup;
index 2125035..395e5c0 100644 (file)
@@ -8,6 +8,17 @@
 
 package org.opendaylight.controller.netconf.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
@@ -18,8 +29,6 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession;
-import org.opendaylight.controller.netconf.impl.NetconfServerSession;
-import org.opendaylight.controller.netconf.impl.NetconfServerSessionListener;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl;
 import org.opendaylight.controller.netconf.mapping.api.Capability;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
@@ -27,11 +36,6 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
 public class NetconfMonitoringServiceImplTest {
 
     private NetconfMonitoringServiceImpl service;
index 51dfa4b..b925295 100644 (file)
@@ -29,7 +29,7 @@ import org.xml.sax.SAXException;
 
 @RunWith(value = Parameterized.class)
 public class SubtreeFilterTest {
-    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilterTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SubtreeFilterTest.class);
 
     private final int directoryIndex;
 
@@ -57,7 +57,7 @@ public class SubtreeFilterTest {
         Document preFilterDocument = getDocument("pre-filter.xml");
         Document postFilterDocument = getDocument("post-filter.xml");
         Document actualPostFilterDocument = SubtreeFilter.applySubtreeFilter(requestDocument, preFilterDocument);
-        logger.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
+        LOG.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
         Diff diff = XMLUnit.compareXML(postFilterDocument, actualPostFilterDocument);
         assertTrue(diff.toString(), diff.similar());
 
index d6b0201..d82c148 100644 (file)
@@ -8,14 +8,15 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
 
 public class DefaultCloseSessionTest {
     @Test
index 98050de..15aeb8d 100644 (file)
@@ -8,6 +8,16 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anySetOf;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import com.google.common.collect.Sets;
 import org.junit.Before;
 import org.junit.Test;
@@ -22,8 +32,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import static org.mockito.Mockito.*;
-
 public class DefaultCommitTest {
 
     private NetconfOperationChainedExecution operation;
index b335165..c06e78a 100644 (file)
@@ -8,6 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -17,9 +25,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.*;
-
 public class DefaultStopExiTest {
     @Test
     public void testHandleWithNoSubsequentOperations() throws Exception {
index fd9295a..413c9cc 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import java.util.Arrays;
 import java.util.Dictionary;
 import org.junit.Before;
@@ -20,13 +27,6 @@ import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
 public class NetconfImplActivatorTest {
 
     @Mock
index 0d7158a..d744504 100644 (file)
@@ -8,6 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -17,10 +25,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
 
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.*;
-
 public class NetconfOperationServiceFactoryTrackerTest {
 
     @Mock
index 6512b4b..946654e 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.impl.util;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
@@ -15,8 +22,6 @@ import io.netty.util.concurrent.GenericFutureListener;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.mockito.Mockito.*;
-
 public class DeserializerExceptionHandlerTest {
 
     private DeserializerExceptionHandler handler;
index bd931c3..a724d1d 100644 (file)
@@ -78,9 +78,11 @@ public abstract class AbstractNetconfConfigTest extends AbstractConfigTest {
     public static final String LOOPBACK_ADDRESS = "127.0.0.1";
     public static final int SERVER_CONNECTION_TIMEOUT_MILLIS = 5000;
 
-    static ModuleFactory[] FACTORIES = { new TestImplModuleFactory(),
-            new DepTestImplModuleFactory(), new NetconfTestImplModuleFactory(),
-            new IdentityTestModuleFactory(), new MultipleDependenciesModuleFactory() };
+    static ModuleFactory[] FACTORIES = {new TestImplModuleFactory(),
+                                        new DepTestImplModuleFactory(),
+                                        new NetconfTestImplModuleFactory(),
+                                        new IdentityTestModuleFactory(),
+                                        new MultipleDependenciesModuleFactory() };
 
     private EventLoopGroup nettyThreadgroup;
     private HashedWheelTimer hashedWheelTimer;
index a9558c0..463b5f0 100644 (file)
@@ -72,17 +72,17 @@ public class NetconfITMonitoringTest extends AbstractNetconfConfigTest {
         return TCP_ADDRESS;
     }
 
-    static SessionMonitoringService getNetconfMonitoringListenerService(final Logger logger, final NetconfMonitoringServiceImpl monitor) {
+    static SessionMonitoringService getNetconfMonitoringListenerService(final Logger LOG, final NetconfMonitoringServiceImpl monitor) {
         return new SessionMonitoringService() {
             @Override
             public void onSessionUp(final NetconfManagementSession session) {
-                logger.debug("Management session up {}", session);
+                LOG.debug("Management session up {}", session);
                 monitor.onSessionUp(session);
             }
 
             @Override
             public void onSessionDown(final NetconfManagementSession session) {
-                logger.debug("Management session down {}", session);
+                LOG.debug("Management session down {}", session);
                 monitor.onSessionDown(session);
             }
         };
index f76bf4f..56015b9 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.netconf.it;
 
+import com.google.common.base.Preconditions;
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.KeyManagementException;
@@ -15,13 +16,10 @@ import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.UnrecoverableKeyException;
 import java.security.cert.CertificateException;
-
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManagerFactory;
 
-import com.google.common.base.Preconditions;
-
 public final class SSLUtil {
 
     private SSLUtil() {}
index 3b3f71b..6ab3cd4 100644 (file)
@@ -24,7 +24,7 @@ import org.w3c.dom.Element;
 
 public class Get extends AbstractNetconfOperation {
 
-    private static final Logger logger = LoggerFactory.getLogger(Get.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Get.class);
     private final NetconfMonitoringService netconfMonitor;
 
     public Get(final NetconfMonitoringService netconfMonitor) {
@@ -72,7 +72,7 @@ public class Get extends AbstractNetconfOperation {
             return innerResult;
         } catch (final RuntimeException e) {
             final String errorMessage = "Get operation for netconf-state subtree failed";
-            logger.warn(errorMessage, e);
+            LOG.warn(errorMessage, e);
 
             throw new NetconfDocumentedException(errorMessage, NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
index 9d332c6..1411350 100644 (file)
@@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringActivator implements BundleActivator {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringActivator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringActivator.class);
 
     private NetconfMonitoringServiceTracker monitor;
 
@@ -32,7 +32,7 @@ public class NetconfMonitoringActivator implements BundleActivator {
             try {
                 monitor.close();
             } catch (Exception e) {
-                logger.warn("Ignoring exception while closing {}", monitor, e);
+                LOG.warn("Ignoring exception while closing {}", monitor, e);
             }
         }
     }
index f99ae54..0b4d1c2 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringServiceTracker extends ServiceTracker<NetconfMonitoringService, NetconfMonitoringService> {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringServiceTracker.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringServiceTracker.class);
 
     private ServiceRegistration<NetconfOperationServiceFactory> reg;
 
@@ -51,7 +51,7 @@ public class NetconfMonitoringServiceTracker extends ServiceTracker<NetconfMonit
             try {
                 reg.unregister();
             } catch (final Exception e) {
-                logger.warn("Ignoring exception while unregistering {}", reg, e);
+                LOG.warn("Ignoring exception while unregistering {}", reg, e);
             }
         }
     }
index 962ad17..45f02af 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.netconf.monitoring.xml;
 
-import org.opendaylight.controller.netconf.monitoring.xml.model.NetconfState;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.transform.dom.DOMResult;
+import org.opendaylight.controller.netconf.monitoring.xml.model.NetconfState;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 public class JaxBSerializer {
 
@@ -29,7 +28,7 @@ public class JaxBSerializer {
             res = new DOMResult();
             marshaller.marshal(monitoringModel, res);
         } catch (final JAXBException e) {
-           throw new RuntimeException("Unable to serialize netconf state " + monitoringModel, e);
+            throw new RuntimeException("Unable to serialize netconf state " + monitoringModel, e);
         }
         return ((Document)res.getNode()).getDocumentElement();
     }
index 16b38ec..259fd73 100644 (file)
@@ -11,13 +11,12 @@ package org.opendaylight.controller.netconf.monitoring.xml.model;
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Collections2;
+import java.util.Collection;
 import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
-
 import javax.annotation.Nullable;
 import javax.xml.bind.annotation.XmlElement;
-import java.util.Collection;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 
 final class MonitoringSchema {
 
index 8685ef7..c70db89 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.controller.netconf.monitoring.xml.model;
 
+import com.google.common.base.Joiner;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlTransient;
-
-import com.google.common.base.Joiner;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210.Session1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
index 8f5a1c0..58f5b18 100644 (file)
@@ -9,6 +9,11 @@ package org.opendaylight.controller.netconf.monitoring.xml.model;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
+import java.util.Collection;
+import javax.annotation.Nullable;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
@@ -16,12 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.mon
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 
-import javax.annotation.Nullable;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Collection;
-
 @XmlRootElement(name = MonitoringConstants.NETCONF_MONITORING_XML_ROOT_ELEMENT)
 public final class NetconfState {
 
index a96c3a3..1e510d4 100644 (file)
@@ -15,8 +15,7 @@
 )
 package org.opendaylight.controller.netconf.monitoring.xml.model;
 
-import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
-
 import javax.xml.bind.annotation.XmlNs;
 import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
\ No newline at end of file
+import javax.xml.bind.annotation.XmlSchema;
+import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
\ No newline at end of file
index b8e35e9..74e6747 100644 (file)
@@ -8,14 +8,14 @@
 
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
 public class NetconfMonitoringOperationServiceTest {
     @Test
     public void testGetters() throws Exception {
index b992b0e..de716cc 100644 (file)
@@ -9,11 +9,12 @@
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import java.util.Hashtable;
 import org.junit.Before;
 import org.junit.Test;

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