Package net.sf.freecol.common.networking
Class ServerListMessage
- java.lang.Object
-
- net.sf.freecol.common.networking.Message
-
- net.sf.freecol.common.networking.TrivialMessage
-
- net.sf.freecol.common.networking.AttributeMessage
-
- net.sf.freecol.common.networking.ObjectMessage
-
- net.sf.freecol.common.networking.ServerListMessage
-
public final class ServerListMessage extends ObjectMessage
The message sent to query and list the available servers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.freecol.common.networking.Message
Message.MessagePriority
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ServerInfo>
servers
The list of information about the available servers.static java.lang.String
TAG
-
Fields inherited from class net.sf.freecol.common.networking.AttributeMessage
attributes
-
Fields inherited from class net.sf.freecol.common.networking.TrivialMessage
continueMessage, disconnectMessage, endTurnMessage, enterRevengeModeMessage, reconnectMessage, requestLaunchMessage, retireMessage, startGameMessage
-
Fields inherited from class net.sf.freecol.common.networking.Message
logger, messagePriorityComparator
-
-
Constructor Summary
Constructors Constructor Description ServerListMessage()
Create a newServerListMessage
.ServerListMessage(Game game, FreeColXMLReader xr)
Create a newServerListMessage
from a stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerListMessage
addServer(ServerInfo si)
Add information about a server.ServerListMessage
addServers(java.util.List<ServerInfo> lsi)
Add information about several servers.java.util.List<ServerInfo>
getServers()
Get the server information.void
writeChildren(FreeColXMLWriter xw)
Write any children of this message.-
Methods inherited from class net.sf.freecol.common.networking.ObjectMessage
appendChild, appendChildren, getChildCount, getChildren, setChildren
-
Methods inherited from class net.sf.freecol.common.networking.AttributeMessage
canMerge, getPriority, getStringAttribute, getStringAttributeMap, hasAttribute, setMergeable, setStringAttribute
-
Methods inherited from class net.sf.freecol.common.networking.TrivialMessage
aiHandler, clientHandler, currentPlayerMessage, getType, serverHandler, setType
-
Methods inherited from class net.sf.freecol.common.networking.Message
clientGeneric, expected, getArrayAttributes, getBooleanAttribute, getChild, getChildren, getEnumAttribute, getIntegerAttribute, getPriorityLevel, igc, igc, invokeAndWait, invokeLater, isEmpty, isType, merge, pgc, pgc, pretty, read, setArrayAttributes, setArrayAttributes, setBooleanAttribute, setEnumAttribute, setIntegerAttribute, setStringAttributeMap, setStringAttributes, setStringAttributes, toString, toXML, writeAttributes
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
servers
private java.util.List<ServerInfo> servers
The list of information about the available servers.
-
-
Constructor Detail
-
ServerListMessage
public ServerListMessage()
Create a newServerListMessage
. Used to generate a request for servers.
-
ServerListMessage
public ServerListMessage(Game game, FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Create a newServerListMessage
from a stream.- Parameters:
game
- TheGame
, which is null and ignored.xr
- TheFreeColXMLReader
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 classMessage
- Parameters:
xw
- TheFreeColXMLWriter
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
- TheServerInfo
to add.- Returns:
- This message.
-
addServers
public ServerListMessage addServers(java.util.List<ServerInfo> lsi)
Add information about several servers.- Parameters:
lsi
- The list ofServerInfo
to add.- Returns:
- This message.
-
-