use of org.opendaylight.mdsal.binding.runtime.spi.ModuleInfoSnapshotResolver in project lighty-netconf-simulator by PANTHEONtech.
the class NetconfDeviceServicesImpl method createAdapterContext.
private AdapterContext createAdapterContext(Collection<YangModuleInfo> moduleInfos) {
final YangParserFactory yangParserFactory = new DefaultYangParserFactory();
ModuleInfoSnapshotResolver snapshotResolver = new ModuleInfoSnapshotResolver("netconf-simulator", yangParserFactory);
snapshotResolver.registerModuleInfos(moduleInfos);
ModuleInfoSnapshot moduleInfoSnapshot = snapshotResolver.takeSnapshot();
final BindingRuntimeGenerator bindingRuntimeGenerator = new DefaultBindingRuntimeGenerator();
final BindingRuntimeTypes bindingRuntimeTypes = bindingRuntimeGenerator.generateTypeMapping(moduleInfoSnapshot.getEffectiveModelContext());
final DefaultBindingRuntimeContext bindingRuntimeContext = new DefaultBindingRuntimeContext(bindingRuntimeTypes, moduleInfoSnapshot);
final BindingCodecContext bindingCodecContext = new BindingCodecContext(bindingRuntimeContext);
return new ConstantAdapterContext(bindingCodecContext);
}
Aggregations