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 aClusterInfo.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultClusterInfo(JsonObject raw)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckAvailable(CouchbaseFeature feature)Checks the availability of a specifiedCouchbaseFeatureon the associatedCluster.List<Version>getAllVersions()Returns the list ofVersionobtained from the cluster from which thisClusterInfowas obtained.VersiongetMinVersion()Returns the smallest node version (thus oldest version) in the cluster from which thisClusterInfowas taken.JsonObjectraw()Provides raw access to the full JSON information from the server.
-
-
-
Constructor Detail
-
DefaultClusterInfo
public DefaultClusterInfo(JsonObject raw)
-
-
Method Detail
-
raw
public JsonObject raw()
Description copied from interface:ClusterInfoProvides raw access to the full JSON information from the server.- Specified by:
rawin interfaceClusterInfo- Returns:
- the raw JSON cluster info.
-
checkAvailable
public boolean checkAvailable(CouchbaseFeature feature)
Description copied from interface:ClusterInfoChecks the availability of a specifiedCouchbaseFeatureon the associatedCluster. Note that this relies onClusterInfo.getMinVersion(). If said method returnsVersion.NO_VERSIONthen the feature will be deemed unavailable (this method will return false).- Specified by:
checkAvailablein 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
public Version getMinVersion()
Description copied from interface:ClusterInfoReturns the smallest node version (thus oldest version) in the cluster from which thisClusterInfowas taken. If list of version cannot be obtained then this returnsVersion.NO_VERSION.- Specified by:
getMinVersionin interfaceClusterInfo- Returns:
- the smallest (oldest) server version in the cluster.
-
getAllVersions
public List<Version> getAllVersions()
Description copied from interface:ClusterInfoReturns the list ofVersionobtained from the cluster from which thisClusterInfowas obtained. In case the versions cannot be obtained, an empty list is returned.- Specified by:
getAllVersionsin interfaceClusterInfo- Returns:
- the list of nodes versions, or an empty list in case of errors.
-
-