Revert "Bump apache mina to 1.2.0"
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / NetconfDeviceSimulator.java
index 50cbf2d647785438947860b8604de2126f707570..165decc6d4d6a8a41a05722026753ee375a696ea 100644 (file)
@@ -59,6 +59,7 @@ import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceFilter;
@@ -313,12 +314,12 @@ public class NetconfDeviceSimulator implements Closeable {
         return capabilities;
     }
 
-    private void addModuleCapability(SharedSchemaRepository consumer, Set<Capability> capabilities, Module module) {
+    private void addModuleCapability(final SharedSchemaRepository consumer, final Set<Capability> capabilities, final Module module) {
         final SourceIdentifier moduleSourceIdentifier = SourceIdentifier.create(module.getName(),
                 (SimpleDateFormatUtil.DEFAULT_DATE_REV == module.getRevision() ? Optional.<String>absent() :
                         Optional.of(SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()))));
         try {
-            String moduleContent = new String(consumer.getSchemaSource(moduleSourceIdentifier, YangTextSchemaSource.class)
+            final String moduleContent = new String(consumer.getSchemaSource(moduleSourceIdentifier, YangTextSchemaSource.class)
                     .checkedGet().read());
             capabilities.add(new YangModuleCapability(module, moduleContent));
             //IOException would be thrown in creating SchemaContext already
@@ -328,17 +329,17 @@ public class NetconfDeviceSimulator implements Closeable {
     }
 
     private void addDefaultSchemas(final SharedSchemaRepository consumer) {
-        SourceIdentifier sId = new SourceIdentifier("ietf-netconf-monitoring", "2010-10-04");
+        SourceIdentifier sId = RevisionSourceIdentifier.create("ietf-netconf-monitoring", "2010-10-04");
         registerSource(consumer, "/META-INF/yang/ietf-netconf-monitoring.yang", sId);
 
-        sId = new SourceIdentifier("ietf-netconf-monitoring-extension", "2013-12-10");
+        sId = RevisionSourceIdentifier.create("ietf-netconf-monitoring-extension", "2013-12-10");
         registerSource(consumer, "/META-INF/yang/ietf-netconf-monitoring-extension.yang", sId);
 
-        sId = new SourceIdentifier("ietf-yang-types", "2010-09-24");
-        registerSource(consumer, "/META-INF/yang/ietf-yang-types.yang", sId);
+        sId = RevisionSourceIdentifier.create("ietf-yang-types", "2013-07-15");
+        registerSource(consumer, "/META-INF/yang/ietf-yang-types@2013-07-15.yang", sId);
 
-        sId = new SourceIdentifier("ietf-inet-types", "2010-09-24");
-        registerSource(consumer, "/META-INF/yang/ietf-inet-types.yang", sId);
+        sId = RevisionSourceIdentifier.create("ietf-inet-types", "2013-07-15");
+        registerSource(consumer, "/META-INF/yang/ietf-inet-types@2013-07-15.yang", sId);
     }
 
     private void registerSource(final SharedSchemaRepository consumer, final String resource, final SourceIdentifier sourceId) {