cluster5.server.managers
Class TerminalManager

java.lang.Object
  extended by cluster5.server.managers.TerminalManager

public class TerminalManager
extends java.lang.Object


Method Summary
 void announceTerminalDown(java.lang.Long terminalId)
          Announces that a terminal is down.
 java.lang.Long announceTerminalUp(Terminal connectingTerminal)
          Gets/creates a terminal info, sets new information, sets status to CONNECTED, updates the last seen field to current date and saves it into the database.
static TerminalManager getInstance()
           
 void recordCpuTime(java.lang.Long terminalId, long cpuTime)
          Records CPU time and number of tasks processed by this terminal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TerminalManager getInstance()

announceTerminalUp

public java.lang.Long announceTerminalUp(Terminal connectingTerminal)
Gets/creates a terminal info, sets new information, sets status to CONNECTED, updates the last seen field to current date and saves it into the database.

Parameters:
connectingTerminal -
Returns:
ID of a terminal

announceTerminalDown

public void announceTerminalDown(java.lang.Long terminalId)
Announces that a terminal is down. All tasks being currently processed by this terminal are set to NEW state so other terminals can start processing them.

Parameters:
terminalId -

recordCpuTime

public void recordCpuTime(java.lang.Long terminalId,
                          long cpuTime)
Records CPU time and number of tasks processed by this terminal.

Parameters:
terminalId -
cpuTime -