Dear Wiki user, You have subscribed to a wiki page or wiki category on "James Wiki" for change notification.
The following page has been changed by DannyAngus: http://wiki.apache.org/james/FastFail ------------------------------------------------------------------------------ ---- + + I am DannyAngus and I'm proposing an API for extending James to create + extension points for Protocol, Command, and Rule. + + The proposal, sumarised from mails sent to [EMAIL PROTECTED]: + + My original proposal: + + + '''ProtocolHandler''' - parses commands per protocol spec. + + '''CommandHandler''' - matches command(s) and responds to the protocol handler with a response code & message. + + '''CommandRule''' - called by command handler to validate command, responds with a response code & message + + + You will see that I propose to implement THREE levels of entry into + the protocol handling. + + a) implement a new protocol + + b) implement a new command + + c) implement a new rule to be applied to a command + + + Anyone wishing to do *any* of these three things will be able to do + so with no extra knowledge of James internals. + + It is much more likely that James' users will wish to modify James' behaviour + than they will want to port James functionality to other servers. + + If you want to introduce reuse external to James this would require + an independant API specification. Which I am *not* proposing. + + The mail protocols are all of the same + command->response form and the constraints are there to provide + consistent extension points to James. + + This proposal allows anyone to implement + whatever they _really_ want, in terms of commands and fail rules. + + Example pseudo-code interfaces + + -------- + + '''A protocol handler''' + + public interface Protocol { + public abstract void handleConnection(Socket connection) throws IOException; + public abstract void setCommandMap(Map commands); //map of Commands + } + + + -------- + + '''A command''' + + public interface Command{ + public abstract String getCommandName(); + public abstract Response handleCommand(String command, Map State); + public abstract void setRulesList(List rules); // List of Rules + + } + + + -------- + + '''A rule''' + + public interface Rule{ + public abstract Response processArguments(String[] arguments, Map State); + } + + + + -------- + + '''A response''' + + public interface Response{ + public abstract String getResponseCode(); + public abstract String getExtendedCode();//possibly only in + extended SMTPResponse + public abstract String getMessage(); + public abstract String getResponse(); + } + -------- + + DannyAngus + ---- +