org.xnap.plugin.opennap.net
Class OpenNapServerManager

java.lang.Object
  extended by org.xnap.plugin.opennap.net.OpenNapServerManager
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class OpenNapServerManager
extends java.lang.Object
implements java.beans.PropertyChangeListener


Nested Class Summary
 class OpenNapServerManager.AutoConnector
           
 class OpenNapServerManager.PostLoginRunner
           
 
Field Summary
protected  ListSupport ls
           
 
Constructor Summary
OpenNapServerManager()
           
 
Method Summary
 boolean add(OpenNapServer server, boolean login)
          Adds server if it is not already in the list.
 boolean add(java.lang.String url, java.lang.String network, boolean login)
           
 int addFrom(OpenNapServerReader reader, boolean temporary)
          Returns the number of servers that were added.
 void addListListener(ListListener listener)
          listener is notified when a server is added or removed.
 void addStatsListener(StatusListener listener)
          listener is notified when a server is added or removed.
 void changeNetwork(OpenNapServer server, java.lang.String newNetworkName)
           
 void die()
           
 void fetchServerLists()
           
 int getConnectedCount()
           
 OpenNapServer[] getConnectedServers()
           
 OpenNapServerManager.AutoConnector getConnector()
           
 OpenNapNetwork getNetworkByName(java.lang.String name)
           
 OpenNapServer getServerByHost(java.lang.String host)
           
 OpenNapServer[] getServers()
           
 java.lang.String getStats()
          Returns the stats that were calculated during the last call to updateStats().
 void init()
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void remove(OpenNapServer server)
           
 void removeAll()
           
 void removeListListener(ListListener listener)
           
 void removeStatsListener(StatusListener listener)
           
 int saveTo(OpenNapServerWriter writer)
           
 int saveTo(OpenNapServerWriter writer, boolean temporary)
           
 void setAutoFetchInterval(long interval)
          Sets the interval for the auto fetch task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ls

protected ListSupport ls
Constructor Detail

OpenNapServerManager

public OpenNapServerManager()
Method Detail

addListListener

public void addListListener(ListListener listener)
listener is notified when a server is added or removed.


removeListListener

public void removeListListener(ListListener listener)

addStatsListener

public void addStatsListener(StatusListener listener)
listener is notified when a server is added or removed.


removeStatsListener

public void removeStatsListener(StatusListener listener)

add

public boolean add(java.lang.String url,
                   java.lang.String network,
                   boolean login)

add

public boolean add(OpenNapServer server,
                   boolean login)
Adds server if it is not already in the list.

Returns:
true, if the server was added; false, otherwise

addFrom

public int addFrom(OpenNapServerReader reader,
                   boolean temporary)
            throws java.io.IOException
Returns the number of servers that were added.

Throws:
java.io.IOException

die

public void die()

fetchServerLists

public void fetchServerLists()

remove

public void remove(OpenNapServer server)

removeAll

public void removeAll()

getServerByHost

public OpenNapServer getServerByHost(java.lang.String host)

getConnector

public OpenNapServerManager.AutoConnector getConnector()

getConnectedCount

public int getConnectedCount()

getConnectedServers

public OpenNapServer[] getConnectedServers()

getNetworkByName

public OpenNapNetwork getNetworkByName(java.lang.String name)

getServers

public OpenNapServer[] getServers()

getStats

public java.lang.String getStats()
Returns the stats that were calculated during the last call to updateStats().


init

public void init()

changeNetwork

public void changeNetwork(OpenNapServer server,
                          java.lang.String newNetworkName)

saveTo

public int saveTo(OpenNapServerWriter writer,
                  boolean temporary)
           throws java.io.IOException
Throws:
java.io.IOException

saveTo

public int saveTo(OpenNapServerWriter writer)
           throws java.io.IOException
Throws:
java.io.IOException

setAutoFetchInterval

public void setAutoFetchInterval(long interval)
Sets the interval for the auto fetch task.

Parameters:
interval - the auto fetch interval in milli seconds; if <= 0, auto fetching is disabled

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener


Copyright © 2001-2005 XNap Team. All Rights Reserved.