Package com.sun.enterprise.admin.cli.remote

Examples of com.sun.enterprise.admin.cli.remote.RemoteCommand


   
    private static CLICommand getRemoteCommand(String name, ProgramOptions po, Environment env) throws CommandException {
        if (useRest()) {
            return new RemoteCLICommand(name, po, env);
        } else {
            return new RemoteCommand(name, po, env);
        }
    }
View Full Code Here


        if (cmd != null)
            return cmd;

        // nope, must be a remote command
        logger.finer("Assuming it's a remote command: " + name);
        return new RemoteCommand(name,
            habitat.getComponent(ProgramOptions.class),
            habitat.getComponent(Environment.class));
    }
View Full Code Here

        ourDir = getUniquePath(ourDir);
        logger.finer("Check if server is at location " + ourDir);

        try {
            RemoteCommand cmd =
                    new RemoteCommand("__locations", programOpts, env);
            Map<String, String> attrs =
                    cmd.executeAndReturnAttributes(new String[]{"__locations"});
            String theirDirPath = attrs.get(directoryKey);
            logger.finer("Remote server has root directory " + theirDirPath);

            if (ok(theirDirPath)) {
                File theirDir = getUniquePath(new File(theirDirPath));
View Full Code Here

    /**
     * Get uptime from the server.
     */
    protected final long getUptime() throws CommandException {
        RemoteCommand cmd = new RemoteCommand("uptime", programOpts, env);
        String up = cmd.executeAndReturnOutput("uptime", "--milliseconds").trim();
        long up_ms = parseUptime(up);

        if (up_ms <= 0) {
            throw new CommandException(strings.get("restart.dasNotRunning"));
        }
View Full Code Here

     * deleted it or made it unreadable.
     */
    protected final boolean isRestartable() throws CommandException {
        // false negative is worse than false positive.
        // there is one and only one case where we return false
        RemoteCommand cmd = new RemoteCommand("_get-runtime-info", programOpts, env);
        Map<String, String> atts = cmd.executeAndReturnAttributes("_get-runtime-info");

        if (atts != null) {
            String val = atts.get("restartable_value");

            if (ok(val) && val.equals("false"))
View Full Code Here

        }

        /*
         * Now get the list of remote commands.
         */
        RemoteCommand cmd =
            new RemoteCommand("list-commands", po, env);
        String cmds = cmd.executeAndReturnOutput("list-commands");
        List<String> rcmds = new ArrayList<String>();
        BufferedReader r = new BufferedReader(new StringReader(cmds));
        String line;

        /*
 
View Full Code Here

            this.type = type;
        if ((filter != null) && (filter.length() > 0))
            this.filter = filter;
        this.fileName = fileName;
        this.remoteArgs = remoteArgs;
        cmd = new RemoteCommand(remoteArgs[0], programOpts, env);
        displayHeader(type);

    }
View Full Code Here

    /**
     * Execute the actual stop-domain command.
     */
    protected void doCommand() throws CommandException {
        // run the remote stop-domain command and throw away the output
        RemoteCommand cmd = new RemoteCommand(getName(), programOpts, env);
        cmd.executeAndReturnOutput("stop-domain", "--force", force.toString());
        waitForDeath();

        if (kill && local) {
            kill();
        }
View Full Code Here

        }

        /*
         * Now get the list of remote commands.
         */
        RemoteCommand cmd =
            new RemoteCommand("list-commands", po, env);
        String cmds = cmd.executeAndReturnOutput("list-commands");
        List<String> rcmds = new ArrayList<String>();
        BufferedReader r = new BufferedReader(new StringReader(cmds));
        String line;

        /*
 
View Full Code Here

                    commandOptions,
                    operands
                    );
                Environment env = new Environment();
                ProgramOptions po = prepareRemoteCommandProgramOptions(env);
                RemoteCommand rc =
                    new RemoteCommand(commandName, po, env, "jsr-88/xml", baos);
                rc.executeAndReturnOutput(commandArgs);
                DFDeploymentStatus status = CommandXMLResultParser.parse(new ByteArrayInputStream(baos.toByteArray()));
                return status;
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.cli.remote.RemoteCommand

Copyright © 2018 www.massapicom. 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.