Search in sources :

Example 6 with ConstantAdapterContext

use of org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext 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);
}
Also used : ModuleInfoSnapshot(org.opendaylight.mdsal.binding.runtime.api.ModuleInfoSnapshot) ConstantAdapterContext(org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext) DefaultBindingRuntimeGenerator(org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator) BindingCodecContext(org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext) BindingRuntimeTypes(org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeTypes) DefaultYangParserFactory(org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory) ModuleInfoSnapshotResolver(org.opendaylight.mdsal.binding.runtime.spi.ModuleInfoSnapshotResolver) DefaultBindingRuntimeContext(org.opendaylight.mdsal.binding.runtime.api.DefaultBindingRuntimeContext) YangParserFactory(org.opendaylight.yangtools.yang.parser.api.YangParserFactory) DefaultYangParserFactory(org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory) DefaultBindingRuntimeGenerator(org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator) BindingRuntimeGenerator(org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeGenerator)

Example 7 with ConstantAdapterContext

use of org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext in project lighty-netconf-simulator by PANTHEONtech.

the class NetworkTopologyServiceAbstractProcessor method init.

@Override
public void init(final NetconfDeviceServices netconfDeviceServices) {
    super.init(netconfDeviceServices);
    final ConstantAdapterContext constantAdapterContext = new ConstantAdapterContext(netconfDeviceServices.getAdapterContext().currentSerializer());
    this.adapterSerializer = constantAdapterContext.currentSerializer();
}
Also used : ConstantAdapterContext(org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext)

Aggregations

ConstantAdapterContext (org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext)7 DataImportBootReady (org.opendaylight.daexim.DataImportBootReady)2 TombstonedNodeManager (org.opendaylight.genius.cloudscaler.api.TombstonedNodeManager)2 DataTreeEventCallbackRegistrar (org.opendaylight.genius.datastoreutils.listeners.DataTreeEventCallbackRegistrar)2 IInterfaceManager (org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager)2 InterfaceManagerService (org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService)2 IMdsalApiManager (org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager)2 ShardStatusMonitor (org.opendaylight.genius.mdsalutil.interfaces.ShardStatusMonitor)2 TestIMdsalApiManager (org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager)2 TestShardStatusMonitor (org.opendaylight.genius.mdsalutil.testutils.TestShardStatusMonitor)2 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)2 DataBrokerTestModule (org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule)2 EntityOwnershipService (org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService)2 BindingDOMEntityOwnershipServiceAdapter (org.opendaylight.mdsal.eos.binding.dom.adapter.BindingDOMEntityOwnershipServiceAdapter)2 SimpleDOMEntityOwnershipService (org.opendaylight.mdsal.eos.dom.simple.SimpleDOMEntityOwnershipService)2 ServiceRecoveryRegistry (org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry)2 IdManagerService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService)2 IfmConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.config.rev160406.IfmConfig)2 OdlInterfaceRpcService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService)2 LockManagerService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService)2