|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.network.NetworkUtil
public class NetworkUtil
Manages the representation of the Tranche network.
| Method Summary | |
|---|---|
static void |
addBannedServerHost(java.lang.String host)
|
static void |
clearLocalServer()
Called by the Server upon shutdown. |
static java.util.Collection<java.lang.String> |
getBannedServerHosts()
|
static Server |
getLocalServer()
Returns the Tranche server running on this JVM, if there is one. |
static StatusTableRow |
getLocalServerRow()
Returns the status row for the Tranche server on this JVM, if there is one. |
static java.util.Collection<java.lang.String> |
getStartupServerURLs()
Returns the collection of startup server URL's. |
static StatusTable |
getStatus()
Returns the master status table for this JVM. |
static boolean |
isBannedServer(java.lang.String host)
|
static boolean |
isStartupServer(java.lang.String host)
Returns whether the given host name is within the list of startup Tranche server URL's. |
static void |
lazyLoad()
Loads the network status from one of the startup servers and calls the ConnectionUtil.adjustConnections() method. |
static void |
reload()
|
static void |
restartUpdateProcess()
Stops and starts the running update process. |
static void |
setBannedServerHosts(java.util.Collection<java.lang.String> serverHosts)
|
static void |
setLocalServer(Server localServer)
Sets the Tranche server for this JVM. |
static void |
setStartupServerURLs(java.util.Collection<java.lang.String> serverURLs)
Clears all the startup server URL's and adds the ones from the given collection of server URL's. |
static void |
updateRow(StatusTableRow row)
Updates the master status table with the given rows except when trying to update the local server row. |
static void |
updateRows(java.util.Collection<StatusTableRow> rows)
Updates the master status table with the given rows except when trying to update the local server row. |
static void |
waitForStartup()
Waits until the network is loaded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setBannedServerHosts(java.util.Collection<java.lang.String> serverHosts)
serverHosts - public static void addBannedServerHost(java.lang.String host)
host - public static java.util.Collection<java.lang.String> getBannedServerHosts()
public static boolean isBannedServer(java.lang.String host)
host -
public static void setStartupServerURLs(java.util.Collection<java.lang.String> serverURLs)
Clears all the startup server URL's and adds the ones from the given collection of server URL's.
serverURLs - A collection of Tranche server URL'spublic static java.util.Collection<java.lang.String> getStartupServerURLs()
Returns the collection of startup server URL's.
public static boolean isStartupServer(java.lang.String host)
Returns whether the given host name is within the list of startup Tranche server URL's.
host - A host name
public static void reload()
public static void waitForStartup()
Waits until the network is loaded.
public static void lazyLoad()
Loads the network status from one of the startup servers and calls the ConnectionUtil.adjustConnections() method.
java.lang.Exceptionpublic static void updateRow(StatusTableRow row)
Updates the master status table with the given rows except when trying to update the local server row.
If the local server row needs to be updated use NetworkUtil.getLocalServerRow().update(NetworkUtil.getLocalServer()) method.
row - A status rowpublic static void updateRows(java.util.Collection<StatusTableRow> rows)
Updates the master status table with the given rows except when trying to update the local server row.
If the local server row needs to be updated use NetworkUtil.getLocalServerRow().update(NetworkUtil.getLocalServer()) method.
rows - A collection of status rowspublic static void restartUpdateProcess()
Stops and starts the running update process.
public static StatusTable getStatus()
Returns the master status table for this JVM.
public static Server getLocalServer()
Returns the Tranche server running on this JVM, if there is one.
public static StatusTableRow getLocalServerRow()
Returns the status row for the Tranche server on this JVM, if there is one. Return NULL if there is no Trache server running on the local JVM.
public static void clearLocalServer()
Called by the Server upon shutdown.
public static void setLocalServer(Server localServer)
Sets the Tranche server for this JVM.
Will set the row in the network status table and load the network, if necessary.
localServer - A local Tranche server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||