Package org.apache.james.remotemanager

Examples of org.apache.james.remotemanager.RemoteManagerResponse.appendLine()


                } else {
                    response = new RemoteManagerResponse("Mappings:");

                    Iterator<String> m = mappings.iterator();
                    while (m.hasNext()) {
                        response.appendLine(m.next());
                     }
                }
           

            } catch (IllegalArgumentException e) {
View Full Code Here


        UsersRepository users = uStore.getRepository(((String) session.getState().get(RemoteManagerSession.CURRENT_USERREPOSITORY)));

        if (parameters == null) {
            response = new RemoteManagerResponse("Existing accounts " + users.countUsers());
            for (Iterator<String> it = users.list(); it.hasNext();) {
                response.appendLine("user: " + it.next());
            }
            return response;
        } else {
            if(mailServer.supportVirtualHosting() == false) {
                response = new RemoteManagerResponse("Virtualhosting not supported");
View Full Code Here

            }
       
            ArrayList<String> userList = getDomainUserList(users,parameters);
            response = new RemoteManagerResponse("Existing accounts from domain " + parameters + " " + userList.size());
            for (int i = 0; i <userList.size(); i++) {
                response.appendLine("user: " + userList.get(i));
            }
            return response;
        }       
    }
View Full Code Here

                response = new RemoteManagerResponse("Mappings:");

                Iterator<String> m = mappings.keySet().iterator();
                while (m.hasNext()) {
                    String key = m.next();
                    response.appendLine(key + "  -> " + mappings.get(key));
                }
            }
        } catch (IllegalArgumentException e) {
            session.getLogger().error("Error on listing all mapping: " + e);
            response = new RemoteManagerResponse("Error on listing all mapping: " + e);
View Full Code Here

        } else {
            response = new RemoteManagerResponse("Domains:");
               
           
            for(int i = 0; i < domains.length; i++) {
                response.appendLine(domains[i]);
            }
        }  
        return response;
    }
View Full Code Here

     * .remotemanager.RemoteManagerSession)
     */
    public void onConnect(RemoteManagerSession session) {
        RemoteManagerResponse response = new RemoteManagerResponse("JAMES Remote Administration Tool ");// +
        // Constants.SOFTWARE_VERSION)
        response.appendLine("Please enter your login and password");
        response.appendLine("Login id:");

        session.writeResponse(response);
        session.pushLineHandler(lineHandler);
        session.getState().put(AUTHORIZATION_STATE, LOGIN_SUPPLIED);
View Full Code Here

     */
    public void onConnect(RemoteManagerSession session) {
        RemoteManagerResponse response = new RemoteManagerResponse("JAMES Remote Administration Tool ");// +
        // Constants.SOFTWARE_VERSION)
        response.appendLine("Please enter your login and password");
        response.appendLine("Login id:");

        session.writeResponse(response);
        session.pushLineHandler(lineHandler);
        session.getState().put(AUTHORIZATION_STATE, LOGIN_SUPPLIED);
    }
View Full Code Here

     * (non-Javadoc)
     * @see org.apache.james.protocols.api.CommandHandler#onCommand(org.apache.james.protocols.api.ProtocolSession, org.apache.james.protocols.api.Request)
     */
    public Response onCommand(RemoteManagerSession session, Request request) {
        RemoteManagerResponse response = new RemoteManagerResponse("Current memory statistics:");
        response.appendLine("\tFree Memory: " + Runtime.getRuntime().freeMemory());
        response.appendLine("\tTotal Memory: " + Runtime.getRuntime().totalMemory());
        response.appendLine("\tMax Memory: " + Runtime.getRuntime().maxMemory());

        if ("-gc".equalsIgnoreCase(request.getArgument())) {
            System.gc();
View Full Code Here

     * @see org.apache.james.protocols.api.CommandHandler#onCommand(org.apache.james.protocols.api.ProtocolSession, org.apache.james.protocols.api.Request)
     */
    public Response onCommand(RemoteManagerSession session, Request request) {
        RemoteManagerResponse response = new RemoteManagerResponse("Current memory statistics:");
        response.appendLine("\tFree Memory: " + Runtime.getRuntime().freeMemory());
        response.appendLine("\tTotal Memory: " + Runtime.getRuntime().totalMemory());
        response.appendLine("\tMax Memory: " + Runtime.getRuntime().maxMemory());

        if ("-gc".equalsIgnoreCase(request.getArgument())) {
            System.gc();
            response.appendLine("And after System.gc():");
View Full Code Here

     */
    public Response onCommand(RemoteManagerSession session, Request request) {
        RemoteManagerResponse response = new RemoteManagerResponse("Current memory statistics:");
        response.appendLine("\tFree Memory: " + Runtime.getRuntime().freeMemory());
        response.appendLine("\tTotal Memory: " + Runtime.getRuntime().totalMemory());
        response.appendLine("\tMax Memory: " + Runtime.getRuntime().maxMemory());

        if ("-gc".equalsIgnoreCase(request.getArgument())) {
            System.gc();
            response.appendLine("And after System.gc():");
            response.appendLine("\tFree Memory: " + Runtime.getRuntime().freeMemory());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.