use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.OpenMessage in project bgpcep by opendaylight.
the class BmpMockUtil method createOpen.
private static OpenMessage createOpen(final Ipv4Address address) {
final OpenBuilder msgBuilder = new OpenBuilder();
msgBuilder.setBgpIdentifier(address);
msgBuilder.setHoldTimer(HOLD_TIMER);
msgBuilder.setMyAsNumber(ASN.getValue().intValue());
msgBuilder.setVersion(PROTOCOL_VERSION);
return msgBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.OpenMessage in project bgpcep by opendaylight.
the class PCEPOpenMessageParser method serializeMessage.
@Override
public void serializeMessage(final Message message, final ByteBuf out) {
checkArgument(message instanceof OpenMessage, "Wrong instance of Message. Passed instance of %s. Need OpenMessage.", message.getClass());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.message.OpenMessage open = ((OpenMessage) message).getOpenMessage();
checkArgument(open.getOpen() != null, "Open Object must be present in Open Message.");
final ByteBuf buffer = Unpooled.buffer();
serializeObject(open.getOpen(), buffer);
MessageUtil.formatMessage(TYPE, buffer, out);
}
Aggregations