class AdminConsoleController {

    @RequestMapping(value = "/{command}", method = RequestMethod.POST)
    public ModelAndView submitCommand(@PathVariable("command") String command, HttpServletRequest request,
            HttpSession session) throws XMPPException {
        ExtendedXMPPConnection client = (ExtendedXMPPConnection) session.getAttribute(SESSION_ATTRIBUTE);
        if (client == null) {
            // login
            return login();
        } else if (!client.isConnected()) {
            return login("Disconnected from XMPP server, please log in again");
        } else {
            @SuppressWarnings("unchecked")
            AdHocCommandData requestCommand = adHocCommandDataBuilder.build(request.getParameterMap());
            requestCommand.setType(Type.set);
            requestCommand.setFrom(client.getUser());
            requestCommand.setTo(client.getXMPPServiceDomain());
            requestCommand.setNode("http://jabber.org/protocol/admin#" + command);

            return sendRequestAndGenerateForm(command, client, requestCommand);
        }
    }

    @Autowired public  AdminConsoleController(XMPPTCPConnectionConfiguration connectionConfiguration);

}