infoservice.mailsystem.central
Class CommandFactory

java.lang.Object
  extended by infoservice.mailsystem.central.CommandFactory

public class CommandFactory
extends java.lang.Object

This class finds the correct implementation of the reply-generating class depending on the subject of the received mail.


Field Summary
private static int COMMAND_BANMESSAGE
          The command code for the BanWarning command.
private static int COMMAND_GETFORWARDER
          The command code of the GetForwarder command.
private static int COMMAND_GETHELP
          The command code of the GetHelp command.
private static int DEFAULT_COMMAND
          The default command to use, if we could not find a matching command in the subject line of the received mail.
private static java.util.Locale DEFAULT_LANGUAGE
          The default language to use, if no language code to use could be found in the subject line of the received mail.
 
Constructor Summary
CommandFactory()
           
 
Method Summary
static AbstractMailSystemCommand getCommandImplementation(java.lang.String a_mailSubject, boolean a_banMessage)
          This method finds the matching command implementation and reply language depending on the subject line of the received mail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LANGUAGE

private static final java.util.Locale DEFAULT_LANGUAGE
The default language to use, if no language code to use could be found in the subject line of the received mail. The default language is English.


COMMAND_GETHELP

private static final int COMMAND_GETHELP
The command code of the GetHelp command.

See Also:
Constant Field Values

COMMAND_GETFORWARDER

private static final int COMMAND_GETFORWARDER
The command code of the GetForwarder command.

See Also:
Constant Field Values

COMMAND_BANMESSAGE

private static final int COMMAND_BANMESSAGE
The command code for the BanWarning command.

See Also:
Constant Field Values

DEFAULT_COMMAND

private static final int DEFAULT_COMMAND
The default command to use, if we could not find a matching command in the subject line of the received mail. The default is the GetHelp command.

See Also:
Constant Field Values
Constructor Detail

CommandFactory

public CommandFactory()
Method Detail

getCommandImplementation

public static AbstractMailSystemCommand getCommandImplementation(java.lang.String a_mailSubject,
                                                                 boolean a_banMessage)
This method finds the matching command implementation and reply language depending on the subject line of the received mail.

Parameters:
a_mailSubject - The subject line of a received mail.
a_banMessage - If this value is true, the command in the subject line is ignored and the ban message implementation is returned. Only the preferred language is tried to obtain from the subject line. If this value is false, the command and the preferred language is read from the subject line and the corresponding command implementation is returned.
Returns:
The command implementation to use for creating a response for the received message.