Class DefaultConfigurationProvider

  • All Implemented Interfaces:
    ConfigurationProvider

    public class DefaultConfigurationProvider
    extends Object
    implements ConfigurationProvider
    The standard ConfigurationProvider that is used by default.

    This provider has been around since the 1.x days, but it has been revamped and reworked for the 2.x breakage - the overall functionality remains very similar though.

    Since:
    1.0.0
    • Constructor Detail

      • DefaultConfigurationProvider

        public DefaultConfigurationProvider​(Core core)
    • Method Detail

      • openBucket

        public Mono<Void> openBucket​(String name)
        Description copied from interface: ConfigurationProvider
        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.

        Specified by:
        openBucket in interface ConfigurationProvider
        Parameters:
        name - the name of the bucket to open.
        Returns:
        a Mono that completes once the bucket has been logically opened.
      • proposeBucketConfig

        public void proposeBucketConfig​(ProposedBucketConfigContext ctx)
        Description copied from interface: ConfigurationProvider
        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.

        Specified by:
        proposeBucketConfig in interface ConfigurationProvider
        Parameters:
        ctx - the bucket config and surrounding context.
      • closeBucket

        public Mono<Void> closeBucket​(String name)
        Description copied from interface: ConfigurationProvider
        Initiates the bucket closing process.
        Specified by:
        closeBucket in interface ConfigurationProvider
        Parameters:
        name - the name of the bucket.
        Returns:
        a Mono that completes once the bucket has been logically closed.
      • shutdown

        public Mono<Void> shutdown()
        Description copied from interface: ConfigurationProvider
        Shuts down the configuration provider and all its associated resources and timers.
        Specified by:
        shutdown in interface ConfigurationProvider
        Returns:
        the mono completes once shut down properly.
      • refreshCollectionMap

        public Mono<Void> refreshCollectionMap​(String bucket,
                                               boolean force)
        Description copied from interface: ConfigurationProvider
        Helper method to refresh the collection map for the given bucket.
        Specified by:
        refreshCollectionMap in interface ConfigurationProvider
        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.
        Returns:
        once refreshed completes the mono (or fails if error).