Search in sources :

Example 6 with OpenMessage

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenMessage in project bgpcep by opendaylight.

the class PCEPOpenMessageParser method serializeMessage.

@Override
public void serializeMessage(final Message message, final ByteBuf out) {
    Preconditions.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.rev131005.open.message.OpenMessage open = ((OpenMessage) message).getOpenMessage();
    Preconditions.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.rev131005.OpenMessage) Preconditions(com.google.common.base.Preconditions) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

OpenMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenMessage)4 ReceivedOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.ReceivedOpenBuilder)2 SentOpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.SentOpenBuilder)2 Notification (org.opendaylight.yangtools.yang.binding.Notification)2 Preconditions (com.google.common.base.Preconditions)1 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 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)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 OpenMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenMessage)1 PeerUpNotification (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.PeerUpNotification)1 PeerUpNotificationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.PeerUpNotificationBuilder)1 InformationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.peer.up.InformationBuilder)1 StringInformationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformationBuilder)1