bootstrapP
Interface HumanInterface

All Known Implementing Classes:
TextualInterfaceIt

public interface HumanInterface

The interface that represents an interaction with a human (the server admin).

Author:
Marco Cornolti

Method Summary
 void destroy()
          Called when the interface must be terminated.
 Command getCommand()
          Gets the next command to execute from the interface.
 void initialize()
          Initialize the interface.
 void showBackupDone()
          Called when the main backupper ends.
 void showBackupFailed()
          Called when a backupper unit failed to backup.
 void showBackupFileStart(java.lang.String filename)
          Called when a file backupper starts.
 void showBackupStart()
          Called when a backupper unit starts.
 void showCouldNotBackupMS(java.lang.String hostname, int RMIport, int UDPport)
          Called when a backup problem occurred and a MS could not be saved.
 void showCouldNotBackupUser(java.lang.String nickname)
          Called when a backup problem occurred and a User could not be saved.
 void showCouldNotContactMS(java.lang.String hostname, int udpPort, int rmiPort)
          Called when a Message Server could not be contacted.
 void showCouldNotRemoveBackuppedMS(java.lang.String hostName, int RMIport, int UDPport)
          Called when a backup problem occurred and a MS could not be removed.
 void showCouldNotRemoveBackuppedUser(java.lang.String nick)
          Called when a backup problem occurred and a User could not be removed.
 void showCouldNotShutdownUnblockedMS(int id1)
          Called when a MS cannot shutdown because it is not blocked.
 void showGlobalMSStats(int mss, long minFreeMem, int minFreeMemI, java.lang.String canonicalHostName, long maxFreeMem, int maxFreeMemI, java.lang.String canonicalHostName2, int minManUsers, int minManUsersI, java.lang.String canonicalHostName3, int maxManUsers, int maxManUsersI, java.lang.String canonicalHostName4, long fwMsgs, long onlineUsers, long queuedMsgs)
          Called when some global statistics must be shown.
 void showIllegalArgument(java.lang.String hostname, int port, int port2)
          Called when some given data are not right.
 void showMSAdded(java.lang.String canonicalHostName, int udpPort, int rmiPort)
          Called when a MS is added.
 void showMSAlreadyInseted()
          Called when the admin tried to add an already added message server.
 void showMSBlocked(int id1)
          Called when a MS is blocked.
 void showMSCommunicationProblem(int id1)
          Called when a communication problem with a MS occurred.
 void showMSGenericError(int ms1i)
          Called when a generic error occurred in the message server.
 void showMSNotRemoved(int id1)
          Called when a MS cannot be removed.
 void showMSRemoved(int id1)
          Called when a MS has been removed.
 void showMSShutdownDone(int id1)
          Called when a MS Shutdown is done correctly.
 void showMSShutdownFailedUsersPresent(int id1)
          Called when a MS cannot shutdown because some users are still assigned to it.
 void showMSUnblocked(int id1)
          Called when a MS is not blocked.
 void showMSUnknown(java.lang.String hostAddress, int port)
          Called when an udp packet from an unknown Message server is received.
 void showMSUserNotAccepted(int ms1i, java.lang.String nick)
          Called when a MS does not accept a user assignation.
 void showReceivedLoad(java.lang.String hostname, int freeMem, int fwdMess)
          Called when a MS load is received.
 void showReceivedLoadFailed()
          Called when a load could not be received.
 void showSingleMSStats(int id, java.lang.String canonicalHostName, int RMIport, int UDPport, int cacheEntries, long freeMem, long load, int forwardedMessagesMinute, int forwardedMessagesHour, int forwardedMessages24Hours, int forwardedMessages144Hours, int managedUsers, int onlineManagedUsers, int queuedMessageNumber)
          Called when a single server statistics must be shown.
 void showStatistics(long upTime, int usersNumber, int MSnumber)
          Called when some statistics has to be shown.
 void showTestPresenceDone(int id1)
          Called when a presence test for a MS is done correctly.
 void showTestPresenceFailed(int id1)
          Called when a presence test for a MS failed.
 void showUDPProblem()
          Called when an UDP problem occurred.
 void showUserDeleted(java.lang.String nick)
          Called when a user was successfully deleted.
 void showUserList(int id1, java.lang.String userStr)
          Shows a list of users managed by a message server.
 void showUserMoved(java.lang.String nick)
          Called when a user has been successfully moved.
 void showUserMoveSameDest(java.lang.String nick)
          Called when somebody is trying to move a user from a server to its server.
 void showUserNotDeleted(java.lang.String nick)
          Called when a user could not be deleted.
 void showUserNotExists(java.lang.String nick)
          Called when a user does not exist.
 void showUserNotManaged(int managerMSi, java.lang.String user)
          Called when a user is not managed by a Message server.
 void showUserNotMoved(java.lang.String nick)
          Called when a user could not be moved.
 void showWrongMSId(int id1)
          Called when a MS id is not correct.
 void showWrongMSPassword(int id1)
          Called when a Message server password is wrong.
 void showWrongMSPassword(java.lang.String canonicalHostName, int udpPort, int rmiPort)
          Called when a Message server password is wrong.
 

