org.cybergarage.http

## Class HTTPServerList

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.Vector<HTTPServer>
      - - org.cybergarage.http.HTTPServerList

- All Implemented Interfaces:
    Serializable, Cloneable, Iterable<HTTPServer>, Collection<HTTPServer>, List<HTTPServer>, RandomAccess

      public class HTTPServerList
      extends Vector<HTTPServer>

  A collection of HTTPServer instances that extends Vector. This class manages multiple HTTP servers, allowing them to be started, stopped, and configured as a group.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.Vector

      `capacityIncrement, elementCount, elementData`

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPServerList()` Creates a new empty HTTPServerList.
    `HTTPServerList(InetAddress[] list, int port)` Creates a new HTTPServerList with specified bind addresses and port.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRequestListener(HTTPRequestListener listener)` Adds a request listener to all HTTP servers in this list.
    `void` | `close()` Closes all HTTP servers in this list.
    `HTTPServer` | `getHTTPServer(int n)` Gets the HTTPServer at the specified index.
    `int` | `open()` Opens HTTP servers on all configured bind addresses.
    `boolean` | `open(int port)` Opens HTTP servers on the specified port.
    `void` | `start()` Starts all HTTP servers in this list.
    `void` | `stop()` Stops all HTTP servers in this list.

    - ### Methods inherited from class java.util.Vector

      `add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Constructor Detail

    - #### HTTPServerList

          public HTTPServerList()

      Creates a new empty HTTPServerList.

    - #### HTTPServerList

          public HTTPServerList(InetAddress[] list,
                                int port)

      Creates a new HTTPServerList with specified bind addresses and port.
      Parameters:
        `list` - array of InetAddress objects to bind to
        `port` - the port number for all servers

  - ### Method Detail

    - #### addRequestListener

          public void addRequestListener(HTTPRequestListener listener)

      Adds a request listener to all HTTP servers in this list.
      Parameters:
        `listener` - the request listener to add

    - #### close

          public void close()

      Closes all HTTP servers in this list.

    - #### getHTTPServer

          public HTTPServer getHTTPServer(int n)

      Gets the HTTPServer at the specified index.
      Parameters:
        `n` - the index of the server to retrieve
      Returns:
        the HTTPServer at the specified index

    - #### open

          public int open()

      Opens HTTP servers on all configured bind addresses. If no bind addresses are specified, uses I2P local addresses.
      Returns:
        the number of successfully opened servers

    - #### open

          public boolean open(int port)

      Opens HTTP servers on the specified port.
      Parameters:
        `port` - the port number to use
      Returns:
        true if at least one server was opened successfully

    - #### start

          public void start()

      Starts all HTTP servers in this list.

    - #### stop

          public void stop()

      Stops all HTTP servers in this list.