@Service public class RouteManager extends Object implements RouteService, RouteAdminService
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.cluster.ClusterService |
clusterService |
protected org.onosproject.net.host.HostService |
hostService |
protected RouteStore |
routeStore |
protected org.onosproject.store.service.StorageService |
storageService |
| Constructor and Description |
|---|
RouteManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate() |
void |
addListener(RouteListener listener)
In a departure from other services in ONOS, calling addListener will
cause all current routes to be pushed to the listener before any new
events are sent.
|
protected void |
deactivate() |
Collection<RouteInfo> |
getRoutes(RouteTableId id)
Returns information about all routes in the given route table.
|
Collection<RouteTableId> |
getRouteTables()
Returns the set of route tables in the system.
|
Optional<ResolvedRoute> |
longestPrefixLookup(org.onlab.packet.IpAddress ip)
Performs a longest prefix lookup on the given IP address.
|
Route |
longestPrefixMatch(org.onlab.packet.IpAddress ip)
Performs a longest prefix match on the given IP address.
|
void |
removeListener(RouteListener listener) |
void |
update(Collection<Route> routes)
Updates the given routes in the route service.
|
void |
withdraw(Collection<Route> routes)
Withdraws the given routes from the route service.
|
@Reference(cardinality=MANDATORY_UNARY) protected RouteStore routeStore
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.host.HostService hostService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.ClusterService clusterService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.store.service.StorageService storageService
@Activate protected void activate()
@Deactivate protected void deactivate()
public void addListener(RouteListener listener)
addListener in interface org.onosproject.event.ListenerService<RouteEvent,RouteListener>listener - listener to be addedpublic void removeListener(RouteListener listener)
removeListener in interface org.onosproject.event.ListenerService<RouteEvent,RouteListener>public Collection<RouteTableId> getRouteTables()
RouteServicegetRouteTables in interface RouteServicepublic Collection<RouteInfo> getRoutes(RouteTableId id)
RouteServicegetRoutes in interface RouteServiceid - route table IDpublic Optional<ResolvedRoute> longestPrefixLookup(org.onlab.packet.IpAddress ip)
RouteServicelongestPrefixLookup in interface RouteServiceip - IP address to look uppublic void update(Collection<Route> routes)
RouteAdminServiceupdate in interface RouteAdminServiceroutes - collection of routes to updatepublic void withdraw(Collection<Route> routes)
RouteAdminServicewithdraw in interface RouteAdminServiceroutes - collection of routes to withdrawpublic Route longestPrefixMatch(org.onlab.packet.IpAddress ip)
RouteServicelongestPrefixMatch in interface RouteServiceip - IP address