private String adminPortInUse(List<HostAndPort> adminAddresses) { // it returns a String for logging --- if desired for (HostAndPort addr : adminAddresses) { if (!NetUtils.isPortFree(addr.getHost(), addr.getPort())) return strings.get("ServerRunning", Integer.toString(addr.getPort())); } return null; }
/** * Convenience method to set the host and port (and secure) * attributes from a HostAndPort object. * * @param address the HostAndPort object from which to set the attributes */ public void setHostAndPort(HostAndPort address) { setHost(address.getHost()); setPort(address.getPort()); setSecure(address.isSecure()); }
String hostPortStr = mainStatus.getStageStatusMessage(); if (hostPortStr != null && !hostPortStr.trim().equals("")) { hap = new HostAndPort(hostPortStr);
adminPort = addresses.get(0).getPort();
/** */ @Override protected int executeCommand() throws CommandException, CommandValidationException { // if the local password isn't available, the instance isn't running // (localPassword is set by initInstance) File serverDir = getServerDirs().getServerDir(); if (serverDir == null || !serverDir.isDirectory()) return noSuchInstance(); if (getServerDirs().getLocalPassword() == null) return instanceNotRunning(); String serverName = getServerDirs().getServerName(); HostAndPort addr = getAdminAddress(serverName); programOpts.setHostAndPort(addr); if (logger.isLoggable(Level.FINER)) logger.finer("Stopping server at " + addr.toString()); if (!isRunning()) return instanceNotRunning(); logger.finer("It's the correct Instance"); return doRemoteCommand(); }
new HostAndPort(addr, port, secure));
adminPort = addresses.get(0).getPort();
private String adminPortInUse(List<HostAndPort> adminAddresses) { // it returns a String for logging --- if desired for (HostAndPort addr : adminAddresses) { if (!NetUtils.isPortFree(addr.getHost(), addr.getPort())) return strings.get("ServerRunning", Integer.toString(addr.getPort())); } return null; }
/** * Convenience method to set the host and port (and secure) * attributes from a HostAndPort object. * * @param address the HostAndPort object from which to set the attributes */ public void setHostAndPort(HostAndPort address) { setHost(address.getHost()); setPort(address.getPort()); setSecure(address.isSecure()); }
String hostPortStr = mainStatus.getStageStatusMessage(); if (hostPortStr != null && !hostPortStr.trim().equals("")) { hap = new HostAndPort(hostPortStr);
new HostAndPort(addr, port, secure));
/** *Set additional type-specific information on the target module ID. *@param tmid the target module ID for the Web app *@param targetImpl the target identifying which installation of this module is of interest *@param webHost the host and port for this target */ private void setWebApplicationTargetModuleIDInfo(TargetModuleID tmid, HostAndPort webHost) throws MalformedURLException, IOException { String path = deploymentFacility.getContextRoot(tmid.getModuleID()); if (!path.startsWith("/")) { //NOI18N path = "/" + path; //NOI18N } URL webURL = new URL("http", webHost.getHost(), webHost.getPort(), path); //NOI18N if (tmid instanceof TargetModuleIDImpl) { ((TargetModuleIDImpl)tmid).setWebURL(webURL.toExternalForm()); } }
new HostAndPort(addr, port, secure));
/** *Set additional type-specific information on the target module ID. *@param tmid the target module ID for the Web app *@param targetImpl the target identifying which installation of this module is of interest *@param webHost the host and port for this target */ private void setWebApplicationTargetModuleIDInfo(TargetModuleID tmid, HostAndPort webHost) throws MalformedURLException, IOException { String path = deploymentFacility.getContextRoot(tmid.getModuleID()); if (!path.startsWith("/")) { //NOI18N path = "/" + path; //NOI18N } URL webURL = new URL("http", webHost.getHost(), webHost.getPort(), path); //NOI18N if (tmid instanceof TargetModuleIDImpl) { ((TargetModuleIDImpl)tmid).setWebURL(webURL.toExternalForm()); } }
return new HostAndPort( serverName, port, securityEnabled);
private boolean isRunning(File nodeDirChild, String serverName) throws CommandException { try { File serverDir = new File(nodeDirChild, serverName); File configDir = new File(serverDir, "config"); File domainXml = new File(configDir, "domain.xml"); if (!domainXml.exists()) return false; MiniXmlParser parser = new MiniXmlParser(domainXml, serverName); List<HostAndPort> addrSet = parser.getAdminAddresses(); if (addrSet.size() <= 0) throw new CommandException(strings.get("NoAdminPort")); HostAndPort addr = addrSet.get(0); return isRunning(addr.getHost(), addr.getPort()); } catch (MiniXmlParserException ex) { throw new CommandException(strings.get("NoAdminPortEx", ex), ex); } }
adminAddresses.add(new HostAndPort("localhost", 4848, false)); info.setAdminAddresses(adminAddresses);
private void checkRunning() throws CommandException { programOpts.setInteractive(false); // don't prompt for password if (isRunning(adminAddress.getHost(), adminAddress.getPort()) && isThisDAS(getDomainRootDir())) { String msg = strings.get("domain.is.running", getDomainName(), getDomainRootDir()); throw new IllegalStateException(msg); } }
return new HostAndPort( serverName, port, securityEnabled);