Interface ClusterInfo
- All Known Implementing Classes:
DefaultClusterInfo
@Committed @Public public interface ClusterInfo
Provides information about a
Cluster.
Selected bucket properties are available through explicit getters, the full (raw JSON) response from the server
is accessible through the raw() method. Note that the response is subject to change across server
versions and therefore should be properly checked before being used.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
Method Summary
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.
-
Method Details
-
raw
JsonObject raw()Provides raw access to the full JSON information from the server.- Returns:
- the raw JSON cluster info.
-
checkAvailable
Checks the availability of a specifiedCouchbaseFeatureon the associatedCluster. Note that this relies ongetMinVersion(). If said method returnsVersion.NO_VERSIONthen the feature will be deemed unavailable (this method will return false).- Parameters:
feature- the feature to check for.- Returns:
- true if minimum node server version is compatible with the feature, false otherwise.
- See Also:
getMinVersion()
-
getMinVersion
Version getMinVersion()Returns 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.- Returns:
- the smallest (oldest) server version in the cluster.
-
getAllVersions
Returns the list ofVersionobtained from the cluster from which thisClusterInfowas obtained. In case the versions cannot be obtained, an empty list is returned.- Returns:
- the list of nodes versions, or an empty list in case of errors.
-