Class 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.
    • Constructor Detail

      • RouterImpl

        public RouterImpl​(String name)
        Instantiates a new RouterImpl.
        Parameters:
        name - the name
      • RouterImpl

        public RouterImpl​(String name,
                          String creator)
      • RouterImpl

        public RouterImpl​(String name,
                          List<NetworkInterface> networkInterfaces)
        Instantiates a new RouterImpl.
        Parameters:
        name - the name
        networkInterfaces - the network interfaces
      • RouterImpl

        public RouterImpl​(String name,
                          String creator,
                          boolean corner)
    • Method Detail

      • getName

        public String getName()
        Gets name.
        Specified by:
        getName in interface Device
        Returns:
        the name
      • getInterfaces

        public List<NetworkInterface> getInterfaces()
        Description copied from interface: Router
        Returns physical network interfaces of router.
        Specified by:
        getInterfaces in interface Router
        Returns:
        list of connected interfaces
      • getIPAddress

        public String getIPAddress()
        Description copied from interface: Device
        Gets ip address.
        Specified by:
        getIPAddress in interface Device
        Returns:
        the ip address
      • setIPAddress

        public void setIPAddress​(String ipAddress)
        Description copied from interface: Device
        Sets ip address.
        Specified by:
        setIPAddress in interface Device
        Parameters:
        ipAddress - the ip address
      • getConnectedNetworks

        public List<Network> getConnectedNetworks()
        Description copied from interface: Device
        Gets connected networks.
        Specified by:
        getConnectedNetworks in interface Device
        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 interface Router
        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
      • setManagementPort

        public void setManagementPort​(Integer managementPort)
        Sets mng port.
        Specified by:
        setManagementPort in interface Device
        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.
        Specified by:
        isCorner in interface Router
        Returns:
        true if router is on border, false otherwise
      • setCorner

        public void setCorner​(Boolean corner)
      • setCreator

        public void setCreator​(String creator)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object