Class Manager
- java.lang.Object
-
- io.patriot_framework.network.simulator.api.manager.Manager
-
public class Manager extends Object
Manager is used for managing topology (deploying, destroying).
-
-
Constructor Summary
Constructors Constructor Description Manager(String routerTag)
ConstructorManager(List<Controller> controllers)
ConstructorManager(List<Controller> controllers, String routerTag)
ConstructorManager(List<Controller> controllers, String routerTag, String monitoringAddr, int monitoringPort)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calcRoutes(Topology topology)
Calculates routers via Floyd-Warshall algo.void
cleanUp(Topology topology)
Clean all routers, networks in topology (stop and delete).void
deployDevice(Device device, String tag)
Deploys device to selected environment.void
deployDeviceToNetwork(Device device, TopologyNetwork network, Topology calculatedTopology, String tag, List<String> envVars)
Stops device, connects device to target network and again start device.void
deployTopology(Topology topology)
Deploy all topology.String
getMonitoringAddr()
Getter for monitoring addressHashMap<String,ArrayList<Route>>
getProcessedRoutes()
Getter for processed routesvoid
processRoutes(Topology topology)
Parses calculated routes to actual route objects.void
setControllers(List<Controller> controllers)
Setter for controllersvoid
setMasquerade(Topology topology)
Sets masquerade to iptables on corner router, which provides full connectivity to internet for all networks communicating with corner router.void
setMonitoring(String monitoringAddr, int monitoringPort)
Setter for monitoring addressvoid
setRoutes(Topology topology)
Sets routes to routing table via REST API on targeted routers.
-
-
-
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 usedrouterTag
- tag of the router
-
Manager
public Manager(List<Controller> controllers, String routerTag, String monitoringAddr, int monitoringPort)
Constructor- Parameters:
controllers
- controllers used by managerrouterTag
- tag of router imagemonitoringAddr
- ip address of monitoring servicemonitoringPort
- 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 devicetag
- 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 connectednetwork
- network where device will be connectedcalculatedTopology
- the topology which of networktag
- tag of deviceenvVars
- environment variables passed to the container
-
-