Class ServerListMessage


  • public final class ServerListMessage
    extends ObjectMessage
    The message sent to query and list the available servers.
    • Field Detail

      • servers

        private java.util.List<ServerInfo> servers
        The list of information about the available servers.
    • Constructor Detail

      • ServerListMessage

        public ServerListMessage()
        Create a new ServerListMessage. Used to generate a request for servers.
      • ServerListMessage

        public ServerListMessage​(Game game,
                                 FreeColXMLReader xr)
                          throws javax.xml.stream.XMLStreamException
        Create a new ServerListMessage from a stream.
        Parameters:
        game - The Game, which is null and ignored.
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem reading the stream.
    • Method Detail

      • writeChildren

        public void writeChildren​(FreeColXMLWriter xw)
                           throws javax.xml.stream.XMLStreamException
        Write any children of this message.
        Overrides:
        writeChildren in class Message
        Parameters:
        xw - The FreeColXMLWriter to write to.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem writing the stream.
      • getServers

        public java.util.List<ServerInfo> getServers()
        Get the server information.
        Returns:
        The list of ServerInfo.
      • addServer

        public ServerListMessage addServer​(ServerInfo si)
        Add information about a server.
        Parameters:
        si - The ServerInfo to add.
        Returns:
        This message.
      • addServers

        public ServerListMessage addServers​(java.util.List<ServerInfo> lsi)
        Add information about several servers.
        Parameters:
        lsi - The list of ServerInfo to add.
        Returns:
        This message.