Merge "Clean-up mdsal-netconf-connector"
authorTomas Cere <tcere@cisco.com>
Thu, 22 Sep 2016 08:28:01 +0000 (08:28 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 22 Sep 2016 08:28:01 +0000 (08:28 +0000)
16 files changed:
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/Commit.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/DiscardChanges.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/Lock.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/UnLock.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/Validate.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/editconfig/EditConfig.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/getconfig/GetConfig.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/osgi/NetconfOperationProvider.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/osgi/NetconfOperationServiceFactoryImpl.java
netconf/config-netconf-connector/src/main/java/org/opendaylight/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java
netconf/models/ietf-netconf-monitoring-extension/pom.xml
netconf/models/ietf-netconf-monitoring/pom.xml
netconf/models/ietf-netconf-notifications/pom.xml
netconf/models/ietf-netconf-notifications/src/main/yang/nc-notifications@2008-07-14.yang
netconf/models/ietf-netconf/pom.xml

index d49bb901aadeea2d75b31a607454c10689e1c81f..176d3e26ec48ce2a342026550358fc08622434f6 100644 (file)
@@ -54,7 +54,7 @@ public class Commit extends AbstractConfigNetconfOperation {
         }
         LOG.trace("Datastore {} committed successfully: {}", Datastore.candidate, status);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
 }
