net.sf.wallace.commands
Class AbstractCommand

java.lang.Object
  extended by net.sf.wallace.commands.AbstractCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AuthCommand, NonAuthCommand, SelectCommand

public abstract class AbstractCommand
extends Object
implements Command

A useful base class to aid enforcement of state restrictions.

Author:
rnewson

Constructor Summary
AbstractCommand()
           
 
Method Summary
 void execute(WallaceSession wallaceSession)
          Execute this command against the given session using data from the supplied message.
protected abstract  WallaceSessionState[] getAcceptableStates()
           
protected abstract  void onExecute(WallaceSession wallaceSession)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

execute

public final void execute(WallaceSession wallaceSession)
                   throws InvalidStateException,
                          javax.mail.MessagingException
Description copied from interface: Command
Execute this command against the given session using data from the supplied message.

Specified by:
execute in interface Command
Parameters:
wallaceSession - the session to apply the message to.
Throws:
InvalidStateException - if the session is not in an appropriate state for this command (SELECT before LOGIN, for example).
javax.mail.MessagingException

getAcceptableStates

protected abstract WallaceSessionState[] getAcceptableStates()

onExecute

protected abstract void onExecute(WallaceSession wallaceSession)
                           throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException


Copyright © 2004-2005 Robert Newson. All Rights Reserved.