Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / md / sal / rest / schema / SchemaExportContentYangBodyWriter.java
index 4826405496ce17653e41e02f50b070e4adc177fb..941f3a9d2fee1826b79a7287a3e63c0a48902e2a 100644 (file)
@@ -11,6 +11,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.util.concurrent.ExecutionException;
 import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
@@ -19,7 +20,6 @@ import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
 import org.opendaylight.restconf.common.schema.SchemaExportContext;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 
 @Provider
@@ -44,11 +44,11 @@ public class SchemaExportContentYangBodyWriter implements MessageBodyWriter<Sche
             final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
             WebApplicationException {
         final RevisionSourceIdentifier sourceId = RevisionSourceIdentifier.create(context.getModule().getName(),
-                context.getModule().getQNameModule().getFormattedRevision());
+                context.getModule().getQNameModule().getRevision());
         final YangTextSchemaSource yangTextSchemaSource;
         try {
-            yangTextSchemaSource = context.getSourceProvider().getSource(sourceId).checkedGet();
-        } catch (SchemaSourceException e) {
+            yangTextSchemaSource = context.getSourceProvider().getSource(sourceId).get();
+        } catch (InterruptedException | ExecutionException e) {
             throw new WebApplicationException("Unable to retrieve source from SourceProvider.", e);
         }
         yangTextSchemaSource.copyTo(entityStream);