games.strategy.engine.lobby.client.login
Class LobbyServerProperties

java.lang.Object
  extended by games.strategy.engine.lobby.client.login.LobbyServerProperties

public class LobbyServerProperties
extends java.lang.Object

Server properties.

Generally there is one lobby server, but that server may move.

To keep track of this, we always have a properties file in a constant location that points to the current lobby server.

The properties file may indicate that the server is not available using the ERROR_MESSAGE key.

Author:
sgb

Constructor Summary
LobbyServerProperties(java.util.Properties props)
           
LobbyServerProperties(java.lang.String host, int port, java.lang.String serverErrorMessage, java.lang.String serverMessage)
           
LobbyServerProperties(java.net.URL url)
          Read the server properties from a given url.
 
Method Summary
 java.lang.String getHost()
           
 int getPort()
           
 java.lang.String getServerErrorMessage()
           
 java.lang.String getServerMessage()
           
 boolean isDone()
           
 boolean isServerAvailable()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LobbyServerProperties

public LobbyServerProperties(java.lang.String host,
                             int port,
                             java.lang.String serverErrorMessage,
                             java.lang.String serverMessage)

LobbyServerProperties

public LobbyServerProperties(java.net.URL url)
Read the server properties from a given url. If an error occurs during read, then ErrorMessage will be populated.


LobbyServerProperties

public LobbyServerProperties(java.util.Properties props)
Method Detail

isDone

public boolean isDone()

getHost

public java.lang.String getHost()

getPort

public int getPort()

getServerErrorMessage

public java.lang.String getServerErrorMessage()
Returns:
the error message for the server.

isServerAvailable

public boolean isServerAvailable()
Returns:
if the server is available. If the server is not available then getServerErrorMessage will give a reason.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getServerMessage

public java.lang.String getServerMessage()