bootstrapP
Class HumanListener

java.lang.Object
  extended by java.lang.Thread
      extended by bootstrapP.HumanListener
All Implemented Interfaces:
java.lang.Runnable

public class HumanListener
extends java.lang.Thread

The thread that listen for requests by the administrator and performs the correspondent actions.

Author:
Marco Cornolti

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static HumanInterface currentInt
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HumanListener()
           
 
Method Summary
private  void executeAddMS(Command com)
          Performs the "add message server" command.
private  void executeBackup(Command com)
          Performs the "backup" command.
private  void executeBlockAssignation(Command com, boolean block)
          Performs the "block assignation" and "unblock assignation" commands.
private  void executeDeleteUser(Command com)
          Performs the "delete user" command.
private  void executeMoveUser(Command com)
          Performs the "move user" command.
private  void executeRemoveMS(Command com)
          Performs the "remove message server" command.
private  void executeShowAll()
          Performs the "show all" command.
private  void executeShowGlobalStats()
          Performs the "show global statistics" command.
private  void executeShutdown(Command com)
          Performs the "shutdown" command.
private  void executeTestPresence(Command com)
          Performs the "test presence" command.
private  void executeUserList(Command com)
          Performs the "show user list" command.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentInt

public static HumanInterface currentInt
Constructor Detail

HumanListener

public HumanListener()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

executeAddMS

private void executeAddMS(Command com)
Performs the "add message server" command.

Parameters:
com - the command given by the administrator, containing the message server data.

executeDeleteUser

private void executeDeleteUser(Command com)
Performs the "delete user" command.

Parameters:
com - the command given by the administrator, containing the user data.

executeMoveUser

private void executeMoveUser(Command com)
Performs the "move user" command.

Parameters:
com - the command given by the administrator, containing the user nickname and the message server id the user must be moved to.

executeRemoveMS

private void executeRemoveMS(Command com)
Performs the "remove message server" command.

Parameters:
com - the command given by the administrator, containing the message server id.

executeShowAll

private void executeShowAll()
Performs the "show all" command.


executeShowGlobalStats

private void executeShowGlobalStats()
Performs the "show global statistics" command.


executeUserList

private void executeUserList(Command com)
Performs the "show user list" command.

Parameters:
com - the command given by the administrator, containing the id of the message server whose managed users must be shown.

executeTestPresence

private void executeTestPresence(Command com)
Performs the "test presence" command.

Parameters:
com - the command given by the administrator, containing the id of the message server whose presence must be checked.

executeShutdown

private void executeShutdown(Command com)
Performs the "shutdown" command.

Parameters:
com - the command given by the administrator, containing the id of the message server that must be shut down.

executeBlockAssignation

private void executeBlockAssignation(Command com,
                                     boolean block)
Performs the "block assignation" and "unblock assignation" commands.

Parameters:
com - the command given by the administrator, containing the id of the message server whose assignations must be blocked.
block - true if the assignation must be blocked, false if the assignation must be unblocked.

executeBackup

private void executeBackup(Command com)
Performs the "backup" command.

Parameters:
com - the command given by the administrator, containing the file name for the backup.