Class ElasticsearchHost
java.lang.Object
org.springframework.data.elasticsearch.client.ElasticsearchHost
Value Object containing information about Elasticsearch cluster nodes.
- Since:
- 3.2
- Author:
- Christoph Strobl
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default HTTP port for Elasticsearch servers. -
Constructor Summary
ConstructorDescriptionElasticsearchHost
(InetSocketAddress endpoint, ElasticsearchHost.State state) -
Method Summary
Modifier and TypeMethodDescriptiongetState()
boolean
isOnline()
static ElasticsearchHost
offline
(InetSocketAddress host) static ElasticsearchHost
online
(InetSocketAddress host) static InetSocketAddress
Parse a hostAndPort string into aInetSocketAddress
.toString()
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTDefault HTTP port for Elasticsearch servers.- See Also:
-
-
Constructor Details
-
ElasticsearchHost
-
-
Method Details
-
online
- Parameters:
host
- must not be null.- Returns:
- new instance of
ElasticsearchHost
.
-
offline
- Parameters:
host
- must not be null.- Returns:
- new instance of
ElasticsearchHost
.
-
parse
Parse a hostAndPort string into aInetSocketAddress
.- Parameters:
hostAndPort
- the string containing host and port or IP address and port in the formathost:port
.- Returns:
- the parsed
InetSocketAddress
.
-
isOnline
public boolean isOnline()- Returns:
- true if the last known
ElasticsearchHost.State
wasElasticsearchHost.State.ONLINE
-
getEndpoint
- Returns:
- never null.
-
getState
- Returns:
- the last known
ElasticsearchHost.State
.
-
getTimestamp
- Returns:
- the
Instant
the information was captured.
-
toString
-