Package com.couchbase.client.core.config
Interface ConfigurationProvider
- All Known Implementing Classes:
DefaultConfigurationProvider
public interface ConfigurationProvider
-
Method Summary
Modifier and Type Method Description rx.Observable<ClusterConfig>
closeBucket(String name)
rx.Observable<Boolean>
closeBuckets()
ClusterConfig
config()
Returns the current config or null if not set.rx.Observable<ClusterConfig>
configs()
Returns anObservable
, which pushes a newClusterConfig
once available.rx.Observable<ClusterConfig>
openBucket(String name, String password)
Start to fetch a config for the given bucket and also watch for changes, depending on the mechanism used.rx.Observable<ClusterConfig>
openBucket(String name, String username, String password)
Start to fetch a config for the given bucket and also watch for changes, depending on the mechanism used.void
proposeBucketConfig(ProposedBucketConfigContext ctx)
Propose a new bucket config with surrounding context.boolean
seedHosts(Set<String> hosts, boolean shuffle)
Set the initial seed hosts for bootstrap.rx.Observable<Boolean>
shutdown()
Shutdown theConfigurationProvider
into a terminal state where it cannot be used anymore and all its non-bucket resources are freed.void
signalOutdated()
-
Method Details
-
configs
rx.Observable<ClusterConfig> configs()Returns anObservable
, which pushes a newClusterConfig
once available.- Returns:
- the configuration.
-
config
ClusterConfig config()Returns the current config or null if not set.- Returns:
- returns the current cluster config.
-
seedHosts
Set the initial seed hosts for bootstrap. This should only be done as long as theConfigurationProvider
is not bootstrapped, otherwise it might be ignored.- Parameters:
hosts
- list of seed hosts.shuffle
- shuffle seed host list.- Returns:
- true if host list updated, false otherwise.
-
openBucket
Start to fetch a config for the given bucket and also watch for changes, depending on the mechanism used.- Parameters:
name
- the name of the bucket.password
- the name of the password.- Returns:
- an observable with the configuration if success, and failures otherwise.
-
openBucket
Start to fetch a config for the given bucket and also watch for changes, depending on the mechanism used.- Parameters:
name
- the name of the bucket.username
- the user authorized for bucket access.password
- the password of the user.- Returns:
- an observable with the configuration if success, and failures otherwise.
-
closeBucket
-
closeBuckets
rx.Observable<Boolean> closeBuckets() -
shutdown
rx.Observable<Boolean> shutdown()Shutdown theConfigurationProvider
into a terminal state where it cannot be used anymore and all its non-bucket resources are freed. -
proposeBucketConfig
Propose a new bucket config with surrounding context.- Parameters:
ctx
- the raw config including context.
-
signalOutdated
void signalOutdated()
-