use of org.skife.jdbi.v2.Update in project bgpcep by opendaylight.
the class AdjRibOutListener method processRouteChange.
private void processRouteChange(final DataTreeCandidateNode route) {
final Update update;
switch(route.getModificationType()) {
case UNMODIFIED:
LOG.debug("Skipping unmodified route {}", route.getIdentifier());
return;
case DELETE:
case DISAPPEARED:
// FIXME: we can batch deletions into a single batch
update = withdraw((MapEntryNode) route.getDataBefore().get());
LOG.debug("Withdrawing routes {}", update);
break;
case APPEARED:
case SUBTREE_MODIFIED:
case WRITE:
update = advertise((MapEntryNode) route.getDataAfter().get());
LOG.debug("Advertising routes {}", update);
break;
default:
LOG.warn("Ignoring unhandled modification type {}", route.getModificationType());
return;
}
this.session.write(update);
}
use of org.skife.jdbi.v2.Update in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv6RIBSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(new FlowspecL3vpnIpv6RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
use of org.skife.jdbi.v2.Update in project bgpcep by opendaylight.
the class FlowspecIpv6RIBSupportTest 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));
}
use of org.skife.jdbi.v2.Update in project bgpcep by opendaylight.
the class FlowspecIpv6RIBSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
use of org.skife.jdbi.v2.Update in project bgpcep by opendaylight.
the class IPv4RIBSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
Aggregations