|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.server.control.UserConnectionHandler
public final class UserConnectionHandler
Handles a new client connection. PreGameInputHandler is set
as the message handler when the client has successfully logged on.
| Field Summary | |
|---|---|
private FreeColServer |
freeColServer
|
private static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
UserConnectionHandler(FreeColServer freeColServer)
The constructor to use. |
|
| Method Summary | |
|---|---|
boolean |
accepts(java.lang.String tagName)
Checks if the message handler support the given message. |
private org.w3c.dom.Element |
disconnect(Connection connection,
org.w3c.dom.Element disconnectElement)
Handles a "disconnect"-message. |
private org.w3c.dom.Element |
getVacantPlayers(Connection connection,
org.w3c.dom.Element element)
Handles a "getVacantPlayers"-request. |
org.w3c.dom.Element |
handle(Connection connection,
org.w3c.dom.Element element)
Handles a network message. |
void |
handle(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
Handles the main element of an XML message. |
private void |
login(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
Handles a "login"-request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.util.logging.Logger logger
private final FreeColServer freeColServer
| Constructor Detail |
|---|
public UserConnectionHandler(FreeColServer freeColServer)
freeColServer - The main control object.| Method Detail |
|---|
public org.w3c.dom.Element handle(Connection connection,
org.w3c.dom.Element element)
handle in interface MessageHandlerconnection - The Connection the message came from.element - The message to be processed.
public void handle(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
handle in interface StreamedMessageHandlerconnection - The connection the message came from.in - The stream containing the message.out - The output stream for the reply.public boolean accepts(java.lang.String tagName)
accepts in interface StreamedMessageHandlertagName - The tag name of the message to check.
private org.w3c.dom.Element getVacantPlayers(Connection connection,
org.w3c.dom.Element element)
connection - The connection the message came from.element - The element containing the request.
private void login(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
connection - The connection the message is comming from.in - The stream with the incoming data.out - The target stream for the reply.
private org.w3c.dom.Element disconnect(Connection connection,
org.w3c.dom.Element disconnectElement)
connection - The Connection the message was received on.disconnectElement - The element (root element in a DOM-parsed XML tree) that
holds all the information.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||