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

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


        final String origAuthToken = programOpts.getAuthToken();
        if (origAuthToken != null) {
            programOpts.setAuthToken(AuthTokenManager.markTokenForReuse(origAuthToken));
        }

        syncCmd = new RemoteCLICommand("_synchronize-files", programOpts, env);
        syncCmd.setFileOutputDirectory(instanceDir);

        /*
         * The sync state file records the fact that we're in the middle
         * of a synchronization attempt.  When we're done, we remove 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

        }

        /*
         * Now get the list of remote commands.
         */
        RemoteCLICommand cmd =
            new RemoteCLICommand("list-commands", po, env);
        ActionReport report = cmd.executeAndReturnActionReport("list-commands");
        List<MessagePart> children = report.getTopMessagePart().getChildren();
        List<String> rcmds = new ArrayList<String>(children.size());
        for (ActionReport.MessagePart msg : children) {
            if (!localnames.contains(msg.getMessage())) {
                rcmds.add(msg.getMessage());
View Full Code Here

        // nope, must be a remote command
        logger.finer("Assuming it's a remote command: " + name);
        Environment environment = habitat.getService(Environment.class);
        if (useRest()) {
            return new RemoteCLICommand(name,
                po,
                environment);
        } else {
            return new RemoteCommand(name,
                po,
View Full Code Here

    }

    private void setRendezvousOccurred(String rendezVal) {
        String dottedName = RENDEZVOUS_DOTTED_NAME + "=" + rendezVal;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("set", this.programOpts, this.env);
            rc.executeAndReturnOutput("set", dottedName);
        } catch (CommandException ex) {
            logger.warning(Strings.get("import.sync.bundle.completeRegistrationFailed", dottedName));
        }
    }
View Full Code Here

        }
        return exitCode;
    }

    private int bootstrapSecureAdminFiles() throws CommandException {
        RemoteCLICommand rc = new RemoteCLICommand("_bootstrap-secure-admin", this.programOpts, this.env);
        rc.setFileOutputDirectory(instanceDir);
        final int result = rc.execute(new String[] {"_bootstrap-secure-admin"});
        return result;
    }
View Full Code Here

        argsList.add(this.instanceName);

        String[] argsArray = new String[argsList.size()];
        argsArray = argsList.toArray(argsArray);

        RemoteCLICommand rc = new RemoteCLICommand("_register-instance", this.programOpts, this.env);
        return rc.execute(argsArray);
    }
View Full Code Here

    }

    private boolean isRegisteredToDAS() {
        boolean isRegistered = false;
        try {
            RemoteCLICommand rc = new RemoteCLICommand("get", this.programOpts, this.env);
            rc.executeAndReturnOutput("get", INSTANCE_DOTTED_NAME);
            isRegistered = true;
        } catch (CommandException ex) {
            logger.finer(instanceName +" is not yet registered to DAS.");
            isRegistered=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.