Search in sources :

Example 1 with GotMapNotifyBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotifyBuilder in project lispflowmapping by opendaylight.

the class LispSouthboundHandler method handleMapNotify.

@SuppressWarnings("checkstyle:IllegalCatch")
private void handleMapNotify(ByteBuffer inBuffer, InetAddress sourceAddress, int port) {
    try {
        MapNotify mapNotify = MapNotifySerializer.getInstance().deserialize(inBuffer);
        GotMapNotifyBuilder gotMapNotifyBuilder = new GotMapNotifyBuilder();
        gotMapNotifyBuilder.setMapNotify(LispNotificationHelper.convertMapNotify(mapNotify));
        TransportAddressBuilder transportAddressBuilder = new TransportAddressBuilder();
        transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressBinaryFromInetAddress(sourceAddress));
        transportAddressBuilder.setPort(new PortNumber(port));
        gotMapNotifyBuilder.setTransportAddress(transportAddressBuilder.build());
        lispSbPlugin.sendNotificationIfPossible(gotMapNotifyBuilder.build());
    } catch (RuntimeException re) {
        throw new LispMalformedPacketException("Couldn't deserialize Map-Notify (len=" + inBuffer.capacity() + ")", re);
    } catch (InterruptedException e) {
        LOG.warn("Notification publication interrupted!");
    }
}
Also used : LispMalformedPacketException(org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedPacketException) MapNotify(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify) GotMapNotifyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotifyBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) TransportAddressBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)

Aggregations

LispMalformedPacketException (org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedPacketException)1 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)1 GotMapNotifyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotifyBuilder)1 MapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify)1 TransportAddressBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)1