use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.PcinitiateMessage in project bgpcep by opendaylight.
the class CInitiated00PCInitiateMessageParser method serializeMessage.
@Override
public void serializeMessage(final Message message, final ByteBuf out) {
Preconditions.checkArgument(message instanceof Pcinitiate, "Wrong instance of Message. Passed instance of %s. Need PcinitiateMessage.", message.getClass());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.PcinitiateMessage init = ((Pcinitiate) message).getPcinitiateMessage();
final ByteBuf buffer = Unpooled.buffer();
for (final Requests req : init.getRequests()) {
serializeRequest(req, buffer);
}
MessageUtil.formatMessage(TYPE, buffer, out);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.PcinitiateMessage in project bgpcep by opendaylight.
the class PCCSessionListenerTest method createInitMsg.
private static PcinitiateMessage createInitMsg(final boolean remove, final boolean endpoint) {
// lsp with "unknown" plsp-id
final LspBuilder lspBuilder = new LspBuilder().setAdministrative(true).setDelegate(true).setIgnore(false).setOperational(OperationalStatus.Up).setPlspId(new PlspId(999L)).setProcessingRule(false).setRemove(remove).setSync(true);
final List<Requests> requests = Lists.newArrayList();
final RequestsBuilder reqBuilder = new RequestsBuilder().setLsp(lspBuilder.build()).setSrp(new SrpBuilder(MsgBuilderUtil.createSrp(123)).addAugmentation(Srp1.class, new Srp1Builder().setRemove(remove).build()).build());
if (endpoint) {
reqBuilder.setEndpointsObj(new EndpointsObjBuilder().build());
}
requests.add(reqBuilder.build());
final PcinitiateMessageBuilder initBuilder = new PcinitiateMessageBuilder().setRequests(requests);
return new PcinitiateBuilder().setPcinitiateMessage(initBuilder.build()).build();
}
Aggregations