Permalink
Browse files

NCBC-151: ICouchbaseClient missing public CouchbaseClient methods

Change-Id: Ifbe495cece2d923d1966ddaf552e6a4dc985bae1
Reviewed-on: http://review.couchbase.org/22356
Tested-by: John C. Zablocki <john@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  • Loading branch information...
1 parent 16f5843 commit ffaba6ea5864699bb4067be62597208e428c71cf @johnzablocki johnzablocki committed with John C. Zablocki Nov 8, 2012
@@ -16,7 +16,7 @@ namespace Couchbase.Tests
public abstract class CouchbaseClientTestsBase
{
- protected CouchbaseClient _Client;
+ protected ICouchbaseClient _Client;
[SetUp]
public void SetUp()
@@ -7,9 +7,9 @@ namespace Couchbase.Tests.Factories
{
public static class CouchbaseClientFactory
{
- private static CouchbaseClient _client;
+ private static ICouchbaseClient _client;
- public static CouchbaseClient CreateCouchbaseClient()
+ public static ICouchbaseClient CreateCouchbaseClient()
{
if (_client == null)
{
@@ -21,7 +21,7 @@ namespace Couchbase
/// <summary>
/// Client which can be used to connect to Couchbase servers.
/// </summary>
- public class CouchbaseClient : MemcachedClient, IHttpClientLocator, ICouchbaseClient, ICouchbaseResultsClient
+ public class CouchbaseClient : MemcachedClient, IHttpClientLocator, ICouchbaseClient
{
private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(CouchbaseClient));
private static readonly ICouchbaseClientConfiguration DefaultConfig = (ICouchbaseClientConfiguration)ConfigurationManager.GetSection("couchbase");
@@ -10,13 +10,13 @@ namespace Couchbase.Extensions
{
public static class CouchbaseClientExtensions
{
- public static bool StoreJson(this CouchbaseClient client, StoreMode storeMode, string key, object value)
+ public static bool StoreJson(this ICouchbaseClient client, StoreMode storeMode, string key, object value)
{
var json = JsonConvert.SerializeObject(value);
return client.Store(storeMode, key, json);
}
- public static T GetJson<T>(this CouchbaseClient client, string key) where T : class
+ public static T GetJson<T>(this ICouchbaseClient client, string key) where T : class
{
var json = client.Get<string>(key);
return json == null ? null : JsonConvert.DeserializeObject<T>(json);
@@ -4,7 +4,7 @@
using Enyim.Caching;
namespace Couchbase
{
- public interface ICouchbaseClient : IMemcachedClient
+ public interface ICouchbaseClient : IMemcachedClient, ICouchbaseResultsClient
{
object Get(string key, DateTime newExpiration);
T Get<T>(string key, DateTime newExpiration);
@@ -17,6 +17,9 @@ public interface ICouchbaseClient : IMemcachedClient
void Touch(string key, TimeSpan nextExpiration);
bool TryGet(string key, DateTime newExpiration, out object value);
bool TryGetWithCas(string key, DateTime newExpiration, out Enyim.Caching.Memcached.CasResult<object> value);
+ IView<IViewRow> GetView(string designName, string viewName);
+ IView<T> GetView<T>(string designName, string viewName, bool shouldLookupDocById = false);
+ IDictionary<string, object> Get(IView view);
}
}
@@ -5,10 +5,12 @@
using Enyim.Caching.Memcached.Results;
using Enyim.Caching.Memcached;
using Couchbase.Operations;
+using Enyim.Caching;
+using Couchbase.Results;
namespace Couchbase
{
- interface ICouchbaseResultsClient
+ public interface ICouchbaseResultsClient : IMemcachedResultsClient
{
IGetOperationResult ExecuteGet(string key, DateTime newExpiration);
IGetOperationResult<T> ExecuteGet<T>(string key, DateTime newExpiration);
@@ -26,6 +28,8 @@ interface ICouchbaseResultsClient
IStoreOperationResult ExecuteStore(StoreMode mode, string key, object value, TimeSpan validFor, PersistTo persistTo);
IStoreOperationResult ExecuteStore(StoreMode mode, string key, object value, TimeSpan validFor, ReplicateTo replicateTo);
+ IObserveOperationResult Observe(string key, ulong cas, PersistTo persistTo, ReplicateTo replicateTo);
+
}
}

0 comments on commit ffaba6e

Please sign in to comment.