Interface Controller
-
- All Known Implementing Classes:
DockerController
public interface Controller
The Controller should be used to communicate with actual creator of environment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
buildImage(File image, String tag)
Builds image from file.void
connectDeviceToNetwork(Device device, Network network)
Connects device to network.void
connectDeviceToNetwork(Device device, List<Network> networks)
Connects device to each network in network array.void
createNetwork(Network network)
Creates network.void
deployDevice(Device device, File file)
Builds image from file and then create container from built image.void
deployDevice(Device device, String tag)
Deploys device from built image.void
deployDevice(Device device, String tag, String monitoringIP, int monitoringPort)
Deploys device to network and set monitoring attributes to container.void
deployDevice(Device device, String tag, String monitoringIP, int monitoringPort, List<String> envVars)
Deploys device to network and set monitoring attributes to container.void
deployDevice(Device device, String tag, List<String> envVars)
Deploys device from built image.void
destroyDevice(Device device)
Destroys device means first stops device container and then remove container.void
destroyNetwork(Network network)
Destroys network.void
disconnectDevice(Device device, Network network)
Disconnects device from network.void
executeCommand(Device device, String command)
Executes command in device.String
findGWIPAddress(Device device)
Returns ip address of default gw interface.Integer
findGWMask(Device device)
Returns network mask of default gw interface.String
findGWNetworkIPAddress(Device device)
Returns network ip address of default gw.String
getIdentifier()
Returns String identifier of controller, Docker/Rocket/VM, ...void
startDevice(Device device)
Starts device.void
stopDevice(Device router)
Stops device.
-
-
-
Method Detail
-
connectDeviceToNetwork
void connectDeviceToNetwork(Device device, Network network)
Connects device to network.- Parameters:
device
- the devicenetwork
- the network
-
connectDeviceToNetwork
void connectDeviceToNetwork(Device device, List<Network> networks)
Connects device to each network in network array.- Parameters:
device
- the devicenetworks
- 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 devicenetwork
- 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 devicetag
- the tag
-
deployDevice
void deployDevice(Device device, String tag, List<String> envVars)
Deploys device from built image.- Parameters:
device
- the devicetag
- 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 devicetag
- tag to be setmonitoringIP
- ip address for monitoringmonitoringPort
- 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 devicetag
- tag to be setmonitoringIP
- ip address for monitoringmonitoringPort
- port for monitoring
-
deployDevice
void deployDevice(Device device, File file)
Builds image from file and then create container from built image.- Parameters:
device
- the devicefile
- the file
-
buildImage
void buildImage(File image, String tag)
Builds image from file.- Parameters:
image
- the imagetag
- 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 executedcommand
- which will be executed
-
startDevice
void startDevice(Device device)
Starts device.- Parameters:
device
- device to start
-
-