use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.NotificationBuilder in project bgpcep by opendaylight.
the class TestUtil method createPeerDownNotification.
public static PeerDownNotification createPeerDownNotification(final Ipv4Address bgpId) {
final NotificationBuilder notifBuilder = new NotificationBuilder().setNotification(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.notification.NotificationBuilder().setErrorCode((short) 1).setErrorSubcode((short) 1).build());
final PeerDownNotificationBuilder peerDownNotifBuilder = new PeerDownNotificationBuilder().setData(notifBuilder.build()).setLocalSystemClosed(true).setPeerHeader(TestUtil.createPeerHeader(bgpId));
return peerDownNotifBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.NotificationBuilder in project bgpcep by opendaylight.
the class PeerDownHandler method parseBgpNotificationMessage.
private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.Notification parseBgpNotificationMessage(final ByteBuf bytes) throws BmpDeserializationException {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.NotificationBuilder notificationCBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.NotificationBuilder();
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.notification.NotificationBuilder notificationBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.down.data.notification.NotificationBuilder();
try {
final Notification not = this.msgRegistry.parseMessage(bytes, null);
requireNonNull(not, "Notify message may not be null.");
Preconditions.checkArgument(not instanceof NotifyMessage, "An instance of NotifyMessage is required");
notificationBuilder.fieldsFrom((NotifyMessage) not);
notificationCBuilder.setNotification(notificationBuilder.build());
} catch (final BGPDocumentedException | BGPParsingException e) {
throw new BmpDeserializationException("Error while parsing BGP Notification message.", e);
}
return notificationCBuilder.build();
}
Aggregations