messageServerP
Class Command

java.lang.Object
  extended by messageServerP.Command

public class Command
extends java.lang.Object

A command given by the administrator through the Human interface.

Author:
Marco Cornolti

Field Summary
private  java.lang.String str
           
private  int type
           
 
Constructor Summary
private Command(int type)
          The constructor for a command with no arguments.
private Command(int type, java.lang.String str)
          The constructor for a command with one string as argument.
 
Method Summary
 java.lang.String getFilename()
           
 boolean isBackup()
           
 boolean isChangeInterfaceToGUI()
           
 boolean isChangeInterfaceToText()
           
 boolean isPrintLoadStatistics()
           
 boolean isPrintUsersStatistics()
           
 boolean isShutdown()
           
static Command makeBackup(java.lang.String filename)
          "backup" command constructor.
static Command makeChangeInterfaceToGUI()
          "change interface to gui" command constructor.
static Command makeChangeInterfaceToText()
          "change interface to textual" command constructor.
static Command makePrintLoadStatistics()
          "print load statistics" command constructor.
static Command makePrintUsersStatistics()
          "print user statistics" command constructor.
static Command makeShutdown()
          "shutdown" command constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private int type

str

private java.lang.String str
Constructor Detail

Command

private Command(int type)
The constructor for a command with no arguments.

Parameters:
type - the command type.

Command

private Command(int type,
                java.lang.String str)
The constructor for a command with one string as argument.

Parameters:
type - the command type.
str - the string argument
Method Detail

isPrintUsersStatistics

public boolean isPrintUsersStatistics()
Returns:
true if the command type is "print user statistics"

isPrintLoadStatistics

public boolean isPrintLoadStatistics()
Returns:
true if the command type is "print load statistics"

isShutdown

public boolean isShutdown()
Returns:
true if the command type is "shutdown"

isChangeInterfaceToGUI

public boolean isChangeInterfaceToGUI()
Returns:
true if the command type is "change interface to gui"

isChangeInterfaceToText

public boolean isChangeInterfaceToText()
Returns:
true if the command type is "change interface to textual"

isBackup

public boolean isBackup()
Returns:
true if the command type is "backup"

makePrintUsersStatistics

public static Command makePrintUsersStatistics()
"print user statistics" command constructor.

Returns:
a command of type "print user statistics"

makePrintLoadStatistics

public static Command makePrintLoadStatistics()
"print load statistics" command constructor.

Returns:
a command of type "print load statistics"

makeShutdown

public static Command makeShutdown()
"shutdown" command constructor.

Returns:
a command of type "shutdown"

makeChangeInterfaceToGUI

public static Command makeChangeInterfaceToGUI()
"change interface to gui" command constructor.

Returns:
a command of type "change interface to gui"

makeChangeInterfaceToText

public static Command makeChangeInterfaceToText()
"change interface to textual" command constructor.

Returns:
a command of type "change interface to textual"

makeBackup

public static Command makeBackup(java.lang.String filename)
"backup" command constructor.

Parameters:
filename - the file name to backup to.
Returns:
a command of type "backup"

getFilename

public java.lang.String getFilename()
Returns:
the command file name (for commands of type "backup")