|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Integer,Server>
mapping.data.ServersTable
public class ServersTable
This class represents the collection of servers in the system. It was implemented as a Hashtable. This class is thread safe.
| Constructor Summary | |
|---|---|
ServersTable()
|
|
ServersTable(int initialCapacity)
|
|
ServersTable(int initialCapacity,
float loadFactor)
|
|
| Method Summary | |
|---|---|
void |
addServer(Server server)
This method adds a Server object to the table and gives it its unique ID. |
void |
addServersListener(ServersTableListener listener)
Adds a listener to this object. |
void |
clearServerActiveJobsNumber(int serverID)
|
double |
getFailurePeriodsMeanOfAllServersInMinutes()
|
Server |
getServer(java.lang.String hostname)
|
double |
getUpTimeMeanOfAllServersInMinutes()
|
boolean |
isServerDown(int serverID)
|
void |
printAll()
|
void |
removeServer(int id)
This method removes a server with ID id and reorders the servers. |
void |
setServerDown(int serverID,
boolean down)
This method set the server of ID serverID to down. |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServersTable()
public ServersTable(int initialCapacity)
public ServersTable(int initialCapacity,
float loadFactor)
| Method Detail |
|---|
public void addServersListener(ServersTableListener listener)
listener - The listener to be added.public void printAll()
public void addServer(Server server)
server - the server to be added.public Server getServer(java.lang.String hostname)
hostname - The hostname of the machine being sought.
public void removeServer(int id)
id - The id of the server to be deleted.public boolean isServerDown(int serverID)
serverID - The ID of the server in subject.
public void setServerDown(int serverID,
boolean down)
serverID - The ID of the server in subject.down - A boolean value determining wheather the server is down or not.public void clearServerActiveJobsNumber(int serverID)
serverID - The ID of the server in subject.public double getFailurePeriodsMeanOfAllServersInMinutes()
Server.clearActiveJobsNumber()public double getUpTimeMeanOfAllServersInMinutes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||