Package com.couchbase.client.core.config
Class DefaultNodeInfo
java.lang.Object
com.couchbase.client.core.config.DefaultNodeInfo
- All Implemented Interfaces:
NodeInfo
public class DefaultNodeInfo extends Object implements NodeInfo
Default implementation of
NodeInfo
.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Constructor Description DefaultNodeInfo(String viewUri, String hostname, Map<String,Integer> ports, Map<String,AlternateAddress> alternateAddresses)
Creates a newDefaultNodeInfo
with no SSL services.DefaultNodeInfo(String hostname, Map<ServiceType,Integer> direct, Map<ServiceType,Integer> ssl, Map<String,AlternateAddress> alternateAddresses)
Creates a newDefaultNodeInfo
with SSL services. -
Method Summary
Modifier and Type Method Description Map<String,AlternateAddress>
alternateAddresses()
Contains alternate addresses, if set.String
hostname()
The inet address of the node.Map<ServiceType,Integer>
services()
The exposed non-ssl services.Map<ServiceType,Integer>
sslServices()
The exposed ssl services.String
toString()
String
useAlternateNetwork()
True if alternate addresses should be used, false otherwise.void
useAlternateNetwork(String useAlternateNetwork)
Setter to set if external networking should be used or not.
-
Constructor Details
-
DefaultNodeInfo
public DefaultNodeInfo(String viewUri, String hostname, Map<String,Integer> ports, Map<String,AlternateAddress> alternateAddresses)Creates a newDefaultNodeInfo
with no SSL services.- Parameters:
viewUri
- the URI of the view service.hostname
- the hostname of the node.ports
- the port list of the node services.
-
DefaultNodeInfo
public DefaultNodeInfo(String hostname, Map<ServiceType,Integer> direct, Map<ServiceType,Integer> ssl, Map<String,AlternateAddress> alternateAddresses)Creates a newDefaultNodeInfo
with SSL services.- Parameters:
hostname
- the hostname of the node.direct
- the port list of the direct node services.ssl
- the port list of the ssl node services.
-
-
Method Details
-
hostname
Description copied from interface:NodeInfo
The inet address of the node. -
services
Description copied from interface:NodeInfo
The exposed non-ssl services. -
sslServices
Description copied from interface:NodeInfo
The exposed ssl services.- Specified by:
sslServices
in interfaceNodeInfo
- Returns:
- a map containing all services with secured ports.
-
alternateAddresses
Description copied from interface:NodeInfo
Contains alternate addresses, if set.- Specified by:
alternateAddresses
in interfaceNodeInfo
- Returns:
- a map containing alternate addresses.
-
useAlternateNetwork
Description copied from interface:NodeInfo
True if alternate addresses should be used, false otherwise.- Specified by:
useAlternateNetwork
in interfaceNodeInfo
-
useAlternateNetwork
Description copied from interface:NodeInfo
Setter to set if external networking should be used or not.- Specified by:
useAlternateNetwork
in interfaceNodeInfo
- Parameters:
useAlternateNetwork
- if not null will be used.
-
toString
-