Interface Controller

  • All Known Implementing Classes:
    DockerController

    public interface Controller
    The Controller should be used to communicate with actual creator of environment.
    • Method Detail

      • connectDeviceToNetwork

        void connectDeviceToNetwork​(Device device,
                                    Network network)
        Connects device to network.
        Parameters:
        device - the device
        network - the network
      • connectDeviceToNetwork

        void connectDeviceToNetwork​(Device device,
                                    List<Network> networks)
        Connects device to each network in network array.
        Parameters:
        device - the device
        networks - the networks
      • stopDevice

        void stopDevice​(Device router)
        Stops device.
        Parameters:
        router - the router
      • disconnectDevice

        void disconnectDevice​(Device device,
                              Network network)
        Disconnects device from network.
        Parameters:
        device - the device
        network - the network
      • destroyDevice

        void destroyDevice​(Device device)
        Destroys device means first stops device container and then remove container.
        Parameters:
        device - the device
      • createNetwork

        void createNetwork​(Network network)
        Creates network.
        Parameters:
        network - the network
      • destroyNetwork

        void destroyNetwork​(Network network)
        Destroys network.
        Parameters:
        network - the network
      • deployDevice

        void deployDevice​(Device device,
                          String tag)
        Deploys device from built image.
        Parameters:
        device - the device
        tag - the tag
      • deployDevice

        void deployDevice​(Device device,
                          String tag,
                          List<String> envVars)
        Deploys device from built image.
        Parameters:
        device - the device
        tag - the tag
      • deployDevice

        void deployDevice​(Device device,
                          String tag,
                          String monitoringIP,
                          int monitoringPort)
        Deploys device to network and set monitoring attributes to container.
        Parameters:
        device - the device
        tag - tag to be set
        monitoringIP - ip address for monitoring
        monitoringPort - port for monitoring
      • deployDevice

        void deployDevice​(Device device,
                          String tag,
                          String monitoringIP,
                          int monitoringPort,
                          List<String> envVars)
        Deploys device to network and set monitoring attributes to container.
        Parameters:
        device - the device
        tag - tag to be set
        monitoringIP - ip address for monitoring
        monitoringPort - port for monitoring
      • deployDevice

        void deployDevice​(Device device,
                          File file)
        Builds image from file and then create container from built image.
        Parameters:
        device - the device
        file - the file
      • buildImage

        void buildImage​(File image,
                        String tag)
        Builds image from file.
        Parameters:
        image - the image
        tag - the tag
      • findGWNetworkIPAddress

        String findGWNetworkIPAddress​(Device device)
        Returns network ip address of default gw.
        Parameters:
        device - device to be searched
        Returns:
        address of gateway
      • findGWIPAddress

        String findGWIPAddress​(Device device)
        Returns ip address of default gw interface.
        Parameters:
        device - device which address is searched
        Returns:
        string representation of address
      • findGWMask

        Integer findGWMask​(Device device)
        Returns network mask of default gw interface.
        Parameters:
        device - device which mask will be returned
        Returns:
        network mask of device
      • getIdentifier

        String getIdentifier()
        Returns String identifier of controller, Docker/Rocket/VM, ...
        Returns:
        identifier
      • executeCommand

        void executeCommand​(Device device,
                            String command)
        Executes command in device.
        Parameters:
        device - where command will be executed
        command - which will be executed
      • startDevice

        void startDevice​(Device device)
        Starts device.
        Parameters:
        device - device to start