All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.scattersphere.client.handler.HelpCommandHandler Maven / Gradle / Ivy

/*
 * Scattersphere
 * Copyright 2014-2015, Scattersphere Project.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.scattersphere.client.handler;

import net.scattersphere.api.Client;

import java.io.PrintWriter;

/**
 * This handles the "Help" command.
 *
 * Created by kenji on 12/10/14.
 */
public class HelpCommandHandler extends AbstractCommandHandler {

    public HelpCommandHandler(PrintWriter out, Client client) {
        super(out, client);
    }

    public void handle(String args[]) {
        getPrintWriter().println();
        getPrintWriter().println("General commands:");
        getPrintWriter().println("-----------------");
        getPrintWriter().println("    connect [ip:port]    Connects to a server by the IP and optional port.");
        getPrintWriter().println("    disconnect           Disconnects from the current server (if connected.)");
        getPrintWriter().println("    status               Retrieves the current connection status.");
        getPrintWriter().println("    help                 Gives this help.");
        getPrintWriter().println("    help [command]       Gives detailed help about the command specified.");
        getPrintWriter().println("    exit                 Exits the client.");
        getPrintWriter().println();
        getPrintWriter().println("The following commands require an active connection:");
        getPrintWriter().println();
        getPrintWriter().println("Authentication:");
        getPrintWriter().println("---------------");
        getPrintWriter().println("    login [user] [pass]  Logs into the server with the specified user/pass.");
        getPrintWriter().println();
        getPrintWriter().println("Job control commands:");
        getPrintWriter().println("--------------------");
        getPrintWriter().println("    start [job]  Starts a [job] with the specified  in key/value format.");
        getPrintWriter().println("                         (returns a queued job ID.)");
        getPrintWriter().println("    stop [id]    Stops a job by the [id] specified, with optional .");
        getPrintWriter().println("    list 




© 2015 - 2025 Weber Informatics LLC | Privacy Policy