use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.PeerUpNotification in project bgpcep by opendaylight.
the class BmpRouterImpl method onPeerUp.
private synchronized void onPeerUp(final PeerUpNotification peerUp) {
final PeerId peerId = getPeerIdFromOpen(peerUp.getReceivedOpen());
if (!getPeer(peerId).isPresent()) {
final BmpRouterPeer peer = BmpRouterPeerImpl.createRouterPeer(this.domTxChain, this.peersYangIId, peerUp, this.extensions, this.tree, peerId);
this.peers.put(peerId, peer);
LOG.debug("Router {}: Peer {} goes up.", this.routerIp, peerId.getValue());
} else {
LOG.debug("Peer: {} for Router: {} already exists.", peerId.getValue(), this.routerIp);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.PeerUpNotification in project bgpcep by opendaylight.
the class AbstractBmpPerPeerMessageParserTest method testSerializeMessageBody.
@Test
public void testSerializeMessageBody() {
final PeerHeader perHeader = AbstractBmpPerPeerMessageParser.parsePerPeerHeader(Unpooled.wrappedBuffer(this.ipv6MsgWithDistinguishergBytes));
final PeerUpNotification peerNotif = new PeerUpNotificationBuilder().setPeerHeader(perHeader).build();
final ByteBuf aggregator = Unpooled.buffer();
this.parser.serializeMessageBody(peerNotif, aggregator);
assertArrayEquals(this.ipv6MsgWithDistinguishergBytes, ByteArray.getAllBytes(aggregator));
}
Aggregations