Search in sources :

Example 6 with OpenMessage

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();
}
Also used : ReceivedOpenBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.ReceivedOpenBuilder) OpenBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenBuilder) SentOpenBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.SentOpenBuilder)

Example 7 with OpenMessage

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);
}
Also used : OpenMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.OpenMessage) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

OpenMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.OpenMessage)4 ReceivedOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.peer.up.ReceivedOpenBuilder)2 SentOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.peer.up.SentOpenBuilder)2 Notification (org.opendaylight.yangtools.yang.binding.Notification)2 ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 BGPDocumentedException (org.opendaylight.protocol.bgp.parser.BGPDocumentedException)1 BGPParsingException (org.opendaylight.protocol.bgp.parser.BGPParsingException)1 BmpDeserializationException (org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException)1 PCEPCloseTermination (org.opendaylight.protocol.pcep.PCEPCloseTermination)1 PCEPErrors (org.opendaylight.protocol.pcep.spi.PCEPErrors)1 IpAddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone)1 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)1 OpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenBuilder)1 OpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.OpenBuilder)1 OpenMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.OpenMessage)1 ReceivedOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.ReceivedOpenBuilder)1 SentOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.SentOpenBuilder)1 PeerUpNotification (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.PeerUpNotification)1 PeerUpNotificationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.PeerUpNotificationBuilder)1