/// <summary> /// Creates a connection to a specific SASL authenticated Couchbase Bucket. /// </summary> /// <param name="bucketName">The Couchbase Bucket to connect to.</param> /// <param name="password">The SASL password to use.</param> /// <returns>An instance which implements the <see cref="IBucket"/> interface.</returns> /// <remarks>Use <see cref="CloseBucket(IBucket)"/> to release resources associated with a Bucket.</remarks> public IBucket OpenBucket(string bucketName, string password) { if (string.IsNullOrWhiteSpace(bucketName)) { if (bucketName == null) { throw new ArgumentNullException(nameof(bucketName)); } throw new ArgumentException("bucketname cannot be null, empty or whitespace.", nameof(bucketName)); } return(_clusterController.CreateBucket(bucketName, password, _configuration.Authenticator)); }
/// <summary> /// Opens the default bucket associated with a Couchbase Cluster. /// </summary> /// <returns>An instance which implements the IBucket interface with the /// default buckets configuration.</returns> /// <remarks>Use Cluster.CloseBucket(bucket) to release resources associated with a Bucket.</remarks> public IBucket OpenBucket() { return(_clusterController.CreateBucket(DefaultBucket, _credentials)); }
/// <summary> /// Opens the default bucket associated with a Couchbase Cluster. /// </summary> /// <returns>An instance which implements the IBucket interface with the /// default buckets configuration.</returns> /// <remarks>Use Cluster.CloseBucket(bucket) to release resources associated with a Bucket.</remarks> public IBucket OpenBucket() { return(_clusterController.CreateBucket(DefaultBucket, _configuration.Authenticator)); }
/// <summary> /// Opens the default bucket associated with a Couchbase Cluster. /// </summary> /// <returns>An instance which implements the IBucket interface with the /// default buckets configuration.</returns> /// <remarks>Use Cluster.CloseBucket(bucket) to release resources associated with a Bucket.</remarks> public IBucket OpenBucket() { return(_clusterController.CreateBucket(DefaultBucket)); }