Class Manager


  • public class Manager
    extends Object
    Manager is used for managing topology (deploying, destroying).
    • Constructor Detail

      • Manager

        public Manager​(String routerTag)
        Constructor
        Parameters:
        routerTag - tag of router to be used
      • Manager

        public Manager​(List<Controller> controllers)
        Constructor
        Parameters:
        controllers - to be used
      • Manager

        public Manager​(List<Controller> controllers,
                       String routerTag)
        Constructor
        Parameters:
        controllers - to be used
        routerTag - tag of the router
      • Manager

        public Manager​(List<Controller> controllers,
                       String routerTag,
                       String monitoringAddr,
                       int monitoringPort)
        Constructor
        Parameters:
        controllers - controllers used by manager
        routerTag - tag of router image
        monitoringAddr - ip address of monitoring service
        monitoringPort - port of monitoring service
    • Method Detail

      • getMonitoringAddr

        public String getMonitoringAddr()
        Getter for monitoring address
        Returns:
        address of monitoring component
      • setMonitoring

        public void setMonitoring​(String monitoringAddr,
                                  int monitoringPort)
        Setter for monitoring address
        Parameters:
        monitoringAddr - Address of monitoring service (greylog)
        monitoringPort - port of monitoring service
      • setControllers

        public void setControllers​(List<Controller> controllers)
        Setter for controllers
        Parameters:
        controllers - controllers to be used by manager
      • getProcessedRoutes

        public HashMap<String,​ArrayList<Route>> getProcessedRoutes()
        Getter for processed routes
        Returns:
        refined routes after application of rules
      • deployTopology

        public void deployTopology​(Topology topology)
        Deploy all topology. Creates all virtual devices (routers), networks. Connect them as topology describes. Calculate routes and set them to routes.
        Parameters:
        topology -
      • calcRoutes

        public void calcRoutes​(Topology topology)
        Calculates routers via Floyd-Warshall algo.
        Parameters:
        topology - the representation of topology where shortest paths are to be found
      • processRoutes

        public void processRoutes​(Topology topology)
        Parses calculated routes to actual route objects.
        Parameters:
        topology - topology of network
      • setRoutes

        public void setRoutes​(Topology topology)
        Sets routes to routing table via REST API on targeted routers.
        Parameters:
        topology - topology of network
      • cleanUp

        public void cleanUp​(Topology topology)
        Clean all routers, networks in topology (stop and delete).
        Parameters:
        topology -
      • deployDevice

        public void deployDevice​(Device device,
                                 String tag)
        Deploys device to selected environment.
        Parameters:
        device - the device
        tag - the tag
      • setMasquerade

        public void setMasquerade​(Topology topology)
        Sets masquerade to iptables on corner router, which provides full connectivity to internet for all networks communicating with corner router.
        Parameters:
        topology - topology of network
      • deployDeviceToNetwork

        public void deployDeviceToNetwork​(Device device,
                                          TopologyNetwork network,
                                          Topology calculatedTopology,
                                          String tag,
                                          List<String> envVars)
        Stops device, connects device to target network and again start device.
        Parameters:
        device - device to be connected
        network - network where device will be connected
        calculatedTopology - the topology which of network
        tag - tag of device
        envVars - environment variables passed to the container