Package com.sun.enterprise.admin.remote

Examples of com.sun.enterprise.admin.remote.RemoteRestAdminCommand


           String domainName = (ok(userArgDomainName))?userArgDomainName:getDomainName();
           return changeAdminPasswordLocally(domainDir,domainName);        
       
       } else {
           try {
                RemoteRestAdminCommand rac = new RemoteRestAdminCommand(name,
                    programOpts.getHost(), programOpts.getPort(),
                    programOpts.isSecure(), programOpts.getUser(),
                    programOpts.getPassword(), logger);
                rac.executeCommand(params);
                return SUCCESS;
           } catch(CommandException ce) {
               if ( ce.getCause() instanceof ConnectException) {
                   //Remote change failure - change password with default values of
                   // domaindir and domain name,if the --host option is not provided.
View Full Code Here


        if(!instance.isRunning())
            return null;

        try {
            logger.info(Strings.get("stop.instance.init", instanceName));
            RemoteRestAdminCommand rac = new ServerRemoteRestAdminCommand(habitat, "_stop-instance",
                    host, port, false, "admin", null, logger);

            // notice how we do NOT send in the instance's name as an operand!!
            ParameterMap map = new ParameterMap();
            map.add("force", Boolean.toString(force));
            rac.executeCommand(map);
        }
        catch (CommandException ex) {
            return Strings.get("stop.instance.racError", instanceName,
                    ex.getLocalizedMessage());
        }
View Full Code Here

        if (isError())
            return;

        String cmdName = "_restart-instance";

        RemoteRestAdminCommand rac = createRac(cmdName);
        // notice how we do NOT send in the instance's name as an operand!!
        ParameterMap map = new ParameterMap();

        if (debug != null)
            map.add("debug", debug);

        rac.executeCommand(map);
    }
View Full Code Here

        if (isError())
            return false;

        String cmdName = "_get-runtime-info";

        RemoteRestAdminCommand rac;
        try {
            rac = createRac(cmdName);
            rac.executeCommand(new ParameterMap());
        }
        catch (CommandException ex) {
            // there is only one reason that _get-runtime-info would have a problem
            // namely if the instance isn't running.
            throw new InstanceNotRunningException();
        }
       
        String val = rac.findPropertyInReport("restartable");
        if (val != null && val.equals("false")) {
            return false;
        }
        return true;
    }
View Full Code Here

            setError(Strings.get("restart.instance.nopid", instanceName));
    }

    private String getPid() throws CommandException {
        String cmdName = "_get-runtime-info";
        RemoteRestAdminCommand rac = createRac(cmdName);
        rac.executeCommand(new ParameterMap());
        return rac.findPropertyInReport("pid");
    }
View Full Code Here

           String domainName = (ok(userArgDomainName))?userArgDomainName:getDomainName();
           return changeAdminPasswordLocally(domainDir,domainName);        
       
       } else {
           try {
                RemoteRestAdminCommand rac = new RemoteRestAdminCommand(name,
                    programOpts.getHost(), programOpts.getPort(),
                    programOpts.isSecure(), programOpts.getUser(),
                    programOpts.getPassword(), logger);
                rac.executeCommand(params);
                return SUCCESS;
           } catch(CommandException ce) {
               if ( ce.getCause() instanceof ConnectException) {
                   //Remote change failure - change password with default values of
                   // domaindir and domain name,if the --host option is not provided.
View Full Code Here

        if (isError())
            return;

        String cmdName = "_restart-instance";

        RemoteRestAdminCommand rac = createRac(cmdName);
        // notice how we do NOT send in the instance's name as an operand!!
        ParameterMap map = new ParameterMap();

        if (debug != null)
            map.add("debug", debug);

        rac.executeCommand(map);
    }
View Full Code Here

        if (isError())
            return false;

        String cmdName = "_get-runtime-info";

        RemoteRestAdminCommand rac;
        try {
            rac = createRac(cmdName);
            rac.executeCommand(new ParameterMap());
        }
        catch (CommandException ex) {
            // there is only one reason that _get-runtime-info would have a problem
            // namely if the instance isn't running.
            throw new InstanceNotRunningException();
        }
       
        String val = rac.findPropertyInReport("restartable");
        if (val != null && val.equals("false")) {
            return false;
        }
        return true;
    }
View Full Code Here

            setError(Strings.get("restart.instance.nopid", instanceName));
    }

    private String getPid() throws CommandException {
        String cmdName = "_get-runtime-info";
        RemoteRestAdminCommand rac = createRac(cmdName);
        rac.executeCommand(new ParameterMap());
        return rac.findPropertyInReport("pid");
    }
View Full Code Here

        if (isError())
            return;

        String cmdName = "_restart-instance";

        RemoteRestAdminCommand rac = createRac(cmdName);
        // notice how we do NOT send in the instance's name as an operand!!
        ParameterMap map = new ParameterMap();

        if (debug != null)
            map.add("debug", debug);

        rac.executeCommand(map);
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.remote.RemoteRestAdminCommand

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.