Class 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 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 information
        interfaceService - interface service
        deviceService - device service
        provisioner - consumer that will provision new interfaces
        unprovisioner - consumer that will unprovision old interfaces
        forceUnprovision - 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 configuration
        forceUnprovision - true if we want to force unprovision the device when it goes offline