Class PortsImpl

  • All Implemented Interfaces:
    Ports

    @Service
    public class PortsImpl
    extends Object
    implements Ports
    Author:
    Jerome Dochez
    • Constructor Detail

      • PortsImpl

        public PortsImpl()
    • Method Detail

      • createPort

        public Port createPort​(int number)
                        throws IOException
        Description copied from interface: Ports
        Creates a port, binds it to a port number and returns it
        Specified by:
        createPort in interface Ports
        Parameters:
        number - the port number
        Returns:
        the bound port to the port number
        Throws:
        IOException - if the port is already taken or another network exception occurs
      • getPorts

        public Collection<Port> getPorts()
        Description copied from interface: Ports
        Returns the list of allocated ports
        Specified by:
        getPorts in interface Ports
        Returns:
        the allocated ports
      • remove

        public void remove​(Port port)