import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
private final BGPDispatcher dispatcher;
private final BindingCodecTreeFactory codecTreeFactory;
private final DOMDataBroker domBroker;
- private final SchemaService schemaService;
+ private final DOMSchemaService domSchemaService;
private RIBImpl ribImpl;
private ServiceRegistration<?> serviceRegistration;
private ListenerRegistration<SchemaContextListener> schemaContextRegistration;
public RibImpl(final ClusterSingletonServiceProvider provider, final RIBExtensionConsumerContext contextProvider,
final BGPDispatcher dispatcher, final BindingCodecTreeFactory codecTreeFactory, final DOMDataBroker domBroker,
- final SchemaService schemaService) {
+ final DOMSchemaService domSchemaService) {
this.provider = Preconditions.checkNotNull(provider);
this.extensions = contextProvider;
this.dispatcher = dispatcher;
this.codecTreeFactory = codecTreeFactory;
this.domBroker = domBroker;
- this.schemaService = schemaService;
+ this.domSchemaService = domSchemaService;
}
void start(final Global global, final String instanceName, final BGPTableTypeRegistryConsumer tableTypeRegistry,
final BgpDeployer.WriteConfiguration configurationWriter) {
Preconditions.checkState(this.ribImpl == null, "Previous instance %s was not closed.", this);
this.ribImpl = createRib(global, instanceName, tableTypeRegistry, configurationWriter);
- this.schemaContextRegistration = this.schemaService.registerSchemaContextListener(this.ribImpl);
+ this.schemaContextRegistration = this.domSchemaService.registerSchemaContextListener(this.ribImpl);
}
Boolean isGlobalEqual(final Global global) {
<reference id="codecTreeFactory" interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory"/>
<reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker" odl:type="pingpong"/>
<reference id="bgpTableTypeRegistry" interface="org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer"/>
- <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+ <odl:static-reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
<bean id="bgpDeployer" class="org.opendaylight.protocol.bgp.rib.impl.config.BgpDeployerImpl" destroy-method="close">
<argument ref="BGPDispatcher"/>
<argument ref="codecTreeFactory"/>
<argument ref="domDataBroker"/>
- <argument ref="schemaService"/>
+ <argument ref="domSchemaService"/>
</bean>
<bean id="bgpPeer" class="org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer" scope="prototype">
import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory;
import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
Mockito.doReturn(serviceRegistration).when(singletonServiceProvider).registerClusterSingletonService(any());
Mockito.doNothing().when(serviceRegistration).close();
- final SchemaService schemaService = mock(SchemaService.class);
+ final DOMSchemaService schemaService = mock(DOMSchemaService.class);
Mockito.doNothing().when(this.dataTreeRegistration).close();
Mockito.doReturn(this.dataTreeRegistration).when(schemaService).registerSchemaContextListener(any());
import org.mockito.Mockito;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory;
import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
@Mock
private DOMDataBroker domDataBroker;
@Mock
- private SchemaService schemaService;
+ private DOMSchemaService domSchemaService;
@Mock
private ClusterSingletonServiceProvider clusterSingletonServiceProvider;
@Mock
final DOMDataTreeChangeService dOMDataTreeChangeService = mock(DOMDataTreeChangeService.class);
Mockito.doReturn(Collections.singletonMap(DOMDataTreeChangeService.class, dOMDataTreeChangeService))
.when(this.domDataBroker).getSupportedExtensions();
- Mockito.doReturn(this.dataTreeRegistration).when(this.schemaService).registerSchemaContextListener(any());
+ Mockito.doReturn(this.dataTreeRegistration).when(this.domSchemaService).registerSchemaContextListener(any());
Mockito.doNothing().when(this.dataTreeRegistration).close();
Mockito.doReturn(mock(ListenerRegistration.class)).when(dOMDataTreeChangeService).registerDataTreeChangeListener(any(), any());
Mockito.doNothing().when(this.serviceRegistration).unregister();
@Test
public void testRibImpl() throws Exception {
final RibImpl ribImpl = new RibImpl(this.clusterSingletonServiceProvider, this.extension, this.dispatcher,
- this.bindingCodecTreeFactory, this.domDataBroker, this.schemaService);
+ this.bindingCodecTreeFactory, this.domDataBroker, this.domSchemaService);
ribImpl.setServiceRegistration(this.serviceRegistration);
ribImpl.start(createGlobal(), "rib-test", this.tableTypeRegistry, this.configurationWriter);
verify(this.extension).getClassLoadingStrategy();
verify(this.domDataBroker).getSupportedExtensions();
verify(this.clusterSingletonServiceProvider).registerClusterSingletonService(any());
- verify(this.schemaService).registerSchemaContextListener(any(RIBImpl.class));
+ verify(this.domSchemaService).registerSchemaContextListener(any(RIBImpl.class));
this.singletonService.instantiateServiceInstance();
Mockito.verify(this.configurationWriter).apply();
assertEquals("RIBImpl{}", ribImpl.toString());