jSyncManager Simple Java Server

org.jSyncManager.SJS.Adapters.SMTPServer
Class AbstractSMTPServer.SmtpCommand

java.lang.Object
  extended by org.jSyncManager.SJS.Adapters.SMTPServer.AbstractSMTPServer.SmtpCommand
Direct Known Subclasses:
AbstractSMTPServer.CommandData, AbstractSMTPServer.CommandExpn, AbstractSMTPServer.CommandHelo, AbstractSMTPServer.CommandHelp, AbstractSMTPServer.CommandMail, AbstractSMTPServer.CommandNoop, AbstractSMTPServer.CommandQuit, AbstractSMTPServer.CommandRcpt, AbstractSMTPServer.CommandRset, AbstractSMTPServer.CommandVrfy
Enclosing class:
AbstractSMTPServer

public abstract class AbstractSMTPServer.SmtpCommand
extends java.lang.Object

Handles the response of the system to a single command


Field Summary
protected  java.lang.String cmd
          The string command value
protected  long mask
          Single bit which represents this command
 
Constructor Summary
protected AbstractSMTPServer.SmtpCommand(java.lang.String cmd)
          constructs a new command with the given command string.
 
Method Summary
protected  void applyState()
          Applies the state mask for this command to the state
 java.lang.String getCmd()
           
 long getMask()
           
 boolean isStateSet(java.lang.String... command)
          Checks whether all state bits representing the given commands are set in the given state
abstract  java.lang.String process(java.lang.String args)
          Processes the given request with this command handler implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cmd

protected java.lang.String cmd
The string command value


mask

protected long mask
Single bit which represents this command

Constructor Detail

AbstractSMTPServer.SmtpCommand

protected AbstractSMTPServer.SmtpCommand(java.lang.String cmd)
constructs a new command with the given command string. This uses the currentMask field to create a unique bit mask for this field The command also self registers in the commands map of the owning class

Parameters:
cmd - command string which uniquely identifies this command
Method Detail

applyState

protected void applyState()
Applies the state mask for this command to the state


isStateSet

public boolean isStateSet(java.lang.String... command)
Checks whether all state bits representing the given commands are set in the given state

Returns:
If the state bits are set

process

public abstract java.lang.String process(java.lang.String args)
                                  throws java.lang.Exception
Processes the given request with this command handler implementation

Parameters:
args -
Returns:
The result string
Throws:
java.lang.Exception

getCmd

public java.lang.String getCmd()

getMask

public long getMask()

jSyncManager Simple Java Server

Copyright (c) 2004 Brad BARCLAY. All Rights Reserved.