use of org.opendaylight.bgpcep.pcep.server.PathComputation in project bgpcep by opendaylight.
the class PCEPTopologySessionListener method handlePcreqMessage.
private boolean handlePcreqMessage(final PcreqMessage message) {
LOG.info("Start PcRequest Message handler");
/* Get a Path Computation to compute the Path from the Request */
PathComputation pathComputation = pceServerProvider.getPathComputation();
Message rep = null;
/* Reply with Error Message if no valid Path Computation is available */
if (pathComputation == null) {
rep = createErrorMsg(PCEPErrors.RESOURCE_LIMIT_EXCEEDED, Uint32.ZERO);
sendMessage(rep, new SrpIdNumber(Uint32.ZERO), null);
return false;
}
for (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message.pcreq.message.Requests req : message.getRequests()) {
LOG.debug("Process request {}", req);
rep = pathComputation.computePath(req);
SrpIdNumber repId = null;
if (req.getRp() != null) {
repId = new SrpIdNumber(req.getRp().getRequestId().getValue());
} else {
repId = new SrpIdNumber(Uint32.ZERO);
}
sendMessage(rep, repId, null);
}
return false;
}
Aggregations