• CacheManager
  • Documentation
  • Api Docs
  • MichaCo.net
    Show / Hide Table of Contents

    Class CouchbaseConfigurationBuilderExtensions

    Extensions for the configuration builder specific to the Couchbase cache handle.

    Inheritance
    Object
    CouchbaseConfigurationBuilderExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace:CacheManager.Core
    Assembly:CacheManager.Couchbase.dll
    Syntax
    public static class CouchbaseConfigurationBuilderExtensions

    Methods

    | Improve this Doc View Source

    WithCouchbaseCacheHandle(ConfigurationBuilderCachePart, String, String, Boolean)

    Adds a BucketCacheHandle<TCacheValue> using the configuration referenced via couchbaseConfigurationKey.

    The cache handle needs configuration specific to Couchbase, see remarks for details.

    Declaration
    public static ConfigurationBuilderCacheHandlePart WithCouchbaseCacheHandle(this ConfigurationBuilderCachePart part, string couchbaseConfigurationKey, string bucketName = "default", bool isBackplaneSource = true)
    Parameters
    Type Name Description
    ConfigurationBuilderCachePart part

    The builder part.

    String couchbaseConfigurationKey

    The configuration identifier.

    String bucketName

    The name of the Couchbase bucket which should be used by the cache handle.

    Boolean isBackplaneSource

    Set this to true if this cache handle should be the source of the backplane. This setting will be ignored if no backplane is configured.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The part.

    Remarks

    The Couchbase cache handle requires configuration which can be defined via:

    • A configuration with a matching couchbaseConfigurationKey being added via WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ClientConfiguration).
    • A cluster with a matching couchbaseConfigurationKey being added via WithCouchbaseCluster(ConfigurationBuilderCachePart, String, ICluster).
    • A CouchbaseClientSection configured in App/Web.config (only available on full .NET Framework).
    • Or, the cluster has been configured via Couchbase.ClusterHelper and CacheManager will use the cluster returned by Couchbase.ClusterHelper.Get. Anyways, this will be the last fallback which, if nothing has been configured at all, will fall back to the default server endpoint on 127.0.0.1:8091.

    If your cluster requires authentication, use either the Couchbase.ClusterHelper or add a Couchbase.Core.ICluster with valid authentication via cluster.Authenticate(...).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if bucketName or couchbaseConfigurationKey is null.

    | Improve this Doc View Source

    WithCouchbaseCacheHandle(ConfigurationBuilderCachePart, String, String, String, Boolean)

    Adds a BucketCacheHandle<TCacheValue> using the configuration referenced via couchbaseConfigurationKey.

    The cache handle needs configuration specific to Couchbase, see remarks for details.

    Declaration
    public static ConfigurationBuilderCacheHandlePart WithCouchbaseCacheHandle(this ConfigurationBuilderCachePart part, string couchbaseConfigurationKey, string bucketName, string bucketPassword, bool isBackplaneSource = true)
    Parameters
    Type Name Description
    ConfigurationBuilderCachePart part

    The builder part.

    String couchbaseConfigurationKey

    The configuration identifier.

    String bucketName

    The name of the Couchbase bucket which should be used by the cache handle.

    String bucketPassword

    The bucket password.

    Boolean isBackplaneSource

    Set this to true if this cache handle should be the source of the backplane. This setting will be ignored if no backplane is configured.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The part.

    Remarks

    The Couchbase cache handle requires configuration which can be defined via:

    • A configuration with a matching couchbaseConfigurationKey being added via WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ClientConfiguration).
    • A cluster with a matching couchbaseConfigurationKey being added via WithCouchbaseCluster(ConfigurationBuilderCachePart, String, ICluster).
    • A CouchbaseClientSection configured in App/Web.config (only available on full .NET Framework).
    • Or, the cluster has been configured via Couchbase.ClusterHelper and CacheManager will use the cluster returned by Couchbase.ClusterHelper.Get. Anyways, this will be the last fallback which, if nothing has been configured at all, will fall back to the default server endpoint on 127.0.0.1:8091.

    If your cluster requires authentication, use either the Couchbase.ClusterHelper or add a Couchbase.Core.ICluster with valid authentication via cluster.Authenticate(...).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if bucketName or couchbaseConfigurationKey is null.

    | Improve this Doc View Source

    WithCouchbaseCluster(ConfigurationBuilderCachePart, String, ICluster)

    Adds an already configured Couchbase.Core.ICluster for the given key. Use this in case you want to use the cluster outside of CacheManager, too and you want to share this instance.

    Use configurationKey in WithCouchbaseCacheHandle(ConfigurationBuilderCachePart, String, String, Boolean) (or similar overloads) to have the cache handle use this configuration.

    If your cluster requires authentication, you might have to configure cluster.Authenticate(...).

    Declaration
    public static ConfigurationBuilderCachePart WithCouchbaseCluster(this ConfigurationBuilderCachePart part, string configurationKey, ICluster cluster)
    Parameters
    Type Name Description
    ConfigurationBuilderCachePart part

    The part.

    String configurationKey

    The configuration key.

    Couchbase.Core.ICluster cluster

    The Couchbase.Core.ICluster.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The configuration builder. If configurationKey or cluster is null.

    | Improve this Doc View Source

    WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ClientConfiguration)

    Adds a Couchbase.Configuration.Client.ClientConfiguration for the given key.

    The key will be matched with the Couchbase cache handle name.

    Declaration
    public static ConfigurationBuilderCachePart WithCouchbaseConfiguration(this ConfigurationBuilderCachePart part, string configurationKey, ClientConfiguration config)
    Parameters
    Type Name Description
    ConfigurationBuilderCachePart part

    The part.

    String configurationKey

    The key which has to match with the cache handle name.

    Couchbase.Configuration.Client.ClientConfiguration config

    The Couchbase configuration object.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The configuration builder.

    Exceptions
    Type Condition
    ArgumentNullException

    If configurationKey or config is null.

    | Improve this Doc View Source

    WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ICouchbaseClientDefinition)

    Adds a Couchbase.Configuration.Client.ClientConfiguration for the given key.

    The key will be matched with the Couchbase cache handle name.

    Declaration
    public static ConfigurationBuilderCachePart WithCouchbaseConfiguration(this ConfigurationBuilderCachePart part, string configurationKey, ICouchbaseClientDefinition definition)
    Parameters
    Type Name Description
    ConfigurationBuilderCachePart part

    The part.

    String configurationKey

    The key which has to match with the cache handle name.

    Couchbase.Configuration.Client.ICouchbaseClientDefinition definition

    The Couchbase configuration object.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The configuration builder.

    Exceptions
    Type Condition
    ArgumentNullException

    If configurationKey or definition is null.

    • Improve this Doc
    • View Source
    © 2025 by Michael Conrad. All rights reserved. - MichaCo.net