use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.peer.down.data.FsmEventCode in project bgpcep by opendaylight.
the class PeerDownHandler method serializeMessageBody.
@Override
public void serializeMessageBody(final Notification message, final ByteBuf buffer) {
super.serializeMessageBody(message, buffer);
Preconditions.checkArgument(message instanceof PeerDownNotification, "An instance of PeerDownNotification is required");
final PeerDownNotification peerDown = (PeerDownNotification) message;
if (peerDown.getLocalSystemClosed()) {
if (peerDown.getData() instanceof FsmEventCode) {
buffer.writeByte(REASON_TWO.getValue());
ByteBufUtils.writeOrZero(buffer, ((FsmEventCode) peerDown.getData()).getFsmEventCode());
} else if (peerDown.getData() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.peer.down.data.Notification) {
buffer.writeByte(REASON_ONE.getValue());
serializePDU(peerDown.getData(), buffer);
}
} else {
if (peerDown.getData() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.peer.down.data.Notification) {
buffer.writeByte(REASON_THREE.getValue());
serializePDU(peerDown.getData(), buffer);
} else {
buffer.writeByte(REASON_FOUR.getValue());
}
}
}
Aggregations