import com.google.common.base.Preconditions;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
private static DropTestRpcProvider dropRpcProvider = new DropTestRpcProvider();
public DropTestProviderImpl(final DataBroker dataBroker,
- final NotificationProviderService notificationProviderService,
+ final NotificationService notificationService,
final SalFlowService salFlowService) {
Preconditions.checkNotNull(dataBroker, "Data broker can't be empty");
- Preconditions.checkNotNull(notificationProviderService, "NotificationProviderService can't be empty");
+ Preconditions.checkNotNull(notificationService, "NotificationProviderService can't be empty");
Preconditions.checkNotNull(salFlowService, "SalFlowService can't be empty");
LOG.debug("Activator DropAllPack INIT");
dropDsProvider.setDataService(dataBroker);
- dropDsProvider.setNotificationService(notificationProviderService);
+ dropDsProvider.setNotificationService(notificationService);
- dropRpcProvider.setNotificationService(notificationProviderService);
+ dropRpcProvider.setNotificationService(notificationService);
dropRpcProvider.setFlowService(salFlowService);
LOG.debug("Activator DropAllPack END");
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.test.droptest.rev150327;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.droptestkaraf.DropTestProviderImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
public java.lang.AutoCloseable createInstance() {
LOG.debug("Starting drop-test provider module.");
DataBroker dataBroker = getDataBrokerDependency();
- NotificationProviderService notificationProviderService = getNotificationServiceDependency();
+ NotificationService notificationAdapterDependency = getNotificationAdapterDependency();
SalFlowService salFlowService = getRpcRegistryDependency().getRpcService(SalFlowService.class);
- DropTestProviderImpl dropTestProvider = new DropTestProviderImpl(dataBroker, notificationProviderService, salFlowService);
+ DropTestProviderImpl dropTestProvider = new DropTestProviderImpl(dataBroker, notificationAdapterDependency, salFlowService);
LOG.info("Drop-test provider module initialized.");
return dropTestProvider;
}
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
<name>binding-rpc-broker</name>
</rpc-registry>
- <notification-service>
+ <notification-adapter>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
+ <name>binding-notification-adapter</name>
+ </notification-adapter>
+ <!--notification-service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<name>binding-notification-broker</name>
- </notification-service>
+ </notification-service-->
</module>
</modules>
</data>
import config {prefix config; revision-date 2013-04-05;}
import rpc-context { prefix rpcx; revision-date 2013-06-17; }
import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+ import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28;}
description
"drop-test-provider";
}
}
}
+ container notification-adapter {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity sal-broker:binding-new-notification-service;
+ }
+ }
+ }
+ /*
container notification-service {
uses config:service-ref {
refine type {
}
}
}
+ */
}
}
}
package org.opendaylight.openflowplugin.droptest;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
LOG.debug("Activator DropAllPack INIT");
provider.setDataService(session.<DataBroker>getSALService(DataBroker.class));
- provider.setNotificationService(session.<NotificationProviderService>getSALService(NotificationProviderService.class));
+ provider.setNotificationService(session.<NotificationService>getSALService(NotificationService.class));
- rpcProvider.setNotificationService(session.<NotificationProviderService>getSALService(NotificationProviderService.class));
+ rpcProvider.setNotificationService(session.<NotificationService>getSALService(NotificationService.class));
rpcProvider.setFlowService(session.<SalFlowService>getRpcService(SalFlowService.class));
outCmdProvider.onSessionInitiated(session);
<feature version="${project.version}">odl-openflowplugin-app-config-pusher-li</feature>
<feature version="${project.version}">odl-openflowplugin-app-lldp-speaker-li</feature>
<feature version="${project.version}">odl-openflowplugin-nsf-services-li</feature>
+
</feature>
<feature name='odl-openflowplugin-nsf-services-li' version='${project.version}'
import java.util.Collection;
import org.opendaylight.controller.md.sal.binding.api.BindingService;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry);
- void setNotificationProviderService(NotificationProviderService notificationProviderService);
+ void setNotificationProviderService(NotificationService notificationProviderService);
+ void setNotificationPublishService(NotificationPublishService notificationPublishService);
/**
* Method sets role of this application in clustered environment.
import io.netty.util.Timeout;
import java.math.BigInteger;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
*
* @param notificationService
*/
- void setNotificationService(NotificationProviderService notificationService);
+ void setNotificationService(NotificationService notificationService);
+
+ void setNotificationPublishService(NotificationPublishService notificationPublishService);
MessageSpy getMessageSpy();
package org.opendaylight.openflowplugin.api.openflow.device;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
DeviceInitializationPhaseHandler, DeviceContextClosedHandler {
/**
- * Sets notification service
+ * Sets notification receiving service
* @param notificationService
*/
- void setNotificationService(NotificationProviderService notificationService);
+ void setNotificationService(NotificationService notificationService);
+
+ /**
+ * Sets notification publish service
+ * @param notificationPublishService
+ */
+ void setNotificationPublishService(NotificationPublishService notificationPublishService);
}
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
<name>binding-rpc-broker</name>
</rpc-registry>
- <notification-service>
+ <!--notification-service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<name>binding-notification-broker</name>
- </notification-service>
+ </notification-service-->
+ <notification-adapter>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
+ <name>binding-notification-adapter</name>
+ </notification-adapter>
+ <notification-publish-adapter>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-publish-service</type>
+ <name>binding-notification-publish-adapter</name>
+ </notification-publish-adapter>
<rpc-requests-quota>20000</rpc-requests-quota>
</module>
</modules>
import java.util.Collection;
import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
private RpcProviderRegistry rpcProviderRegistry;
private StatisticsManager statisticsManager;
private ConnectionManager connectionManager;
- private NotificationProviderService notificationProviderService;
+ private NotificationService notificationProviderService;
+ private NotificationPublishService notificationPublishService;
private ExtensionConverterManager extensionConverterManager;
connectionManager.setDeviceConnectedHandler(deviceManager);
deviceManager.setDeviceInitializationPhaseHandler(statisticsManager);
deviceManager.setNotificationService(this.notificationProviderService);
+ deviceManager.setNotificationPublishService(this.notificationPublishService);
statisticsManager.setDeviceInitializationPhaseHandler(rpcManager);
rpcManager.setDeviceInitializationPhaseHandler(deviceManager);
}
@Override
- public void setNotificationProviderService(final NotificationProviderService notificationProviderService) {
+ public void setNotificationProviderService(final NotificationService notificationProviderService) {
this.notificationProviderService = notificationProviderService;
}
+ @Override
+ public void setNotificationPublishService(final NotificationPublishService notificationPublishProviderService) {
+ this.notificationPublishService = notificationPublishProviderService;
+ }
+
@Override
public ExtensionConverterRegistrator getExtensionConverterRegistrator() {
return extensionConverterManager;
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
private final DeviceGroupRegistry deviceGroupRegistry;
private final DeviceMeterRegistry deviceMeterRegistry;
private Timeout barrierTaskTimeout;
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
private final MessageSpy<Class> messageSpy;
private DeviceDisconnectedHandler deviceDisconnectedHandler;
private List<DeviceContextClosedHandler> closeHandlers = new ArrayList<>();
+ private NotificationPublishService notificationPublishService;
@VisibleForTesting
final TranslatorKey translatorKey = new TranslatorKey(packetInMessage.getVersion(), PacketIn.class.getName());
final MessageTranslator<PacketInMessage, PacketReceived> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
final PacketReceived packetReceived = messageTranslator.translate(packetInMessage, this, null);
- notificationService.publish(packetReceived);
+ if (!notificationPublishService.offerNotification(packetReceived)){
+ LOG.debug("Notification offer refused by notification service.");
+ }
+
}
@Override
}
@Override
- public void setNotificationService(final NotificationProviderService notificationServiceParam) {
+ public void setNotificationService(final NotificationService notificationServiceParam) {
notificationService = notificationServiceParam;
}
+ @Override
+ public void setNotificationPublishService(final NotificationPublishService notificationPublishService) {
+ this.notificationPublishService = notificationPublishService;
+ }
+
@Override
public MessageSpy getMessageSpy() {
return messageSpy;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
private RequestContextStack emptyRequestContextStack;
private TranslatorLibrary translatorLibrary;
private DeviceInitializationPhaseHandler deviceInitPhaseHandler;
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
+ private NotificationPublishService notificationPublishService;
+
private final List<DeviceContext> synchronizedDeviceContextsList = new ArrayList<DeviceContext>();
private final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl();
final DeviceContext deviceContext = new DeviceContextImpl(connectionContext, deviceState, dataBroker, hashedWheelTimer, messageIntelligenceAgency);
deviceContext.setNotificationService(notificationService);
+ deviceContext.setNotificationPublishService(notificationPublishService);
deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, deviceState.getNodeInstanceIdentifier(), new NodeBuilder().setId(deviceState.getNodeId()).build());
connectionContext.setDeviceDisconnectedHandler(deviceContext);
}
@Override
- public void setNotificationService(final NotificationProviderService notificationServiceParam) {
+ public void setNotificationService(final NotificationService notificationServiceParam) {
notificationService = notificationServiceParam;
}
+ @Override
+ public void setNotificationPublishService (final NotificationPublishService notificationService) {
+ this.notificationPublishService = notificationService;
+ }
+
@Override
public void close() throws Exception {
for (DeviceContext deviceContext : synchronizedDeviceContextsList) {
openflowPluginProvider.setRole(getRole());
openflowPluginProvider.setDataBroker(getDataBrokerDependency());
openflowPluginProvider.setRpcProviderRegistry(getRpcRegistryDependency());
- openflowPluginProvider.setNotificationProviderService(getNotificationServiceDependency());
+ openflowPluginProvider.setNotificationProviderService(getNotificationAdapterDependency());
+ openflowPluginProvider.setNotificationPublishService(getNotificationPublishAdapterDependency());
+
openflowPluginProvider.initialize();
import openflow-provider {prefix openflow-provider; revision-date 2015-03-31;}
import openflow-switch-connection-provider {prefix openflow-switch-connection-provider;revision-date 2014-03-28;}
import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+ import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28;}
import openflow-plugin-types { prefix ofp-types; revision-date 2015-03-27;}
import openflowplugin-extension-registry {prefix ofp-ext-reg; revision-date 2015-04-25;}
}
}
}
+ container notification-adapter {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity sal-broker:binding-new-notification-service;
+ }
+ }
+ }
+ container notification-publish-adapter {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity sal-broker:binding-new-notification-publish-service;
+ }
+ }
+ }
+ /*
container notification-service {
uses config:service-ref {
refine type {
}
}
}
+ */
list openflow-switch-connection-provider {
uses config:service-ref {
refine type {
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicLong;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
};
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
- private ListenerRegistration<NotificationListener> notificationRegistration;
+ private ListenerRegistration<DropTestCommiter> notificationRegistration;
/**
* start listening on packetIn
SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
STARTUP_LOOP_MAX_RETRIES);
try {
- notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<NotificationListener>>() {
+ notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestCommiter>>() {
@Override
- public ListenerRegistration<NotificationListener> call() throws Exception {
+ public ListenerRegistration<DropTestCommiter> call() throws Exception {
return notificationService.registerNotificationListener(DropTestCommiter.this);
}
});
/**
* @param notificationService
*/
- public void setNotificationService(NotificationProviderService notificationService) {
+ public void setNotificationService(NotificationService notificationService) {
this.notificationService = notificationService;
}
}
package org.opendaylight.openflowplugin.testcommon;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
private DataBroker dataService;
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
private final DropTestCommiter commiter = new DropTestCommiter();
private boolean active = false;
/**
* @param notificationService value for setter
*/
- public void setNotificationService(final NotificationProviderService notificationService) {
+ public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
*/
package org.opendaylight.openflowplugin.testcommon;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.slf4j.Logger;
private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
private SalFlowService flowService;
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
private DropTestRpcSender commiter = new DropTestRpcSender();
private boolean active = false;
/**
* @param notificationService value for setter
*/
- public void setNotificationService(final NotificationProviderService notificationService) {
+ public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
import java.math.BigInteger;
import java.util.concurrent.Callable;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
}
};
- private NotificationProviderService notificationService;
+ private NotificationService notificationService;
- private ListenerRegistration<NotificationListener> notificationRegistration;
+ private ListenerRegistration<DropTestRpcSender> notificationRegistration;
/**
* start listening on packetIn
SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
STARTUP_LOOP_MAX_RETRIES);
try {
- notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<NotificationListener>>() {
+ notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestRpcSender>>() {
@Override
- public ListenerRegistration<NotificationListener> call() throws Exception {
+ public ListenerRegistration<DropTestRpcSender> call() throws Exception {
return notificationService.registerNotificationListener(DropTestRpcSender.this);
}
});
/**
* @param notificationService
*/
- public void setNotificationService(NotificationProviderService notificationService) {
+ public void setNotificationService(NotificationService notificationService) {
this.notificationService = notificationService;
}