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 PCCTunnelManagerImplTest method createRequests.
private static Requests createRequests(final long plspId, final Optional<Boolean> remove, final Optional<Boolean> delegate) {
final RequestsBuilder reqBuilder = new RequestsBuilder();
reqBuilder.setEro(ERO);
final LspBuilder lsp = new LspBuilder().setTlvs(new TlvsBuilder().setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName(SYMBOLIC_NAME)).build()).build()).setPlspId(new PlspId(plspId));
if (delegate.isPresent()) {
lsp.setDelegate(Boolean.TRUE);
}
reqBuilder.setLsp(lsp.build());
final SrpBuilder srpBuilder = new SrpBuilder();
if (remove.isPresent()) {
srpBuilder.addAugmentation(Srp1.class, new Srp1Builder().setRemove(Boolean.TRUE).build());
}
reqBuilder.setSrp(srpBuilder.setOperationId(new SrpIdNumber(0L)).build());
return reqBuilder.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 PCCTunnelManagerImplTest method createUpdate.
private static Updates createUpdate(final long plspId, final Optional<Boolean> delegate) {
final UpdatesBuilder updsBuilder = new UpdatesBuilder();
final LspBuilder lsp = new LspBuilder().setPlspId(new PlspId(plspId));
if (delegate.isPresent()) {
lsp.setDelegate(Boolean.TRUE);
}
updsBuilder.setLsp(lsp.build());
final PathBuilder pathBuilder = new PathBuilder();
pathBuilder.setEro(ERO);
updsBuilder.setPath(pathBuilder.build());
updsBuilder.setSrp(new SrpBuilder().setOperationId(new SrpIdNumber(0L)).build());
return updsBuilder.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 MsgBuilderUtil method createPcRtpMessage.
public static Pcrpt createPcRtpMessage(final Lsp lsp, final Optional<Srp> srp, final Path path) {
final PcrptBuilder rptBuilder = new PcrptBuilder();
final PcrptMessageBuilder msgBuilder = new PcrptMessageBuilder();
final ReportsBuilder reportBuilder = new ReportsBuilder();
reportBuilder.setLsp(lsp);
reportBuilder.setSrp(srp.orNull());
reportBuilder.setPath(path);
msgBuilder.setReports(Lists.newArrayList(reportBuilder.build()));
rptBuilder.setPcrptMessage(msgBuilder.build());
return rptBuilder.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 PCCTunnelManagerImpl method reportToAll.
protected void reportToAll(final Updates update, final PCCSession session) {
final PlspId plspId = update.getLsp().getPlspId();
final PCCTunnel tunnel = this.tunnels.get(plspId);
final long srpId = update.getSrp().getOperationId().getValue();
if (tunnel != null) {
if (hasDelegation(tunnel, session)) {
final Srp srp = createSrp(update.getSrp().getOperationId().getValue());
final Path path = updToRptPath(update.getPath());
final List<Subobject> subobjects = update.getPath().getEro().getSubobject();
final Lsp lsp = update.getLsp();
sendToAll(tunnel, plspId, subobjects, srp, path, lsp);
// update tunnel state
tunnel.setLspState(path);
} else {
session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.UPDATE_REQ_FOR_NON_LSP, srpId));
}
} else {
session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.UNKNOWN_PLSP_ID, srpId));
}
}
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 PCCTunnelManagerImpl method reportMissedLsp.
/**
* Reports Missed Lsp when DbVersion doesnt match.
*/
private void reportMissedLsp(final PCCSession session) {
for (long missedLsp = this.syncOptimization.getRemoteLspDbVersionValue().longValue() + 1; missedLsp <= this.syncOptimization.getLocalLspDbVersionValue().longValue(); missedLsp++) {
final PlspId plspId = new PlspId(missedLsp);
final PCCTunnel tunnel = this.tunnels.get(plspId);
createLspAndSendReport(missedLsp, tunnel, session, Optional.absent(), NO_SRP);
}
}
Aggregations