use of org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier in project netconf by opendaylight.
the class YangSchemaExportBodyWriter method writeTo.
@Override
public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException {
final RevisionSourceIdentifier sourceId = RevisionSourceIdentifier.create(context.getModule().getName(), context.getModule().getQNameModule().getRevision());
final YangTextSchemaSource yangTextSchemaSource;
try {
yangTextSchemaSource = context.getSourceProvider().getSource(sourceId).get();
} catch (InterruptedException | ExecutionException e) {
throw new WebApplicationException("Unable to retrieve source from SourceProvider.", e);
}
yangTextSchemaSource.copyTo(entityStream);
}
Aggregations