feud.clientserver
Class ClientInfo

java.lang.Object
  extended byfeud.clientserver.ClientInfo

public class ClientInfo
extends java.lang.Object

A server side wrapper that identifies a connected client.


Field Summary
static long TIMEOUT
          A time out value after which a client is considered to be lost.
 
Constructor Summary
ClientInfo(java.net.InetAddress addr, int port)
          Create a new ClientInfo.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.net.InetAddress getAddress()
          Returns the client's address.
 int getID()
          Returns the client's ID.
 int getPort()
          Returns the client's port.
 boolean getZipMode()
          Returns if the client uses zip mode or not.
 int hashCode()
           
 boolean isLoggedOut()
          Indicates that the client has been logged out either by its own request or by the server.
 boolean isLost()
          Is the client lost?
 void logout()
          Marks the client as logged out.
 void setZipMode(boolean mode)
          Sets if the client uses zip mode or not.
 java.lang.String toString()
           
 void touch()
          "Touches" the client, i.e. make sure that it's not getting "lost".
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TIMEOUT

public static final long TIMEOUT
A time out value after which a client is considered to be lost.

See Also:
Constant Field Values
Constructor Detail

ClientInfo

public ClientInfo(java.net.InetAddress addr,
                  int port)
Create a new ClientInfo.

Parameters:
addr - the client's address
port - the client's port
Method Detail

setZipMode

public void setZipMode(boolean mode)
Sets if the client uses zip mode or not.

Parameters:
mode - does it?

getZipMode

public boolean getZipMode()
Returns if the client uses zip mode or not.

Returns:
boolean does it?

getID

public int getID()
Returns the client's ID. The ID is unique per server.

Returns:
int the ID

touch

public void touch()
"Touches" the client, i.e. make sure that it's not getting "lost". This not all not based on actual client state but on time only.


isLost

public boolean isLost()
Is the client lost?

Returns:
boolean is it?

getAddress

public java.net.InetAddress getAddress()
Returns the client's address.

Returns:
InetAddress the address

getPort

public int getPort()
Returns the client's port.

Returns:
int the port

isLoggedOut

public boolean isLoggedOut()
Indicates that the client has been logged out either by its own request or by the server.

Returns:
boolean logged out?

logout

public void logout()
Marks the client as logged out.


toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()