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

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


        programOpts.setHostAndPort(di.adminAddr);
        di.status = isThisDAS(getDomainRootDir());
       
        if (di.status) {
            try {
                RemoteCLICommand cmd =
                        new RemoteCLICommand("_get-restart-required",
                        programOpts, env);
                String restartRequired =
                        cmd.executeAndReturnOutput("_get-restart-required");
                di.restartRequired = Boolean.parseBoolean(restartRequired.trim());
                if (di.restartRequired) {
                    di.statusMsg = strings.get("list.domains.StatusRestartRequired", dn);
                }
            }
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
        RemoteCLICommand cmd = new RemoteCLICommand(getName(), programOpts, env);
        cmd.executeAndReturnOutput("stop-domain", "--force", force.toString());
        try {
            waitForDeath();
        } catch (CommandException ex) {
            if (kill && local) {
                kill();
View Full Code Here

        HostAndPort addr = getAdminAddress();
        programOpts.setHostAndPort(addr);
        boolean status = isThisDAS(getDomainRootDir());
        if (status) {
            try {
                RemoteCLICommand cmd =
                        new RemoteCLICommand("_get-restart-required",
                        programOpts, env);
                String restartRequired =
                        cmd.executeAndReturnOutput("_get-restart-required");
                if (Boolean.parseBoolean(restartRequired.trim()))
                    return strings.get("list.domains.StatusRestartRequired", dn);
            }
            catch (Exception ex) {
            }
View Full Code Here

        ourDir = getUniquePath(ourDir);
        logger.log(Level.FINER, "Check if server is at location {0}", ourDir);

        try {
            RemoteCLICommand cmd =
                    new RemoteCLICommand("__locations", programOpts, env);
            ActionReport report =
                    cmd.executeAndReturnActionReport(new String[]{"__locations"});
            String theirDirPath = report.findProperty(directoryKey);
            logger.log(Level.FINER, "Remote server has root directory {0}", 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 {
        RemoteCLICommand cmd = new RemoteCLICommand("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
        RemoteCLICommand cmd = new RemoteCLICommand("_get-runtime-info", programOpts, env);
        ActionReport report = cmd.executeAndReturnActionReport("_get-runtime-info");

        if (report != null) {
            String val = report.findProperty("restartable_value");

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

    private void runRemoteStop() {
        try {
            // run the remote stop-domain command and throw away the output
            // the calling code has already verified the server is running.
            // CAREFUL -- intricate code!
            RemoteCLICommand cmd = new RemoteCLICommand("_stop-instance", programOpts, env);
            cmd.executeAndReturnOutput("_stop-instance", "--force", force.toString());
        }
        catch (CommandException e) {
            // ReST may have thrown an Exception because the server died faster than the
            // server could communicate back!   The ReST client misinterprets it
            // to mean the server is not reachable.  This is a special case.  And it
View Full Code Here

        ourDir = getUniquePath(ourDir);
        logger.log(Level.FINER, "Check if server is at location {0}", ourDir);

        try {
            RemoteCLICommand cmd =
                    new RemoteCLICommand("__locations", programOpts, env);
            ActionReport report =
                    cmd.executeAndReturnActionReport(new String[]{"__locations"});
            String theirDirPath = report.findProperty(directoryKey);
            logger.log(Level.FINER, "Remote server has root directory {0}", 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 {
        RemoteCLICommand cmd = new RemoteCLICommand("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
        RemoteCLICommand cmd = new RemoteCLICommand("_get-runtime-info", programOpts, env);
        ActionReport report = cmd.executeAndReturnActionReport("_get-runtime-info");

        if (report != null) {
            String val = report.findProperty("restartable_value");

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

TOP

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

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.