use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.PcrepMessage in project bgpcep by opendaylight.
the class PCEPReplyMessageParser method serializeMessage.
@Override
public void serializeMessage(final Message message, final ByteBuf out) {
checkArgument(message instanceof Pcrep, "Wrong instance of Message. Passed instance of %s. Need Pcrep.", message.getClass());
final PcrepMessage repMsg = ((Pcrep) message).getPcrepMessage();
final List<Replies> replies = repMsg.nonnullReplies();
checkArgument(!replies.isEmpty(), "Replies cannot be null or empty.");
final ByteBuf buffer = Unpooled.buffer();
for (final Replies reply : replies) {
checkArgument(reply.getRp() != null, "Reply must contain RP object.");
serializeReply(reply, buffer);
}
MessageUtil.formatMessage(TYPE, buffer, out);
}
Aggregations