Package org.onosproject.routing
Class Router
- java.lang.Object
-
- org.onosproject.routing.Router
-
public class Router extends Object
Manages the configuration and provisioning of a single-device router. It maintains which interfaces are part of the router when the configuration changes, and handles the provisioning/unprovisioning of interfaces when they are added/removed.
-
-
Constructor Summary
Constructors Constructor Description Router(RouterInfo info, InterfaceService interfaceService, DeviceService deviceService, Consumer<InterfaceProvisionRequest> provisioner, Consumer<InterfaceProvisionRequest> unprovisioner, boolean forceUnprovision)
Creates a new router interface manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeConfiguration(RouterInfo newConfig, boolean forceUnprovision)
Changes the router configuration.void
cleanup()
Cleans up the router and unprovisions all interfaces.RouterInfo
info()
Retrieves the router configuration information.
-
-
-
Constructor Detail
-
Router
public Router(RouterInfo info, InterfaceService interfaceService, DeviceService deviceService, Consumer<InterfaceProvisionRequest> provisioner, Consumer<InterfaceProvisionRequest> unprovisioner, boolean forceUnprovision)
Creates a new router interface manager.- Parameters:
info
- router configuration informationinterfaceService
- interface servicedeviceService
- device serviceprovisioner
- consumer that will provision new interfacesunprovisioner
- consumer that will unprovision old interfacesforceUnprovision
- force unprovision when the device goes offline
-
-
Method Detail
-
cleanup
public void cleanup()
Cleans up the router and unprovisions all interfaces.
-
info
public RouterInfo info()
Retrieves the router configuration information.- Returns:
- router configuration information
-
changeConfiguration
public void changeConfiguration(RouterInfo newConfig, boolean forceUnprovision)
Changes the router configuration.- Parameters:
newConfig
- new configurationforceUnprovision
- true if we want to force unprovision the device when it goes offline
-
-