org.apache.commons.httpclient.HttpHost.getHostName()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.apache.commons.httpclient.HttpHost.getHostName()方法的一些代码示例,展示了HttpHost.getHostName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpHost.getHostName()方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpHost
类名称:HttpHost
方法名:getHostName

HttpHost.getHostName介绍

[英]Returns the host name (IP or DNS name).
[中]返回主机名(IP或DNS名称)。

代码示例

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Returns the host.
 * 
 * @return the host(IP or DNS name), or <code>null</code> if not set
 * 
 * @see #isHostSet()
 */
public synchronized String getHost() {
  if (this.host != null) {
    return this.host.getHostName();
  } else {
    return null;
  }
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Returns the host.
 * 
 * @return the host(IP or DNS name), or <code>null</code> if not set
 * 
 * @see #isHostSet()
 */
public synchronized String getHost() {
  if (this.host != null) {
    return this.host.getHostName();
  } else {
    return null;
  }
}

代码示例来源:origin: org.apache.commons/httpclient

/**
 * Returns the host.
 * 
 * @return the host(IP or DNS name), or <code>null</code> if not set
 * 
 * @see #isHostSet()
 */
public synchronized String getHost() {
  if (this.host != null) {
    return this.host.getHostName();
  } else {
    return null;
  }
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Returns the host.
 * 
 * @return the host(IP or DNS name), or <code>null</code> if not set
 * 
 * @see #isHostSet()
 */
public synchronized String getHost() {
  if (this.host != null) {
    return this.host.getHostName();
  } else {
    return null;
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Returns the host.
 * 
 * @return the host(IP or DNS name), or <code>null</code> if not set
 * 
 * @see #isHostSet()
 */
public synchronized String getHost() {
  if (this.host != null) {
    return this.host.getHostName();
  } else {
    return null;
  }
}

代码示例来源:origin: smartrics/RestFixture

public URI getURI(String scheme, String host, int port, String path,
    String queryString, HttpMethodParams params) throws URIException {
  HttpHost httphost = new HttpHost(host, port);
  StringBuffer buffer = new StringBuffer();
  if (httphost != null) {
    buffer.append(httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(httphost.getHostName());
    int p = httphost.getPort();
    if (p != -1 && p != httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(p);
    }
  }
  buffer.append(path);
  if (queryString != null) {
    buffer.append('?');
    buffer.append(queryString);
  }
  String charset = params.getUriCharset();
  return new HttpURL(buffer.toString(), charset);
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: org.zaproxy/zap

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
@Override
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: org.apache.commons/httpclient

/**
 * Returns the URI of the HTTP method
 * 
 * @return The URI
 * 
 * @throws URIException If the URI cannot be created.
 * 
 * @see org.apache.commons.httpclient.HttpMethod#getURI()
 */
public URI getURI() throws URIException {
  StringBuffer buffer = new StringBuffer();
  if (this.httphost != null) {
    buffer.append(this.httphost.getProtocol().getScheme());
    buffer.append("://");
    buffer.append(this.httphost.getHostName());
    int port = this.httphost.getPort();
    if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
      buffer.append(":");
      buffer.append(port);
    }
  }
  buffer.append(this.path);
  if (this.queryString != null) {
    buffer.append('?');
    buffer.append(this.queryString);
  }
  String charset = getParams().getUriCharset();
  return new URI(buffer.toString(), true, charset);
}

代码示例来源:origin: mesos/hadoop

if (mesosTracker.host.getHostName().startsWith(hostname)) {
 LOG.info("Killing Mesos task: " + mesosTracker.taskId + " on host "
   + mesosTracker.host + " because it has been marked as flaky");

代码示例来源:origin: org.mule.transports/mule-transport-http

@Override
public synchronized void setHost(HttpHost host)
{
  Protocol newProtocol = cloneProtocolKeepingSocketFactory(host.getProtocol());
  
  HttpHost hostCopy = new HttpHost(host.getHostName(), host.getPort(), newProtocol);
  super.setHost(hostCopy);
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

代码示例来源:origin: mesos/hadoop

Set<String> hosts = new HashSet<String>();
for (MesosTracker tracker : scheduler.mesosTrackers.values()) {
 hosts.add(tracker.host.getHostName());

代码示例来源:origin: org.apache.commons/httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

if (!this.host.getHostName().equalsIgnoreCase(connection.getHost())) {
  return false;

相关文章