+ private void addModuleCapability(SharedSchemaRepository consumer, Set<Capability> capabilities, Module module) {
+ final SourceIdentifier moduleSourceIdentifier = new SourceIdentifier(module.getName(),
+ SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()));
+ try {
+ 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
+ } catch (SchemaSourceException |IOException e) {
+ throw new RuntimeException("Cannot retrieve schema source for module " + moduleSourceIdentifier.toString() + " from schema repository", e);
+ }
+ }
+