Class Router

  • public class Router
    extends java.lang.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,
                      java.util.function.Consumer<InterfaceProvisionRequest> provisioner,
                      java.util.function.Consumer<InterfaceProvisionRequest> unprovisioner,
                      boolean forceUnprovision)
        Creates a new router interface manager.
        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.
        router configuration information
      • changeConfiguration

        public void changeConfiguration​(RouterInfo newConfig,
                                        boolean forceUnprovision)
        Changes the router configuration.
        newConfig - new configuration
        forceUnprovision - true if we want to force unprovision the device when it goes offline