Package com.couchbase.client.core.config
Interface ConfigurationProvider
-
- All Known Implementing Classes:
DefaultConfigurationProvider
@Internal public interface ConfigurationProvider
TheConfigurationProvider
is responsible for grabbing, converting and managing bucket and cluster configurations.This interface has been around since the 1.0 days, but it has been adapted to fit the 2.x types and process.
- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
bucketConfigLoadInProgress()
Returns true if a bucket config load attempt is in progress.Mono<Void>
closeBucket(String name)
Initiates the bucket closing process.CollectionMap
collectionMap()
Returns the attached collection map.boolean
collectionMapRefreshInProgress()
Returns true if a collection map refresh is in progress.ClusterConfig
config()
Returns the currentClusterConfig
.Flux<ClusterConfig>
configs()
This is a hot stream which when attached will return the current config as well as all subsequent ones.boolean
globalConfigLoadInProgress()
Returns true if an initial global config load attempt is in progress.Mono<Void>
loadAndRefreshGlobalConfig()
Instructs the provider to try and load the global config, and then manage it.Mono<Void>
openBucket(String name)
Initiates the bucket opening process.void
proposeBucketConfig(ProposedBucketConfigContext ctx)
Allows to propose a bucket config to the provider from an external context.void
proposeGlobalConfig(ProposedGlobalConfigContext ctx)
Allows to propose a global config to the provider from an external context.void
refreshCollectionMap(String bucket, boolean force)
Helper method to refresh the collection map for the given bucket.Mono<Void>
shutdown()
Shuts down the configuration provider and all its associated resources and timers.
-
-
-
Method Detail
-
configs
Flux<ClusterConfig> configs()
This is a hot stream which when attached will return the current config as well as all subsequent ones.- Returns:
- a flux of new configurations as they arrive.
-
config
ClusterConfig config()
Returns the currentClusterConfig
.- Returns:
- the current cluster configuration.
-
openBucket
Mono<Void> openBucket(String name)
Initiates the bucket opening process.Note that when this mono completes, it does not mean that the process is completely finished yet, just that it has been initiated and no hard error has been found at the time.
- Parameters:
name
- the name of the bucket to open.- Returns:
- a Mono that completes once the bucket has been logically opened.
-
closeBucket
Mono<Void> closeBucket(String name)
Initiates the bucket closing process.- Parameters:
name
- the name of the bucket.- Returns:
- a Mono that completes once the bucket has been logically closed.
-
shutdown
Mono<Void> shutdown()
Shuts down the configuration provider and all its associated resources and timers.- Returns:
- the mono completes once shut down properly.
-
proposeBucketConfig
void proposeBucketConfig(ProposedBucketConfigContext ctx)
Allows to propose a bucket config to the provider from an external context.This method is usually only called when a "not my vbucket" response is received and the corresponding config is extracted. Do not call this method with arbitrary configs.
- Parameters:
ctx
- the bucket config and surrounding context.
-
proposeGlobalConfig
void proposeGlobalConfig(ProposedGlobalConfigContext ctx)
Allows to propose a global config to the provider from an external context.- Parameters:
ctx
- the context with the global config.
-
loadAndRefreshGlobalConfig
Mono<Void> loadAndRefreshGlobalConfig()
Instructs the provider to try and load the global config, and then manage it.
-
collectionMap
CollectionMap collectionMap()
Returns the attached collection map.
-
refreshCollectionMap
void refreshCollectionMap(String bucket, boolean force)
Helper method to refresh the collection map for the given bucket.- Parameters:
bucket
- the name of the bucket.force
- if set, the provider must fetch a new one. otherwise it will only fetch one for the bucket if not already present.
-
globalConfigLoadInProgress
boolean globalConfigLoadInProgress()
Returns true if an initial global config load attempt is in progress.- Returns:
- true if it is in progress, false if not (done or failed).
-
bucketConfigLoadInProgress
boolean bucketConfigLoadInProgress()
Returns true if a bucket config load attempt is in progress.- Returns:
- true if in progress, false if not.
-
collectionMapRefreshInProgress
boolean collectionMapRefreshInProgress()
Returns true if a collection map refresh is in progress.- Returns:
- true if in progress, false if not.
-
-