org.xnap.plugin.opennap.net
Class OpenNapServerManager
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ls
protected ListSupport ls
OpenNapServerManager
public OpenNapServerManager()
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.