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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault HTTP port for Elasticsearch servers. -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchHost(InetSocketAddress endpoint, ElasticsearchHost.State state) -
Method Summary
Modifier and TypeMethodDescriptiongetState()booleanisOnline()static ElasticsearchHostoffline(InetSocketAddress host) static ElasticsearchHostonline(InetSocketAddress host) static InetSocketAddressParse 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.StatewasElasticsearchHost.State.ONLINE
-
getEndpoint
- Returns:
- never null.
-
getState
- Returns:
- the last known
ElasticsearchHost.State.
-
getTimestamp
- Returns:
- the
Instantthe information was captured.
-
toString
-