Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / schema / SchemaExportContentYangBodyWriter.java
index 395f2362f49fe949e4b79279fd593a836995dca3..1266a580bb278563d57878dc64fcf0470ab999d9 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;
@@ -20,7 +21,6 @@ import javax.ws.rs.ext.Provider;
 import org.opendaylight.restconf.common.schema.SchemaExportContext;
 import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
 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
@@ -45,11 +45,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);