<snapshot>
<required-capabilities>
<capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&revision=2013-10-28</capability>
<capability>urn:opendaylight:params:xml:ns:yang:controller:config:lfm-mappingservice-sb:impl?module=lfm-mappingservice-sb-impl&revision=2015-05-17</capability>
</required-capabilities>
<configuration>
<name>binding-osgi-broker</name>
</broker>
- <notification-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
- binding:binding-notification-service
+ <notification-publish-service>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+ binding:binding-new-notification-publish-service
</type>
- <name>binding-notification-broker</name>
- </notification-service>
+ <name>binding-notification-publish-adapter</name>
+ </notification-publish-service>
</module>
</modules>
</configuration>
-</snapshot>
\ No newline at end of file
+</snapshot>
import java.net.DatagramPacket;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.lispflowmapping.southbound.LispSouthboundPlugin;
import org.opendaylight.lispflowmapping.southbound.LispSouthboundRPC;
import org.opendaylight.lispflowmapping.southbound.lisp.ILispSouthboundService;
LOG.debug("LfmMappingServiceSb Module up!");
sbPlugin = new LispSouthboundPlugin();
- sbPlugin.setNotificationProviderService(getNotificationServiceDependency());
+ sbPlugin.setNotificationPublishService(getNotificationPublishServiceDependency());
sbPlugin.setRpcRegistryDependency(getRpcRegistryDependency());
sbPlugin.setBindingAwareBroker(getBrokerDependency());
sbPlugin.init();
import java.nio.ByteBuffer;
import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.southbound.lisp.ILispSouthboundService;
private LispIoThread xtrThread;
private LispSouthboundService lispSouthboundService;
private LispXtrSouthboundService lispXtrSouthboundService;
- private NotificationProviderService notificationService;
+ private NotificationPublishService notificationPublishService;
private RpcProviderRegistry rpcRegistry;
private BindingAwareBroker broker;
private volatile DatagramSocket socket = null;
synchronized (startLock) {
lispSouthboundService = new LispSouthboundService(this);
lispXtrSouthboundService = new LispXtrSouthboundService();
- lispSouthboundService.setNotificationProvider(this.notificationService);
- lispXtrSouthboundService.setNotificationProvider(this.notificationService);
+ lispSouthboundService.setNotificationProvider(this.notificationPublishService);
+ lispXtrSouthboundService.setNotificationProvider(this.notificationPublishService);
if (bindingAddress == null) {
setLispAddress("0.0.0.0");
}
}
}
- public void setNotificationProviderService(NotificationProviderService notificationService) {
- this.notificationService = notificationService;
+ public void setNotificationPublishService(NotificationPublishService notificationService) {
+ this.notificationPublishService = notificationService;
}
public void setRpcRegistryDependency(RpcProviderRegistry rpcRegistry) {
import java.net.InetAddress;
import java.nio.ByteBuffer;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.lispflowmapping.southbound.LispSouthboundPlugin;
import org.opendaylight.lispflowmapping.southbound.LispSouthboundStats;
import org.opendaylight.lispflowmapping.southbound.util.LispNotificationHelper;
import org.slf4j.LoggerFactory;
public class LispSouthboundService implements ILispSouthboundService {
- private NotificationProviderService notificationProvider;
+ private NotificationPublishService notificationPublishService;
protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundService.class);
private final LispSouthboundPlugin lispSbPlugin;
}
}
- public void setNotificationProvider(NotificationProviderService nps) {
- this.notificationProvider = nps;
+ public void setNotificationProvider(NotificationPublishService nps) {
+ this.notificationPublishService = nps;
}
public void handlePacket(DatagramPacket packet) {
transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(finalSourceAddress));
transportAddressBuilder.setPort(new PortNumber(port));
requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
- if (notificationProvider != null) {
- notificationProvider.publish(requestMappingBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(requestMappingBuilder.build());
LOG.trace("MapRequest was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
}
transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
transportAddressBuilder.setPort(new PortNumber(port));
addMappingBuilder.setTransportAddress(transportAddressBuilder.build());
- if (notificationProvider != null) {
- notificationProvider.publish(addMappingBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(addMappingBuilder.build());
LOG.trace("MapRegister was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Register (len=" + inBuffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
}
transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
transportAddressBuilder.setPort(new PortNumber(port));
gotMapNotifyBuilder.setTransportAddress(transportAddressBuilder.build());
- if (notificationProvider != null) {
- notificationProvider.publish(gotMapNotifyBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(gotMapNotifyBuilder.build());
LOG.trace("MapNotify was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Notify (len=" + inBuffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
}
transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(sourceAddress));
transportAddressBuilder.setPort(new PortNumber(port));
gotMapReplyBuilder.setTransportAddress(transportAddressBuilder.build());
- if (notificationProvider != null) {
- notificationProvider.publish(gotMapReplyBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(gotMapReplyBuilder.build());
LOG.trace("MapReply was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + inBuffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
}
import java.net.InetAddress;
import java.nio.ByteBuffer;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.lispflowmapping.southbound.util.LispNotificationHelper;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.type.LispMessageEnum;
import org.slf4j.LoggerFactory;
public class LispXtrSouthboundService implements ILispSouthboundService {
- private NotificationProviderService notificationProvider;
+ private NotificationPublishService notificationPublishService;
protected static final Logger LOG = LoggerFactory.getLogger(LispXtrSouthboundService.class);
- public void setNotificationProvider(NotificationProviderService nps) {
- this.notificationProvider = nps;
+ public void setNotificationProvider(NotificationPublishService nps) {
+ this.notificationPublishService = nps;
}
public void handlePacket(DatagramPacket packet) {
transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressFromInetAddress(finalSourceAddress));
transportAddressBuilder.setPort(new PortNumber(LispMessage.PORT_NUM));
requestMappingBuilder.setTransportAddress(transportAddressBuilder.build());
- if (notificationProvider != null) {
- notificationProvider.publish(requestMappingBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(requestMappingBuilder.build());
LOG.trace("MapRequest was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Request (len=" + inBuffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
}
XtrReplyMappingBuilder replyMappingBuilder = new XtrReplyMappingBuilder();
replyMappingBuilder.setMapReply(LispNotificationHelper.convertMapReply(reply));
- if (notificationProvider != null) {
- notificationProvider.publish(replyMappingBuilder.build());
+ if (notificationPublishService != null) {
+ notificationPublishService.putNotification(replyMappingBuilder.build());
LOG.trace("MapReply was published!");
} else {
LOG.warn("Notification Provider is null!");
}
} catch (RuntimeException re) {
throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + buffer.capacity() + ")", re);
+ } catch (InterruptedException e) {
+ LOG.warn("Notification publication interrupted!");
}
-
}
}
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 mdsal; revision-date 2013-10-28; }
+ import opendaylight-sal-binding-broker-impl { prefix sal-broker; revision-date 2013-10-28; }
import lisp-sb { prefix lisp-sb; revision-date 2015-09-04; }
description
}
}
- container notification-service {
+ container notification-publish-service {
uses config:service-ref {
refine type {
mandatory true;
- config:required-identity mdsal:binding-notification-service;
+ config:required-identity sal-broker:binding-new-notification-publish-service;
}
}
}
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.lispflowmapping.lisp.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.type.LispMessageEnum;
public class LispSouthboundServiceTest extends BaseTestCase {
private LispSouthboundService testedLispService;
- private NotificationProviderService nps;
+ private NotificationPublishService nps;
private byte[] mapRequestPacket;
private byte[] mapRegisterPacket;
private ValueSaverAction<Notification> lispNotificationSaver;
// mapResolver = context.mock(IMapResolver.class);
// mapServer = context.mock(IMapServer.class);
testedLispService = new LispSouthboundService(null);
- nps = context.mock(NotificationProviderService.class);
+ nps = context.mock(NotificationPublishService.class);
testedLispService.setNotificationProvider(nps);
lispNotificationSaver = new ValueSaverAction<Notification>();
// mapRegisterSaver = new ValueSaverAction<MapRegister>();
+ "0060 ff 00 00 05 00 01 0a 01 00 6e 06 64 ff 00 00 05 " //
+ "0070 00 01 c0 a8 88 33"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
handleMapRegisterPacket(mapRegisterPacket);
+ "0060 01 92 00 00 00 00 00 00 00 01 01 64 ff 00 00 05 " //
+ "0070 00 01 0a 00 3a 9c"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
handleMapRegisterPacket(mapRegisterPacket);
@Test
public void mapRegister__VerifyBasicFields() throws Exception {
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
handleMapRegisterPacket(mapRegisterPacket);
EidToLocatorRecord eidToLocator = lastMapRegister().getEidToLocatorRecord().get(0);
@Test
@Ignore
public void mapRegister__NoResponseFromMapServerShouldReturnNullPacket() throws Exception {
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
mapNotifyBuilder = null;
assertNull(handleMapRegisterPacket(mapRegisterPacket));
@Test
public void mapRequest__VerifyBasicFields() throws Exception {
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
handleMapRequestAsByteArray(mapRequestPacket);
List<EidRecord> eids = lastMapRequest().getEidRecord();
assertEquals(1, eids.size());
+ "00a0 00 02 26 10 00 d0 ff ff 01 92 00 00 00 00 00 00 " //
+ "00b0 00 01 01 64 ff 00 00 05 00 01 0a 00 3a 9c"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
// ret(mapReply);
handleMapRequestAsByteArray(mapRequestPacket);
+ "0090 00 00 00 00 00 02 00 00 00 0a 01 80 10 00 00 00 " //
+ "00a0 00 02 26 10 00 d0 ff ff 01 92 00 00 00 00 00 00 " //
+ "00b0 00 01 01 64 ff 00 00 05 00 01 0a 00 3a 9c"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
// ret(mapReply);
DatagramPacket replyPacket = handleMapRequestPacket(mapRequestPacket);
+ "0070 10 00 00 00 00 01 99 10 fe 01 01 64 ff 00 00 05 " //
+ "0080 00 01 0a 00 01 26"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
// ret(mapReply);
handleMapRequestAsByteArray(mapRequestPacket);
+ "0080 01 64 ff 00 00 05 00 01 0a 01 00 6f 06 64 ff 00 " //
+ "0090 00 05 00 01 c0 a8 88 33"));
- oneOf(nps).publish(with(lispNotificationSaver));
+ oneOf(nps).putNotification(with(lispNotificationSaver));
handleMapRequestAsByteArray(mapRequestPacket);
}
private void stubMapRegister(final boolean setNotifyFromRegister) {
- allowing(nps).publish(with(lispNotificationSaver));
+ try {
+ allowing(nps).putNotification(with(lispNotificationSaver));
+ } catch (InterruptedException e) {
+ }
will(new SimpleAction() {
@Override
}
private void stubHandleRequest() {
- allowing(nps).publish(wany(Notification.class));
+ try {
+ allowing(nps).putNotification(wany(Notification.class));
+ } catch (InterruptedException e) {
+ }
}
private byte[] handleMapRequestAsByteArray(byte[] inPacket) {
// + "40 05 c0 a8 88 0a 01 02 " // MAC (ITR-RLOC #1 of 2)
// + "00 01 01 02 03 04 " // IP (ITR-RLOC #2 of 2)
// + "00 20 00 01 01 02 03 04").array();
- // oneOf(nps).publish(with(lispNotificationSaver));
+ // oneOf(nps).putNotification(with(lispNotificationSaver));
// // ret(mapReply);
// DatagramPacket packet = handleMapRequestPacket(mapRequestPacket);
// assertEquals(2, lastMapRequest().getItrRlocs().size());
// + "00 01 01 02 03 04 " // IP (ITR-RLOC #1 of 2)
// + "00 01 c0 a8 88 0a " // MAC (ITR-RLOC #2 of 2)
// + "00 20 00 01 01 02 03 04").array();
- // oneOf(nps).publish(with(lispNotificationSaver));
+ // oneOf(nps).putNotification(with(lispNotificationSaver));
// // ret(mapReply);
// DatagramPacket packet = handleMapRequestPacket(mapRequestPacket);
// assertEquals(2, lastMapRequest().getItrRloc().size());