Class RouterImpl
- java.lang.Object
-
- io.patriot_framework.network.simulator.api.model.devices.router.RouterImpl
-
- All Implemented Interfaces:
Device
,Router
,EnvironmentPart
public class RouterImpl extends Object implements Router
RouterImpl class represents docker container built as router with network-control apis.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description RouterImpl(String name)
Instantiates a new RouterImpl.RouterImpl(String name, String creator)
RouterImpl(String name, String creator, boolean corner)
RouterImpl(String name, List<NetworkInterface> networkInterfaces)
Instantiates a new RouterImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAddressForNetwork(String address, String networkName)
boolean
equals(Object o)
String
getAddressForNetwork(String networkName)
List<Network>
getConnectedNetworks()
Gets connected networks.List<Network>
getConnectedTopologyNetworks()
Gets connected networks.String
getCreator()
Returns creator identifier of env part.List<NetworkInterface>
getInterfaces()
Returns physical network interfaces of router.String
getIPAddress()
Gets ip address.String
getManagementIP()
Gets mng ip.Integer
getManagementPort()
Gets mng port.String
getName()
Gets name.List<NetworkInterface>
getNetworkInterfaces()
Gets network interfaces.int
hashCode()
Boolean
isCorner()
Returns if this router is last step to internet in current LAN.void
setConnectedTopologyNetworks(List<Network> connectedTopologyNetworks)
Sets connected networks.void
setCorner(Boolean corner)
void
setCreator(String creator)
void
setIPAddress(String ipAddress)
Sets ip address.void
setManagementIP(String managementIP)
Sets mng ip.void
setManagementPort(Integer managementPort)
Sets mng port.void
setName(String name)
Sets name.void
setNetworkInterfaces(List<NetworkInterface> networkInterfaces)
Sets network interfaces.
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RouterImpl
public RouterImpl(String name)
Instantiates a new RouterImpl.- Parameters:
name
- the name
-
RouterImpl
public RouterImpl(String name, List<NetworkInterface> networkInterfaces)
Instantiates a new RouterImpl.- Parameters:
name
- the namenetworkInterfaces
- the network interfaces
-
-
Method Detail
-
getName
public String getName()
Gets name.
-
getInterfaces
public List<NetworkInterface> getInterfaces()
Description copied from interface:Router
Returns physical network interfaces of router.- Specified by:
getInterfaces
in interfaceRouter
- Returns:
- list of connected interfaces
-
getIPAddress
public String getIPAddress()
Description copied from interface:Device
Gets ip address.- Specified by:
getIPAddress
in interfaceDevice
- Returns:
- the ip address
-
setIPAddress
public void setIPAddress(String ipAddress)
Description copied from interface:Device
Sets ip address.- Specified by:
setIPAddress
in interfaceDevice
- Parameters:
ipAddress
- the ip address
-
getConnectedNetworks
public List<Network> getConnectedNetworks()
Description copied from interface:Device
Gets connected networks.- Specified by:
getConnectedNetworks
in interfaceDevice
- Returns:
- the connected networks
-
setName
public void setName(String name)
Sets name.- Parameters:
name
- the name
-
getNetworkInterfaces
public List<NetworkInterface> getNetworkInterfaces()
Gets network interfaces.- Returns:
- the network interfaces
-
setNetworkInterfaces
public void setNetworkInterfaces(List<NetworkInterface> networkInterfaces)
Sets network interfaces.- Specified by:
setNetworkInterfaces
in interfaceRouter
- Parameters:
networkInterfaces
- the network interfaces
-
getConnectedTopologyNetworks
public List<Network> getConnectedTopologyNetworks()
Gets connected networks.- Returns:
- the connected networks
-
setConnectedTopologyNetworks
public void setConnectedTopologyNetworks(List<Network> connectedTopologyNetworks)
Sets connected networks.- Parameters:
connectedTopologyNetworks
- the connected networks
-
getManagementIP
public String getManagementIP()
Gets mng ip.- Returns:
- the mng ip
-
setManagementIP
public void setManagementIP(String managementIP)
Sets mng ip.- Parameters:
managementIP
- the mng ip
-
getManagementPort
public Integer getManagementPort()
Gets mng port.- Specified by:
getManagementPort
in interfaceDevice
- Returns:
- the mng port
-
setManagementPort
public void setManagementPort(Integer managementPort)
Sets mng port.- Specified by:
setManagementPort
in interfaceDevice
- Parameters:
managementPort
- the mng port
-
isCorner
public Boolean isCorner()
Description copied from interface:Router
Returns if this router is last step to internet in current LAN.
-
setCorner
public void setCorner(Boolean corner)
-
getCreator
public String getCreator()
Description copied from interface:EnvironmentPart
Returns creator identifier of env part.- Specified by:
getCreator
in interfaceEnvironmentPart
- Returns:
- creator of this object
-
setCreator
public void setCreator(String creator)
-
getAddressForNetwork
public String getAddressForNetwork(String networkName)
- Specified by:
getAddressForNetwork
in interfaceDevice
-
addAddressForNetwork
public boolean addAddressForNetwork(String address, String networkName)
- Specified by:
addAddressForNetwork
in interfaceDevice
-
-