Search in sources :

Example 1 with DescriptionTlvBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder in project bgpcep by opendaylight.

the class BmpMockUtil method createInitiation.

static InitiationMessage createInitiation() {
    final InitiationMessageBuilder msgBuilder = new InitiationMessageBuilder();
    msgBuilder.setTlvs(new TlvsBuilder().setDescriptionTlv(new DescriptionTlvBuilder().setDescription(DESCRIPTION).build()).setNameTlv(new NameTlvBuilder().setName(NAME).build()).build());
    return msgBuilder.build();
}
Also used : TlvsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.initiation.TlvsBuilder) DescriptionTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder) InitiationMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.InitiationMessageBuilder) NameTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.name.tlv.NameTlvBuilder)

Example 2 with DescriptionTlvBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder in project bgpcep by opendaylight.

the class TestUtil method createInitMsg.

public static InitiationMessage createInitMsg(final String sysDescr, final String sysName, final String info) {
    final InitiationMessageBuilder initMsgBuilder = new InitiationMessageBuilder();
    final TlvsBuilder tlvsBuilder = new TlvsBuilder();
    tlvsBuilder.setDescriptionTlv(new DescriptionTlvBuilder().setDescription(sysDescr).build());
    tlvsBuilder.setNameTlv(new NameTlvBuilder().setName(sysName).build());
    tlvsBuilder.setStringInformation(Lists.newArrayList(createStringInfo(info)));
    return initMsgBuilder.setTlvs(tlvsBuilder.build()).build();
}
Also used : TlvsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.initiation.TlvsBuilder) DescriptionTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder) InitiationMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.InitiationMessageBuilder) NameTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.name.tlv.NameTlvBuilder)

Example 3 with DescriptionTlvBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder in project bgpcep by opendaylight.

the class AbstractBmpMessageWithTlvParserTest method testSerializeTlv.

@Test
public void testSerializeTlv() {
    final ByteBuf output = Unpooled.buffer();
    final DescriptionTlvBuilder builder = new DescriptionTlvBuilder().setDescription("test");
    this.parser.serializeTlv(builder.build(), output);
    assertArrayEquals(DATA, ByteArray.getAllBytes(output));
}
Also used : DescriptionTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

DescriptionTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.description.tlv.DescriptionTlvBuilder)3 InitiationMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.InitiationMessageBuilder)2 TlvsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.initiation.TlvsBuilder)2 NameTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.name.tlv.NameTlvBuilder)2 ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1