index 3b6cb0eb1ea0cc725bbdef7117e3dcba5a10ddb4..41492107c3cfdbcdbc8463e49ba0d84091b4e161 100644 (file)
@@ -63,6 +63,6 @@ public class DiscardChanges extends AbstractConfigNetconfOperation {
         LOG.trace("Changes discarded successfully from datastore {}", Datastore.candidate);
 
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 }
index 505678995c010f581323e614d5a34298fee1f77b..d031c9e30c6df853ae63239814ffa05c9a6824fd 100644 (file)
@@ -42,7 +42,7 @@ public class Lock extends AbstractLastNetconfOperation {
             // Since candidate datastore instances are allocated per session and not accessible anywhere else, no need to lock
             LOG.debug("Locking {} datastore on session: {}", targetDatastore, getNetconfSessionIdForReporting());
             // TODO should this fail if we are already locked ?
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         // Not supported running lock
index 987c3c166f872a9b1eea212260157253e7ad2633..e58a41abcb304e1e5a211b1e7cef05d9eccd2268 100644 (file)
@@ -41,7 +41,7 @@ public class UnLock extends AbstractLastNetconfOperation {
             // Since candidate datastore instances are allocated per session and not accessible anywhere else, no need to lock
             LOG.debug("Unlocking {} datastore on session: {}", targetDatastore, getNetconfSessionIdForReporting());
             // TODO this should fail if we are not locked
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         // Not supported running lock
index 8a94fffd7f0b6dfadaa05faa06a2a5245fdbc9d4..c5fdcdaa61064264b6ef535eaa62d57416a67ee4 100644 (file)
@@ -80,6 +80,6 @@ public class Validate extends AbstractConfigNetconfOperation {
 
         LOG.trace("Datastore {} validated successfully", Datastore.candidate);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 }
index e00f258630f63baef84b8adf51099684652a519b..851bce79d100da2be6af6aedc91de0183b6d26b8 100644 (file)
@@ -33,7 +33,7 @@ public class EditConfig extends AbstractConfigNetconfOperation {
 
     private static final Logger LOG = LoggerFactory.getLogger(EditConfig.class);
 
-    private EditConfigXmlParser editConfigXmlParser;
+    private final EditConfigXmlParser editConfigXmlParser;
 
     public EditConfig(final ConfigSubsystemFacade configSubsystemFacade, final String netconfSessionIdForReporting) {
         super(configSubsystemFacade, netconfSessionIdForReporting);
@@ -66,11 +66,10 @@ public class EditConfig extends AbstractConfigNetconfOperation {
 
     @Override
     protected Element handleWithNoSubsequentOperations(Document document, XmlElement xml) throws DocumentedException {
-        ConfigExecution configExecution;
         // FIXME config mapping getter works on dynamic yang store service and so does later executeConfigExecution method
         // They might have different view of current yangs in ODL and might cause race conditions
         Config cfg = getConfigSubsystemFacade().getConfigMapping();
-        configExecution = editConfigXmlParser.fromXml(xml, cfg);
+        ConfigExecution configExecution = editConfigXmlParser.fromXml(xml, cfg);
 
         return getResponseInternal(document, configExecution);
     }
index ac7d70ebeb39e1a86f4f7b5b17c5b0843c37d0c3..d7e3061cc37da0406b240fdd186cc7cdb0745381 100644 (file)
@@ -43,11 +43,10 @@ public class GetConfig extends AbstractConfigNetconfOperation {
         XmlElement sourceNode = sourceElement.getOnlyChildElement();
         String sourceParsed = sourceNode.getName();
         LOG.debug("Setting source datastore to '{}'", sourceParsed);
-        Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
 
         // Filter option: ignore for now, TODO only load modules specified by the filter
 
-        return sourceDatastore;
+        return Datastore.valueOf(sourceParsed);
 
     }
 
index 2c6bdcbc9134a4a05bea0550ae5ff9b1a2a232c0..b8d5b58a2d4f55f7b4de8504a77fa2f72fd969bb 100644 (file)
@@ -38,8 +38,7 @@ public class RuntimeRpc extends AbstractConfigNetconfOperation {
 
     @Override
     public HandlingPriority canHandle(Document message) throws DocumentedException {
-        XmlElement requestElement = null;
-        requestElement = getRequestElementWithCheck(message);
+        XmlElement requestElement = getRequestElementWithCheck(message);
 
         XmlElement operationElement = requestElement.getOnlyChildElement();
         final String netconfOperationName = operationElement.getName();
@@ -102,7 +101,7 @@ public class RuntimeRpc extends AbstractConfigNetconfOperation {
                 execution.getOn(), execution.getAttributes(), result);
 
         if (execution.isVoid()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         } else {
             return getConfigSubsystemFacade().getRpcFacade().toXml(document, result, execution);
         }
index 873d1a1a713c540f286dabe5a3e3634fe991c327..6f0a448dd213168e8a253ca833a30700c9c03514 100644 (file)
@@ -39,7 +39,7 @@ final class NetconfOperationProvider {
             String netconfSessionIdForReporting) {
         Set<NetconfOperation> ops = Sets.newHashSet();
 
-        GetConfig getConfigOp = new GetConfig(configSubsystemFacade, Optional.<String> absent(), netconfSessionIdForReporting);
+        GetConfig getConfigOp = new GetConfig(configSubsystemFacade, Optional.absent(), netconfSessionIdForReporting);
 
         ops.add(getConfigOp);
         ops.add(new EditConfig(configSubsystemFacade, netconfSessionIdForReporting));
index 5e3051274e3eaabfac19f8c2e04df379bec35bf1..01405d447ea046997753ea0df61507c8ed6b7557 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.confignetconfconnector.osgi;
 import java.util.Set;
 import org.opendaylight.controller.config.facade.xml.ConfigSubsystemFacadeFactory;
 import org.opendaylight.controller.config.util.capability.Capability;
-import org.opendaylight.controller.config.util.capability.ModuleListener;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 
@@ -35,11 +34,6 @@ public class NetconfOperationServiceFactoryImpl implements NetconfOperationServi
 
     @Override
     public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-        return configFacadeFactory.getYangStoreService().registerModuleListener(new ModuleListener() {
-            @Override
-            public void onCapabilitiesChanged(Set<Capability> added, Set<Capability> removed) {
-                listener.onCapabilitiesChanged(added, removed);
-            }
-        });
+        return configFacadeFactory.getYangStoreService().registerModuleListener(listener::onCapabilitiesChanged);
     }
 }
index 602deae6b457f67ff87f4edc9b6728da46ffb263..37a744bff80e7f4aaf88f56676d319598e4bebb1 100644 (file)
@@ -16,12 +16,12 @@ import org.opendaylight.netconf.mapping.api.NetconfOperationService;
 public class NetconfOperationServiceImpl implements NetconfOperationService {
 
     private final NetconfOperationProvider operationProvider;
-    private ConfigSubsystemFacade configSubsystemFacade;
+    private final ConfigSubsystemFacade configSubsystemFacade;
 
     public NetconfOperationServiceImpl(final ConfigSubsystemFacade configSubsystemFacade,
             final String netconfSessionIdForReporting) {
         this.configSubsystemFacade = configSubsystemFacade;
-        operationProvider = new NetconfOperationProvider(configSubsystemFacade, netconfSessionIdForReporting);
+        this.operationProvider = new NetconfOperationProvider(configSubsystemFacade, netconfSessionIdForReporting);
     }
 
     @Override
index 236d4cfc1680ffd7afff347cff2b51431b6ae1af..c02c7fc10aa717185ce668d1af0589eca67ac98a 100644 (file)
   <name>${project.artifactId}</name>
   <packaging>bundle</packaging>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.opendaylight.netconf</groupId>
-        <artifactId>netconf-subsystem</artifactId>
-        <version>${project.version}</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>ietf-netconf-monitoring</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
   </dependencies>
 </project>
index 379c72fbcaeefefd6ae7f3b9241c28eb0de49b26..ea5e2004f11874dd8c052c6fa8c799e5fc816212 100644 (file)
   <packaging>bundle</packaging>
 
   <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types-2013-07-15</artifactId>
@@ -35,9 +31,5 @@
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types-20130715</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
   </dependencies>
 </project>
index 227b235271396c9cf54db1a93812126cdce705c4..87f21ec6959f9b5502c31f257b5175bb04ffaed6 100644 (file)
@@ -6,7 +6,6 @@
   ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
   ~ and is available at http://www.eclipse.org/legal/epl-v10.html
   -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
     <version>0.10.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
-  
+
   <groupId>org.opendaylight.netconf</groupId>
   <artifactId>ietf-netconf-notifications</artifactId>
   <version>1.2.0-SNAPSHOT</version>
   <name>${project.artifactId}</name>
   <packaging>bundle</packaging>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.opendaylight.netconf</groupId>
-        <artifactId>netconf-subsystem</artifactId>
-        <version>${project.version}</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>ietf-netconf</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types-20130715</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>ietf-inet-types-2013-07-15</artifactId>
     </dependency>
   </dependencies>
 </project>
index 97071bf4f30f16cc0f404261eaa24309bc760535..1812d4e46e71007927d4c96dc88d7bfdbb876418 100644 (file)
@@ -3,7 +3,7 @@ module nc-notifications {
     namespace "urn:ietf:params:xml:ns:netmod:notification";
     prefix "manageEvent";
 
-    import ietf-yang-types{ prefix yang; revision-date "2013-07-15";}
+    import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
     import notifications { prefix ncEvent; revision-date "2008-07-14";}
 
     organization
index 183396e140f743d6f5121268886d5a4532aacf24..67041237b3fbb968f16c17cb97c304a81b79624d 100644 (file)
@@ -6,15 +6,14 @@
   ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
   ~ and is available at http://www.eclipse.org/legal/epl-v10.html
   -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>binding-parent</artifactId>
-       <version>0.10.0-SNAPSHOT</version>
-       <relativePath/>
+        <version>0.10.0-SNAPSHOT</version>
+        <relativePath/>
     </parent>
 
     <groupId>org.opendaylight.netconf</groupId>
     <name>${project.artifactId}</name>
 
     <dependencies>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
             <artifactId>ietf-inet-types-2013-07-15</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
     </dependencies>
 </project>