network
Class IPServer

java.lang.Object
  extended bynetwork.IPServer
All Implemented Interfaces:
java.util.EventListener, NetworkListener

public class IPServer
extends java.lang.Object
implements NetworkListener

A client whose sole purpose is to dish out IP addresses. IPServer sends no messages, nor receives any. IPServer doesn't actively look for neighbors, but just sits and waits. IPServer can also act as a hub for messeges.

Author:
hoele

Field Summary
static java.lang.String IP_SERVER
           
static java.lang.String IS_IP_SERVER
           
 
Constructor Summary
IPServer(java.lang.String name)
          Creates a new IPServer and starts it.
 
Method Summary
 void channelAdded(ChannelListEvent event)
           
 void channelRemoved(ChannelListEvent event)
           
static void main(java.lang.String[] args)
          Creates and starts an IPServer with name args[0] or "ipserver" by default.
 void messageReceived(MessageReceivedEvent event)
          We should never recieve messages, so this does nothing.
 void neighborConnected(NeighborConnectedEvent event)
           
 void uniformChannelAdded(ChannelListEvent event)
           
 void uniformChannelRemoved(ChannelListEvent event)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IP_SERVER

public static final java.lang.String IP_SERVER
See Also:
Constant Field Values

IS_IP_SERVER

public static final java.lang.String IS_IP_SERVER
See Also:
Constant Field Values
Constructor Detail

IPServer

public IPServer(java.lang.String name)
Creates a new IPServer and starts it.

Parameters:
name - The name of the IPServer. Essentially, this is the name of the folder where the IPServers information will be stored.
Method Detail

main

public static void main(java.lang.String[] args)
Creates and starts an IPServer with name args[0] or "ipserver" by default.

Parameters:
args - The name of the IPServer in args[0].

messageReceived

public void messageReceived(MessageReceivedEvent event)
We should never recieve messages, so this does nothing.

Specified by:
messageReceived in interface NetworkListener
Parameters:
event - The event that should never be thrown.

neighborConnected

public void neighborConnected(NeighborConnectedEvent event)
Specified by:
neighborConnected in interface NetworkListener

channelAdded

public void channelAdded(ChannelListEvent event)
Specified by:
channelAdded in interface NetworkListener

channelRemoved

public void channelRemoved(ChannelListEvent event)
Specified by:
channelRemoved in interface NetworkListener

uniformChannelAdded

public void uniformChannelAdded(ChannelListEvent event)
Specified by:
uniformChannelAdded in interface NetworkListener

uniformChannelRemoved

public void uniformChannelRemoved(ChannelListEvent event)
Specified by:
uniformChannelRemoved in interface NetworkListener