org.javagamesfactory.nioservers
Class ServerInfo

java.lang.Object
  extended by org.javagamesfactory.nioservers.ServerInfo
All Implemented Interfaces:
iServerInfo

public class ServerInfo
extends java.lang.Object
implements iServerInfo

Contains all the metadata representing a single server instance


Constructor Summary
ServerInfo(java.lang.String n, java.net.InetAddress isa, int p)
          Creates a new record representing a server
 
Method Summary
 java.net.InetAddress getAddress()
          Address the server is bound to, without socket
 java.lang.String getName()
          Human-readable name of this server
 int getNumConnectedChannels()
          Number of connected clients
 java.net.InetSocketAddress getSocketAddress()
          Address the server is bound to, including socket
 void setNumConnectedChannels(int numConnectedChannels)
          Update the number of connected clients (should be called by the server implementation automatically)
 java.lang.String toString()
          A custom naming convention: "NAME @ ADDRESS:PORT"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerInfo

public ServerInfo(java.lang.String n,
                  java.net.InetAddress isa,
                  int p)
Creates a new record representing a server

Parameters:
n - name of the server
isa - address the server is bound to
p - port the server is bound to
Method Detail

getNumConnectedChannels

public int getNumConnectedChannels()
Number of connected clients

Specified by:
getNumConnectedChannels in interface iServerInfo

setNumConnectedChannels

public void setNumConnectedChannels(int numConnectedChannels)
Update the number of connected clients (should be called by the server implementation automatically)

Specified by:
setNumConnectedChannels in interface iServerInfo

getAddress

public java.net.InetAddress getAddress()
Address the server is bound to, without socket

Specified by:
getAddress in interface iServerInfo

getSocketAddress

public java.net.InetSocketAddress getSocketAddress()
Address the server is bound to, including socket

Specified by:
getSocketAddress in interface iServerInfo

getName

public java.lang.String getName()
Human-readable name of this server

Specified by:
getName in interface iServerInfo

toString

public java.lang.String toString()
A custom naming convention: "NAME @ ADDRESS:PORT"

Overrides:
toString in class java.lang.Object