Package net.sf.freecol.common.networking
Class ServerInfoMessage
- 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.ServerInfoMessage
-
- Direct Known Subclasses:
RegisterServerMessage
,RemoveServerMessage
,UpdateServerMessage
public class ServerInfoMessage extends AttributeMessage
The type of message that contains server information.
-
-
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 static java.lang.String
ADDRESS_TAG
private static java.lang.String
CURRENTLY_PLAYING_TAG
private static java.lang.String
GAME_STATE_TAG
private static java.lang.String
IS_GAME_STARTED_TAG
private static java.lang.String
NAME_TAG
private static java.lang.String
PORT_TAG
private static java.lang.String
SLOTS_AVAILABLE_TAG
private static java.lang.String
VERSION_TAG
-
Fields inherited from class net.sf.freecol.common.networking.AttributeMessage
attributes, TAG
-
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 Modifier Constructor Description protected
ServerInfoMessage(java.lang.String tag, ServerInfo si)
Create a newServerInfoMessage
.ServerInfoMessage(java.lang.String tag, Game game, FreeColXMLReader xr)
Create a newServerInfoMessage
from a stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAddress()
Get the address.int
getPort()
Get the port.ServerInfo
getServerInfo()
Get the server information encapsulated in this message.void
setAddress(java.lang.String address)
Override the address attribute.-
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, appendChild, appendChildren, clientHandler, currentPlayerMessage, getChildCount, getChildren, getType, serverHandler, setChildren, 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, writeChildren
-
-
-
-
Field Detail
-
ADDRESS_TAG
private static final java.lang.String ADDRESS_TAG
- See Also:
- Constant Field Values
-
CURRENTLY_PLAYING_TAG
private static final java.lang.String CURRENTLY_PLAYING_TAG
- See Also:
- Constant Field Values
-
GAME_STATE_TAG
private static final java.lang.String GAME_STATE_TAG
- See Also:
- Constant Field Values
-
IS_GAME_STARTED_TAG
private static final java.lang.String IS_GAME_STARTED_TAG
- See Also:
- Constant Field Values
-
NAME_TAG
private static final java.lang.String NAME_TAG
- See Also:
- Constant Field Values
-
PORT_TAG
private static final java.lang.String PORT_TAG
- See Also:
- Constant Field Values
-
SLOTS_AVAILABLE_TAG
private static final java.lang.String SLOTS_AVAILABLE_TAG
- See Also:
- Constant Field Values
-
VERSION_TAG
private static final java.lang.String VERSION_TAG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServerInfoMessage
protected ServerInfoMessage(java.lang.String tag, ServerInfo si)
Create a newServerInfoMessage
.- Parameters:
tag
- The tag for this message.si
- TheServerInfo
to encapsulate.
-
ServerInfoMessage
public ServerInfoMessage(java.lang.String tag, Game game, FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Create a newServerInfoMessage
from a stream.- Parameters:
tag
- The actual message tag.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
-
getServerInfo
public ServerInfo getServerInfo()
Get the server information encapsulated in this message.- Returns:
- The
ServerInfo
found.
-
getAddress
public java.lang.String getAddress()
Get the address.- Returns:
- The address attribute.
-
setAddress
public void setAddress(java.lang.String address)
Override the address attribute.- Parameters:
address
- The new address.
-
getPort
public int getPort()
Get the port.- Returns:
- The port attribute.
-
-