Class PortManager


  • public class PortManager
    extends java.lang.Object
    • Constructor Detail

      • PortManager

        public PortManager()
    • Method Detail

      • getInstance

        public static PortManager getInstance()
      • setFirewall

        public void setFirewall​(IFirewall firewall)
        Set a new firewall to obey. This will not clear existing allocations
        Parameters:
        firewall - New firewall rules
      • allocatePort

        public void allocatePort​(Port port)
                          throws PortException
        Allocate a network port for use, while obeying firewall rules
        Parameters:
        port - Network port
        Throws:
        PortException
      • deallocatePort

        public void deallocatePort​(Port port)
        Remove a port from the allocation
        Parameters:
        port - Port to remove
      • isPortAllocated

        public boolean isPortAllocated​(Port port)
        Check if a port is already allocated
        Parameters:
        port - Port to check
        Returns:
        Has it been allocated?
      • canAllocate

        public boolean canAllocate​(Port port)
        Check if the specified network port can be allocated
        Parameters:
        port -
        Returns:
      • allocateFRCPorts

        public void allocateFRCPorts()
        Allocate all FRC-related ports automatically