Method Detail

getCommand

Command getCommand()
Gets the next command to execute from the interface.

Returns:
the command to execute.

initialize

void initialize()
Initialize the interface.


showReceivedLoad

void showReceivedLoad(java.lang.String hostname,
                      int freeMem,
                      int fwdMess)
Called when a MS load is received.

Parameters:
hostname - the sender hostname.
freeMem - the free memory.
fwdMess - the forwarded messages.

showMSNotRemoved

void showMSNotRemoved(int id1)
Called when a MS cannot be removed.

Parameters:
id1 - the id of the MS that could not be removed.

showMSRemoved

void showMSRemoved(int id1)
Called when a MS has been removed.

Parameters:
id1 - the id of the removed message server.

showUserNotMoved

void showUserNotMoved(java.lang.String nick)
Called when a user could not be moved.

Parameters:
nick - the user nickname.

showUserMoved

void showUserMoved(java.lang.String nick)
Called when a user has been successfully moved.

Parameters:
nick - the user nickname.

showUserNotDeleted

void showUserNotDeleted(java.lang.String nick)
Called when a user could not be deleted.

Parameters:
nick - the user nickname

showUserDeleted

void showUserDeleted(java.lang.String nick)
Called when a user was successfully deleted.

Parameters:
nick - the user nickname

showUserNotExists

void showUserNotExists(java.lang.String nick)
Called when a user does not exist.

Parameters:
nick - the user nickname

showCouldNotContactMS

void showCouldNotContactMS(java.lang.String hostname,
                           int udpPort,
                           int rmiPort)
Called when a Message Server could not be contacted.

Parameters:
hostname - the MS hostname.
udpPort - the MS UDP port.
rmiPort - the MS RMI port.

showUDPProblem

void showUDPProblem()
Called when an UDP problem occurred.


showStatistics

void showStatistics(long upTime,
                    int usersNumber,
                    int MSnumber)
Called when some statistics has to be shown.

Parameters:
upTime - the local server uptime.
usersNumber - the number of currently registered users.
MSnumber - the number of registered message servers.

showGlobalMSStats

void showGlobalMSStats(int mss,
                       long minFreeMem,
                       int minFreeMemI,
                       java.lang.String canonicalHostName,
                       long maxFreeMem,
                       int maxFreeMemI,
                       java.lang.String canonicalHostName2,
                       int minManUsers,
                       int minManUsersI,
                       java.lang.String canonicalHostName3,
                       int maxManUsers,
                       int maxManUsersI,
                       java.lang.String canonicalHostName4,
                       long fwMsgs,
                       long onlineUsers,
                       long queuedMsgs)
Called when some global statistics must be shown.

Parameters:
mss - total number of Message Servers.
minFreeMem - the minimum free memory in a single server.
minFreeMemI - the id of the server with the minimum free memory.
canonicalHostName - the hostname of the server with the minimum free memory.
maxFreeMem - the maximum free memory in a single server.
maxFreeMemI - the id of the server with the maximum free memory.
canonicalHostName2 - the hostname of the server with the maximum free memory.
minManUsers - the minimum managed users in a single server.
minManUsersI - the id of the server with the minimum managed users.
canonicalHostName3 - the hostname of the server with the minimum managed users.
maxManUsers - the maximum managed users in a single server.
maxManUsersI - the id of the server with the maximum managed users.
canonicalHostName4 - the hostname of the server with the maximum managed users.
fwMsgs - the totally forwarded messages.
onlineUsers - the estimate online users.
queuedMsgs - the number of messages stored in the message servers queues.

showSingleMSStats

void showSingleMSStats(int id,
                       java.lang.String canonicalHostName,
                       int RMIport,
                       int UDPport,
                       int cacheEntries,
                       long freeMem,
                       long load,
                       int forwardedMessagesMinute,
                       int forwardedMessagesHour,
                       int forwardedMessages24Hours,
                       int forwardedMessages144Hours,
                       int managedUsers,
                       int onlineManagedUsers,
                       int queuedMessageNumber)
Called when a single server statistics must be shown.

Parameters:
id - the server id.
canonicalHostName - the server hostname.
RMIport - the server RMI port.
UDPport - the server UDP port.
cacheEntries - the cache entries.
freeMem - the free memory.
load - the load.
forwardedMessagesMinute - the number of messages forwarded in the last minute.
forwardedMessagesHour - the number of messages forwarded in the last hour.
forwardedMessages24Hours - the number of messages forwarded in the last day.
forwardedMessages144Hours - the number of messages forwarded in the last week.
managedUsers - the number of managed users.
onlineManagedUsers - the number of online managed users.
queuedMessageNumber - the number of queued messages.

showReceivedLoadFailed

void showReceivedLoadFailed()
Called when a load could not be received.


showMSAdded

void showMSAdded(java.lang.String canonicalHostName,
                 int udpPort,
                 int rmiPort)
