Package org.glassfish.api.admin

Examples of org.glassfish.api.admin.CommandException


        }
        catch (CommandException ex) {
            throw ex;
        }
        catch (IOException ex) {
            throw new CommandException(ex);
        }
        catch (InterruptedException ex) {
            throw new CommandException(ex);
        }
    }
View Full Code Here


                logger.info("Installing " + getArchiveName() + " into " + host + ":" + sshInstallDir);
                String unzipCommand = "cd '" + sshInstallDir + "'; jar -xvf " + getArchiveName();
                int status = sshLauncher.runCommand(unzipCommand, outStream);
                if (status != 0) {
                    logger.info(Strings.get("jar.failed", host, outStream.toString()));
                    throw new CommandException("Remote command output: " + outStream.toString());
                }
                logger.finer("Installed " + getArchiveName() + " into " + host + ":" + sshInstallDir);
            }
            catch (IOException ioe) {
                logger.info(Strings.get("jar.failed", host, outStream.toString()));
View Full Code Here

            String asadmin = Constants.v4 ? "/lib/nadmin' version --local --terse" : "/bin/asadmin' version --local --terse";
            String cmd = "'" + sshInstallDir + "/" + SystemPropertyConstants.getComponentName() + asadmin;
            int status = sshLauncher.runCommand(cmd, outStream);
            if (status == 0) {
                logger.finer(host + ":'" + cmd + "'" + " returned [" + outStream.toString() + "]");
                throw new CommandException(Strings.get("install.dir.exists", sshInstallDir));
            }
            else {
                logger.finer(host + ":'" + cmd + "'" + " failed [" + outStream.toString() + "]");
            }
        }
View Full Code Here

                if (sftpClient.exists(sshInstallDir)){
                    checkIfAlreadyInstalled(host, sshInstallDir);
                }
            }
            catch (IOException ex) {
                throw new CommandException(ex);
            }
            catch (InterruptedException ex) {
                throw new CommandException(ex);
            }
        }
    }
View Full Code Here

    protected void validate() throws CommandException {
        super.validate();

        for (String host : hosts) {
            if (NetUtils.isThisHostLocal(host))
                throw new CommandException(Strings.get("install.node.nolocal", host));
        }
    }
View Full Code Here

                String pw = getWindowsPassword(host);
                WindowsRemoteFileSystem wrfs = new WindowsRemoteFileSystem(host, getRemoteUser(), pw);
                WindowsRemoteFile remoteInstallDir = new WindowsRemoteFile(wrfs, getInstallDir());

                if (!remoteInstallDir.exists()) {
                    throw new CommandException(
                            Strings.get("remote.install.dir.already.gone", getInstallDir()));
                }
                remoteInstallDir.delete();

                // make sure it's gone now...
                if (remoteInstallDir.exists()) {
                    throw new CommandException(Strings.get("remote.install.dir.cant.delete", getInstallDir()));
                }
            }
            catch (CommandException ce) {
                throw ce;
            }
            catch (Exception e) {
                throw new CommandException(e);
            }
        }
    }
View Full Code Here

        installDir = resolver.resolve(installDir);
        if (!force) {
            for (String host : hosts) {
                if (checkIfNodeExistsForHost(host, installDir)) {
                    throw new CommandException(Strings.get("node.already.configured", host, installDir));
                }
            }
        }
        if(ok(archive)) {
            archive = SmartFile.sanitize(archive);
View Full Code Here

        }
        catch (CommandException e) {
            throw e;
        }
        catch (Exception e) {
            throw new CommandException(e);
        }
        finally {
            if (!save && delete) {
                if (zipFile != null) {
                    if (!zipFile.delete())
View Full Code Here

    private String getIP(String host) throws CommandException {
        try {
            return InetAddress.getByName(host).getHostAddress();
        }
        catch (UnknownHostException e) {
            throw new CommandException(Strings.get("cantResolveIpAddress", host));
        }
    }
View Full Code Here

        }
        catch (CommandException ex) {
            throw ex;
        }
        catch (IOException ex) {
            throw new CommandException(ex);
        }
        catch (InterruptedException ex) {
            throw new CommandException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.CommandException

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.