Class DefaultClusterInfo
java.lang.Object
com.couchbase.client.java.cluster.DefaultClusterInfo
- All Implemented Interfaces:
ClusterInfo
public class DefaultClusterInfo extends Object implements ClusterInfo
Default implementation for a
ClusterInfo
.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Constructor Description DefaultClusterInfo(JsonObject raw)
-
Method Summary
Modifier and Type Method Description boolean
checkAvailable(CouchbaseFeature feature)
Checks the availability of a specifiedCouchbaseFeature
on the associatedCluster
.List<Version>
getAllVersions()
Returns the list ofVersion
obtained from the cluster from which thisClusterInfo
was obtained.Version
getMinVersion()
Returns the smallest node version (thus oldest version) in the cluster from which thisClusterInfo
was taken.JsonObject
raw()
Provides raw access to the full JSON information from the server.
-
Constructor Details
-
DefaultClusterInfo
-
-
Method Details
-
raw
Description copied from interface:ClusterInfo
Provides raw access to the full JSON information from the server.- Specified by:
raw
in interfaceClusterInfo
- Returns:
- the raw JSON cluster info.
-
checkAvailable
Description copied from interface:ClusterInfo
Checks the availability of a specifiedCouchbaseFeature
on the associatedCluster
. Note that this relies onClusterInfo.getMinVersion()
. If said method returnsVersion.NO_VERSION
then the feature will be deemed unavailable (this method will return false).- Specified by:
checkAvailable
in interfaceClusterInfo
- Parameters:
feature
- the feature to check for.- Returns:
- true if minimum node server version is compatible with the feature, false otherwise.
- See Also:
ClusterInfo.getMinVersion()
-
getMinVersion
Description copied from interface:ClusterInfo
Returns the smallest node version (thus oldest version) in the cluster from which thisClusterInfo
was taken. If list of version cannot be obtained then this returnsVersion.NO_VERSION
.- Specified by:
getMinVersion
in interfaceClusterInfo
- Returns:
- the smallest (oldest) server version in the cluster.
-
getAllVersions
Description copied from interface:ClusterInfo
Returns the list ofVersion
obtained from the cluster from which thisClusterInfo
was obtained. In case the versions cannot be obtained, an empty list is returned.- Specified by:
getAllVersions
in interfaceClusterInfo
- Returns:
- the list of nodes versions, or an empty list in case of errors.
-