use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.
the class PCCTriggeredFullDBResyncTest method createTriggerLspResync.
private static Message createTriggerLspResync() {
final SrpBuilder srpBuilder = new SrpBuilder();
srpBuilder.setOperationId(new SrpIdNumber(1L));
srpBuilder.setProcessingRule(Boolean.TRUE);
final Srp srp = srpBuilder.build();
final Lsp lsp = new LspBuilder().setPlspId(new PlspId(0L)).setSync(Boolean.TRUE).build();
final UpdatesBuilder rb = new UpdatesBuilder();
rb.setSrp(srp);
rb.setLsp(lsp);
final PathBuilder pb = new PathBuilder();
rb.setPath(pb.build());
final PcupdMessageBuilder ub = new PcupdMessageBuilder();
ub.setUpdates(Collections.singletonList(rb.build()));
return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.
the class PCCTriggeredLspResyncTest method createTriggerLspResync.
private static Message createTriggerLspResync() {
final SrpBuilder srpBuilder = new SrpBuilder();
srpBuilder.setOperationId(new SrpIdNumber(1L));
srpBuilder.setProcessingRule(Boolean.TRUE);
final Srp srp = srpBuilder.build();
final Lsp lsp = new LspBuilder().setPlspId(new PlspId(2L)).setSync(Boolean.TRUE).build();
final UpdatesBuilder rb = new UpdatesBuilder();
rb.setSrp(srp);
rb.setLsp(lsp);
final PathBuilder pb = new PathBuilder();
rb.setPath(pb.build());
final PcupdMessageBuilder ub = new PcupdMessageBuilder();
ub.setUpdates(Collections.singletonList(rb.build()));
return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.
the class PCCTriggeredSyncTest method createTriggerMsg.
private static Message createTriggerMsg() {
final UpdatesBuilder rb = new UpdatesBuilder();
// create PCUpd with mandatory objects and LSP object set to 1
final SrpBuilder srpBuilder = new SrpBuilder();
srpBuilder.setIgnore(false);
srpBuilder.setProcessingRule(false);
srpBuilder.setOperationId(new SrpIdNumber(1L));
final Srp srp = srpBuilder.build();
rb.setSrp(srp);
final Lsp lsp = new LspBuilder().setPlspId(new PlspId(0L)).setSync(Boolean.TRUE).build();
rb.setLsp(lsp);
final PathBuilder pb = new PathBuilder();
rb.setPath(pb.build());
final PcupdMessageBuilder ub = new PcupdMessageBuilder();
ub.setUpdates(Collections.singletonList(rb.build()));
return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.
the class TopologyProviderTest method testOnReportMessage.
@Test
public void testOnReportMessage() throws ReadFailedException {
this.listener.onSessionUp(this.session);
Pcrpt pcRptMsg = createSrPcRpt("1.1.1.1", "sr-path1", 1L, true);
this.listener.onMessage(this.session, pcRptMsg);
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
// check sr-path
final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
assertNotNull(reportedLsps);
assertEquals(1, reportedLsps.size());
final ReportedLsp lsp = reportedLsps.get(0);
assertEquals("sr-path1", lsp.getName());
assertEquals(1, lsp.getPath().get(0).getAugmentation(Path1.class).getPathSetupType().getPst().intValue());
final List<Subobject> subobjects = lsp.getPath().get(0).getEro().getSubobject();
assertEquals(1, subobjects.size());
assertEquals("1.1.1.1", ((IpNodeId) ((SrEroType) subobjects.get(0).getSubobjectType()).getNai()).getIpAddress().getIpv4Address().getValue());
return pcc;
});
pcRptMsg = createSrPcRpt("1.1.1.3", "sr-path2", 2L, false);
this.listener.onMessage(this.session, pcRptMsg);
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
// check second lsp sr-path
final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
assertNotNull(reportedLsps);
assertEquals(2, reportedLsps.size());
return pcc;
});
pcRptMsg = createSrPcRpt("1.1.1.2", "sr-path1", 1L, true);
this.listener.onMessage(this.session, pcRptMsg);
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
// check updated sr-path
final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
assertNotNull(reportedLsps);
assertEquals(2, reportedLsps.size());
for (final ReportedLsp rlsp : reportedLsps) {
if (rlsp.getName().equals("sr-path1")) {
final List<Subobject> subobjects = rlsp.getPath().get(0).getEro().getSubobject();
assertEquals(1, subobjects.size());
assertEquals("1.1.1.2", ((IpNodeId) ((SrEroType) subobjects.get(0).getSubobjectType()).getNai()).getIpAddress().getIpv4Address().getValue());
}
}
return pcc;
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.
the class MsgBuilderUtil method createLsp.
public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs, final boolean isDelegatedLsp, final boolean remove) {
final LspBuilder lspBuilder = new LspBuilder();
lspBuilder.setAdministrative(true);
lspBuilder.setDelegate(isDelegatedLsp);
lspBuilder.setIgnore(false);
lspBuilder.setOperational(OperationalStatus.Up);
lspBuilder.setPlspId(new PlspId(plspId));
lspBuilder.setProcessingRule(false);
lspBuilder.setRemove(remove);
lspBuilder.setSync(sync);
lspBuilder.setTlvs(tlvs.orNull());
return lspBuilder.build();
}
Aggregations