Called when a MS is added.

Parameters:
canonicalHostName - the ms hostname.
udpPort - the UDP port.
rmiPort - the RMI port.

showWrongMSPassword

void showWrongMSPassword(java.lang.String canonicalHostName,
                         int udpPort,
                         int rmiPort)
Called when a Message server password is wrong.

Parameters:
canonicalHostName - the MS hostname.
udpPort - the MS UDP port.
rmiPort - the MS RMI port.

showWrongMSId

void showWrongMSId(int id1)
Called when a MS id is not correct.

Parameters:
id1 - the wrong id.

showUserList

void showUserList(int id1,
                  java.lang.String userStr)
Shows a list of users managed by a message server.

Parameters:
id1 - the ms id.
userStr - the users string representation.

showWrongMSPassword

void showWrongMSPassword(int id1)
Called when a Message server password is wrong.

Parameters:
id1 - the MS id.

showMSCommunicationProblem

void showMSCommunicationProblem(int id1)
Called when a communication problem with a MS occurred.

Parameters:
id1 - the MS id.

showTestPresenceDone

void showTestPresenceDone(int id1)
Called when a presence test for a MS is done correctly.

Parameters:
id1 - the MS id

showTestPresenceFailed

void showTestPresenceFailed(int id1)
Called when a presence test for a MS failed.

Parameters:
id1 - the MS id

showMSShutdownDone

void showMSShutdownDone(int id1)
Called when a MS Shutdown is done correctly.

Parameters:
id1 - the MS id

showMSBlocked

void showMSBlocked(int id1)
Called when a MS is blocked.

Parameters:
id1 - the MS id.

showMSUnblocked

void showMSUnblocked(int id1)
Called when a MS is not blocked.

Parameters:
id1 - the MS id.

showMSUnknown

void showMSUnknown(java.lang.String hostAddress,
                   int port)
Called when an udp packet from an unknown Message server is received.

Parameters:
hostAddress - the sender hostname.
port - the sender UDP port.

showUserNotManaged

void showUserNotManaged(int managerMSi,
                        java.lang.String user)
Called when a user is not managed by a Message server.

Parameters:
managerMSi - the MS id.
user - the user nickname.

showMSUserNotAccepted

void showMSUserNotAccepted(int ms1i,
                           java.lang.String nick)
Called when a MS does not accept a user assignation.

Parameters:
ms1i - the MS id.
nick - the user nickname.

showMSGenericError

void showMSGenericError(int ms1i)
Called when a generic error occurred in the message server.

Parameters:
ms1i - the message server ID.

showMSShutdownFailedUsersPresent

void showMSShutdownFailedUsersPresent(int id1)
Called when a MS cannot shutdown because some users are still assigned to it.

Parameters:
id1 - the ms id.

showCouldNotShutdownUnblockedMS

void showCouldNotShutdownUnblockedMS(int id1)
Called when a MS cannot shutdown because it is not blocked.

Parameters:
id1 - the ms id.

showIllegalArgument

void showIllegalArgument(java.lang.String hostname,
                         int port,
                         int port2)
Called when some given data are not right.

Parameters:
hostname - the given hostname.
port - the given RMI port.
port2 - the given UDP port.

showCouldNotBackupMS

void showCouldNotBackupMS(java.lang.String hostname,
                          int RMIport,
                          int UDPport)
Called when a backup problem occurred and a MS could not be saved.

Parameters:
hostname - the MS hostname.
RMIport - the MS RMI port.
UDPport - the Ms UDP port.

showCouldNotBackupUser

void showCouldNotBackupUser(java.lang.String nickname)
Called when a backup problem occurred and a User could not be saved.

Parameters:
nickname - the user nickname.

showCouldNotRemoveBackuppedMS

void showCouldNotRemoveBackuppedMS(java.lang.String hostName,
                                   int RMIport,
                                   int UDPport)
Called when a backup problem occurred and a MS could not be removed.

Parameters:
hostName - the MS hostname
RMIport - the MS RMI port.
UDPport - the MS UDP port.

showCouldNotRemoveBackuppedUser

void showCouldNotRemoveBackuppedUser(java.lang.String nick)
Called when a backup problem occurred and a User could not be removed.

Parameters:
nick - the user nickname.

showBackupFileStart

void showBackupFileStart(java.lang.String filename)
Called when a file backupper starts.

Parameters:
filename - the name of the file the main backupper is working on.

showBackupDone

void showBackupDone()
Called when the main backupper ends.


showBackupStart

void showBackupStart()
Called when a backupper unit starts.


showBackupFailed

void showBackupFailed()
Called when a backupper unit failed to backup.


showUserMoveSameDest

void showUserMoveSameDest(java.lang.String nick)
Called when somebody is trying to move a user from a server to its server.

Parameters:
nick - the user nickname.

showMSAlreadyInseted

void showMSAlreadyInseted()
Called when the admin tried to add an already added message server.


destroy

void destroy()
Called when the interface must be terminated.