Package com.sun.enterprise.util

Examples of com.sun.enterprise.util.HostAndPort


        final ActionReport report = context.getActionReport();

        ActionReport.MessagePart part = report.getTopMessagePart();

        HttpService httpService = null;
        HostAndPort hostAndPort = null;

        try {
            if (config == null) {
                throw new Exception("No such target:" + target);  
            }
            httpService = config.getHttpService();

            if (httpService != null) {
                hostAndPort = getHostAndPortForRequest(httpService);
            }
        } catch (Exception e) {
            report.setMessage(e.getMessage());
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }

        if (hostAndPort != null) {
            part.setMessage(hostAndPort.getHost() + ":" +
                hostAndPort.getPort());
            part.addProperty("host", hostAndPort.getHost()); //property for REST Access
            part.addProperty("port", ""+hostAndPort.getPort()); //property for REST Access

        }
        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
    }
View Full Code Here


        if (vsList==null) {
            return getHostAndPort(httpService, securityEnabled);
        }

        for (String virtualServer : vsList) {
            HostAndPort hp = getHostAndPort(httpService,
                httpService.getVirtualServerByName(virtualServer),
                securityEnabled);
            if (hp!=null) {
                return hp;
            }
View Full Code Here

                        if (redirPort != null &&
                            !redirPort.trim().equals("")) {
                            portStr = redirPort;
                        }
                        int port = Integer.parseInt(portStr);
                        return new HostAndPort(
                            serverName, port, securityEnabled);
                    }
                }
            }
        }
View Full Code Here

                if (redirPort != null &&
                    !redirPort.trim().equals("")) {
                    portStr = redirPort;
                }
                int port = Integer.parseInt(portStr);
                return new HostAndPort(
                    serverName, port, securityEnabled);
            }
        }
        return null;
    }
View Full Code Here

                throw new CommandException(strings.get("bad.node.dir",serverDir));
            }
           
            ArrayList<String> serverNames = getInstanceDirs(serverDir);
            for (String serverName: serverNames) {
                HostAndPort adminAddress = getAdminAddress(serverName);
                if (isRunning(adminAddress.getHost(), adminAddress.getPort()))
                    throw new CommandException(strings.get("instance.is.running",
                            serverName));
            }

            oldPassword = passwords.get("AS_ADMIN_MASTERPASSWORD");
View Full Code Here

                                    secure = sec != null
                                            && "true".equalsIgnoreCase(sec);
                                }
                                if (GFLauncherUtils.ok(addr))
                                    adminAddresses.add(
                                            new HostAndPort(addr, port, secure));
                                // ed: seven end-braces is six too many for my code!
                            }
                            break;
                        }
                    }
View Full Code Here

            if (serverDir == null || !serverDir.isDirectory()) {
                throw new CommandException(strings.get("bad.node.dir",serverDir));
            }
            String serverName = getServerDirs().getServerName();
            HostAndPort adminAddress = getAdminAddress(serverName);

            if (isRunning(adminAddress.getHost(), adminAddress.getPort()))
                throw new CommandException(strings.get("instance.is.running",
                        serverName));

            oldPassword = passwords.get("AS_ADMIN_MASTERPASSWORD");
            if (oldPassword == null) {
View Full Code Here

    private void addToTargetModuleIDs(TargetModuleID[] tmids, ModuleType type, TargetImpl targetImpl, Collection resultingTMIDsthrows IOException {

        for (int j = 0;j< tmids.length;j++) {
           
            // Get the host name and port where the application was deployed
            HostAndPort webHost = deploymentFacility.getHostAndPort(targetImpl.getName(), tmids[j].getModuleID(), false);

            if (tmids[j] instanceof TargetModuleIDImpl) {
                ((TargetModuleIDImpl)tmids[j]).setModuleType(type);
            }
            resultingTMIDs.add(tmids[j]);
View Full Code Here

        try {
            DFCommandRunner commandRunner = getDFCommandRunner(commandName, commandParams, null);
            DFDeploymentStatus ds = commandRunner.run();
            mainStatus = ds.getMainStatus();

            HostAndPort hap = null;
            if (mainStatus.getStatus() != DFDeploymentStatus.Status.FAILURE) {
                String hostPortStr = mainStatus.getStageStatusMessage();
                if (hostPortStr != null && !hostPortStr.trim().equals("")) {
                    hap = new HostAndPort(hostPortStr);
                }
                return hap;
            } else {
                /*
                 * We received a response from the server but the status was
View Full Code Here

    @Override
    protected int executeCommand() throws CommandException {

        try {
            HostAndPort adminAddress = getAdminAddress();
            if (isRunning(adminAddress.getHost(), adminAddress.getPort()))
                throw new CommandException(strings.get("domain.is.running",
                                                    getDomainName(), getDomainRootDir()));
            DomainConfig domainConfig = new DomainConfig(getDomainName(),
                getDomainsDir().getAbsolutePath());
            PEDomainsManager manager = new PEDomainsManager();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.HostAndPort

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.