@Override public String getHost() { // TODO Auto-generated method stub return server.getHost(); }
@Override protected URL getUrlToOpen(JcrNode node, IServer server) throws MalformedURLException { return new URL("http", server.getHost(), server.getAttribute(ISlingLaunchpadServer.PROP_PORT, 8080), "/crx/de/index.jsp#" + node.getJcrPath()); }
/** * Returns the host part of the server on which module is to be published. * For example, 'localhost'. * * @return <code>String</code> representing host part of server on which * module is to be published. Will return <code>null</code>, if called * before {@link GenericPublisher#initialize()} has been called. */ protected String getHost() { return getServer().getServer().getHost(); }
protected void fillTree() { clean(); List list = new ArrayList(); IServer[] servers = ServerCore.getServers(); if (servers != null) { int size = servers.length; for (int i = 0; i < size; i++) { if (acceptServer(servers[i])) { TreeElement te = getOrCreate(list, servers[i].getHost()); te.contents.add(servers[i]); elementToParentMap.put(servers[i], te); } } } elements = list.toArray(); }
protected String getKieRESTUrl() { String kieApp = getKieApplication(); if (kieApp==null) { kieApp = handler.getPreference(IKieConstants.PREF_SERVER_KIE_APPLICATION_NAME, null); if (kieApp==null) throw new IllegalArgumentException("Can't determine KIE Application Name"); throw new IllegalArgumentException("KIE Application '"+kieApp+"' is not deployed"); } return "http://" + getServer().getHost() + ":" + getHttpPort() + "/" + kieApp + "/rest"; }
String repoName = path[path.length-1]; if ( name.equals(repoName) && host.equals(getServer().getHost()) && port == getDelegate().getGitPort() && "ssh".equals(scheme)) {
private List getWebServices(IProject project, List servicesNames, IProgressMonitor monitor) { Vector webServices = new Vector(); IServer[] servers = ServerUtil.getServersByModule(ServerUtil.getModule(project),monitor); for (int i = 0; i < servers.length; i++) { String host = servers[i].getHost(); ServerPort httpPort = getHttpPort(servers[i].getServerPorts(monitor)); if (httpPort != null) { for (int j = 0; j < servicesNames.size(); j++) { WebServiceInfo wsInfo = new WebServiceInfo(); String endPointURL = "http://" + host + ":" + httpPort.getPort() + "/" + J2EEUtils.getFirstWebModuleName(project) + "/services/" + (String)servicesNames.get(j); wsInfo.setEndPointURL(endPointURL); wsInfo.setWsdlURL(endPointURL+"?wsdl"); webServices.add(wsInfo); } } } return webServices; }
public static URIish getRepoURI(final IKieRepositoryHandler repository) { final IKieServiceDelegate delegate = repository.getDelegate(); final String host = delegate.getServer().getHost(); final int port = delegate.getGitPort(); final String username = delegate.getUsername(); final String potentialUsername = username == null || username.isEmpty() ? "" : username + "@"; final String repoPath = repository.getParent().getName() + File.separator + repository.getName(); try { // URI is in the form: ssh://admin@localhost:8001/spaceName/projectName return new URIish("ssh://" + potentialUsername + host + ":" + port + "/" + repoPath); } catch (final URISyntaxException e) { e.printStackTrace(); return null; } }
public int startMonitoring(IServer server, ServerPort port, int monitorPort) throws CoreException { try { IMonitor monitor = (IMonitor) monitors.get(port); int mport = -1; if (monitor == null) { mport = monitorPort; if (mport == -1) mport = SocketUtil.findUnusedPort(5000, 15000); // should search for a monitor first .. IMonitorWorkingCopy wc = MonitorCore.createMonitor(); wc.setLocalPort(mport); wc.setRemoteHost(server.getHost()); wc.setRemotePort(port.getPort()); if ("HTTP".equals(port.getProtocol())) wc.setProtocol("HTTP"); monitor = wc.save(); addListener(); } else mport = monitor.getLocalPort(); monitor.start(); monitors.put(port, monitor); return mport; } catch (Exception e) { Trace.trace(Trace.SEVERE, "Could not start monitoring", e); throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorStartingMonitor, e.getLocalizedMessage()), null)); } }
if (server != null) { runtime = server.getRuntime(); hostname.setText(server.getHost()); } else hostname.setText("");