public MessageHandler getMessageHandler(ConnectionContext context) { return context.getSession().getMessageHandler(); } }
@Override public void execute(String commandString, ConnectionContext context) throws IOException { context.sendResponse("221 Bye"); context.getSession().quit(); } }
@Override public void execute(String commandString, ConnectionContext context) throws IOException { Session session = context.getSession(); session.reset(session.getHasSeenHelo()); context.sendResponse("250 Ok"); } }
context.getSession().reset(); // clean slate
throws IOException if (context.getSession().isAuthenticated()) context.getSession().setAuthenticated(true); context.getSession().setAuthenticated(false);
@Override public void execute(String commandString, ConnectionContext context) throws IOException { String[] args = getArgs(commandString); if (args.length < 2) { context.sendResponse("501 Syntax: HELO <hostname>"); return; } Session session = context.getSession(); session.setHasSeenHelo(true); context.sendResponse("250 " + context.getServer().getHostName()); } }
@Override public void execute(String commandString, ConnectionContext context) throws IOException Session session = context.getSession(); if (!session.getHasSeenHelo())
@Override public void execute(String commandString, ConnectionContext context) throws IOException Session session = context.getSession(); if (!session.getHasSender())
Session session = context.getSession(); if (!session.getHasSeenHelo()) + AuthCommand.getEhloString(context.getSession() .getMessageHandler());
@Override public void execute(String commandString, ConnectionContext context) throws IOException Session session = context.getSession();