public class DefaultClusterInfo extends Object implements ClusterInfo
Default implementation for a ClusterInfo
.
Constructor and Description |
---|
DefaultClusterInfo(JsonObject raw) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkAvailable(CouchbaseFeature feature)
Checks the availability of a specified
CouchbaseFeature on the associated Cluster . |
List<Version> |
getAllVersions()
Returns the list of
Version obtained from the cluster from which this ClusterInfo was obtained. |
Version |
getMinVersion()
Returns the smallest node version (thus oldest version) in the cluster from which this
ClusterInfo was taken. |
JsonObject |
raw()
Provides raw access to the full JSON information from the server.
|
public DefaultClusterInfo(JsonObject raw)
public JsonObject raw()
ClusterInfo
Provides raw access to the full JSON information from the server.
raw
in interface ClusterInfo
public boolean checkAvailable(CouchbaseFeature feature)
ClusterInfo
Checks the availability of a specified CouchbaseFeature
on the associated Cluster
.
Note that this relies on ClusterInfo.getMinVersion()
. If said method returns Version.NO_VERSION
then the feature will be deemed unavailable (this method will return false).
checkAvailable
in interface ClusterInfo
feature
- the feature to check for.ClusterInfo.getMinVersion()
public Version getMinVersion()
ClusterInfo
Returns the smallest node version (thus oldest version) in the cluster from which this ClusterInfo
was taken. If list of version cannot be obtained then this returns Version.NO_VERSION
.
getMinVersion
in interface ClusterInfo
public List<Version> getAllVersions()
ClusterInfo
Returns the list of Version
obtained from the cluster from which this ClusterInfo
was obtained. In case the versions cannot be obtained, an empty list is returned.
getAllVersions
in interface ClusterInfo
Copyright © 2015 Couchbase, Inc.. All rights reserved.