use of org.onosproject.routeservice.RouteStore in project onos by opennetworkinglab.
the class DhcpRelayWebResource method dhcpFpmDelete.
/**
* Deletes the fpm route from fpm record.
* Corresponding route from the route store
*
* @param prefix IpPrefix
* @return 204 NO CONTENT, 404; 401
*/
@DELETE
@Path("fpm/{prefix}")
public Response dhcpFpmDelete(@PathParam("prefix") String prefix) {
DhcpRelayService dhcpRelayService = get(DhcpRelayService.class);
RouteStore routeStore = get(RouteStore.class);
try {
// removes fpm route from fpm record
Optional<FpmRecord> fpmRecord = dhcpRelayService.removeFpmRecord(IpPrefix.valueOf(prefix));
if (fpmRecord.isPresent()) {
IpAddress nextHop = fpmRecord.get().nextHop();
Route route = new Route(Route.Source.DHCP, IpPrefix.valueOf(prefix), nextHop);
// removes DHCP route from route store
routeStore.removeRoute(route);
} else {
LOG.warn("fpmRecord is not present");
}
} catch (IllegalArgumentException ex) {
throw new IllegalArgumentException(ex);
}
return Response.noContent().build();
}
use of org.onosproject.routeservice.RouteStore in project onos by opennetworkinglab.
the class RouteStoreCommand method doExecute.
@Override
protected void doExecute() {
RouteStore routeStore = AbstractShellCommand.get(RouteStore.class);
print(routeStore.name());
}
Aggregations