use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.Update in project bgpcep by opendaylight.
the class RouteMonitoringMessageHandler method parseMessageBody.
@Override
public Notification parseMessageBody(final ByteBuf bytes) throws BmpDeserializationException {
final RouteMonitoringMessageBuilder routeMonitor = new RouteMonitoringMessageBuilder().setPeerHeader(parsePerPeerHeader(bytes));
try {
final Notification message = this.msgRegistry.parseMessage(bytes, null);
requireNonNull(message, "UpdateMessage may not be null");
Preconditions.checkArgument(message instanceof UpdateMessage, "An instance of UpdateMessage is required");
final UpdateMessage updateMessage = (UpdateMessage) message;
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.Update update = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.UpdateBuilder(updateMessage).build();
routeMonitor.setUpdate(update);
} catch (final BGPDocumentedException | BGPParsingException e) {
throw new BmpDeserializationException("Error while parsing Update Message.", e);
}
return routeMonitor.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.Update in project bgpcep by opendaylight.
the class PCCTunnelManagerImpl method handledDbTriggeredResync.
private void handledDbTriggeredResync(final Updates update, final PCCSession session) {
this.syncOptimization.setResynchronizingState(Boolean.TRUE);
final SrpIdNumber operationId = update.getSrp().getOperationId();
if (update.getLsp().getPlspId().getValue() == 0) {
reportAllKnownLsp(Optional.of(operationId), session);
} else {
reportLsp(update.getLsp().getPlspId(), operationId, session);
}
sendEndOfSynchronization(session, Optional.of(operationId));
this.syncOptimization.setResynchronizingState(Boolean.FALSE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.Update 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.bmp.message.rev171207.route.monitoring.message.Update in project openflowplugin by opendaylight.
the class MultipleLearningSwitchHandlerFacadeImpl method onSwitchAppeared.
@Override
public synchronized void onSwitchAppeared(InstanceIdentifier<Table> appearedTablePath) {
LOG.debug("expected table acquired, learning ..");
/**
* appearedTablePath is in form of /nodes/node/node-id/table/table-id
* so we shorten it to /nodes/node/node-id to get identifier of switch.
*/
InstanceIdentifier<Node> nodePath = InstanceIdentifierUtils.getNodePath(appearedTablePath);
/**
* We check if we already initialized dispatcher for that node,
* if not we create new handler for switch.
*/
if (!packetInDispatcher.getHandlerMapping().containsKey(nodePath)) {
// delegate this node (owning appearedTable) to SimpleLearningSwitchHandler
LearningSwitchHandlerSimpleImpl simpleLearningSwitch = new LearningSwitchHandlerSimpleImpl(dataStoreAccessor, packetProcessingService, null);
/**
* We propagate table event to newly instantiated instance of learning switch
*/
simpleLearningSwitch.onSwitchAppeared(appearedTablePath);
/**
* We update mapping of already instantiated LearningSwitchHanlders
*/
packetInDispatcher.getHandlerMapping().put(nodePath, simpleLearningSwitch);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.route.monitoring.message.Update in project bgpcep by opendaylight.
the class LabeledUnicastIpv4RIBSupportTest method testBuildMpReachNlriUpdate.
@Test
public void testBuildMpReachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes2.class));
}
Aggregations