Java Code Examples for org.elasticsearch.common.transport.TransportAddress#getPort()

The following examples show how to use org.elasticsearch.common.transport.TransportAddress#getPort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Ports.java    From crate with Apache License 2.0 5 votes vote down vote up
@Nullable
public static Integer portFromAddress(@Nullable TransportAddress address) {
    if (address == null) {
        return null;
    }
    return address.getPort();
}
 
Example 2
Source File: DiscoveryNode.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static String formatIntoIpPort(TransportAddress address) {
    return address.getAddress() + ":" + address.getPort();
}
 
Example 3
Source File: EmbeddedElasticsearchPolicy.java    From calcite with Apache License 2.0 4 votes vote down vote up
HttpHost httpHost() {
  final TransportAddress address = httpAddress();
  return new HttpHost(address.getAddress(), address.getPort());
}
 
Example 4
Source File: ElasticExtension.java    From immutables with Apache License 2.0 4 votes vote down vote up
private HttpHost httpHost() {
  final TransportAddress address = node.httpAddress();
  return new HttpHost(address.getAddress(), address.getPort());
}