Navigation Menu

Skip to content

Commit

Permalink
NCBC-1025: Make internal interfaces for IO public
Browse files Browse the repository at this point in the history
Motivation
----------
This commit makes it possible to extend the IO model by making certain
internal interfaces public.

Modifications
-------------
The interfaces included in this commit are now public.

Change-Id: Ie90727e1c48dece9722ff66a4ceda7ddaee1e4b0
Reviewed-on: http://review.couchbase.org/56581
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Simon Baslé <simon@couchbase.com>
  • Loading branch information
jeffrymorris committed Nov 2, 2015
1 parent 72ecb79 commit 03ad54e
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 12 deletions.
106 changes: 106 additions & 0 deletions Src/Couchbase.Tests/Fakes/FakeConnection.cs
Expand Up @@ -125,5 +125,111 @@ public bool HasShutdown
{
get { throw new NotImplementedException(); }
}

Socket IConnection.Socket
{
get { throw new NotImplementedException(); }
}

Guid IConnection.Identity
{
get { throw new NotImplementedException(); }
}

bool IConnection.IsAuthenticated
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}

bool IConnection.IsSecure
{
get { throw new NotImplementedException(); }
}

EndPoint IConnection.EndPoint
{
get { throw new NotImplementedException(); }
}

bool IConnection.IsDead
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}

void IConnection.SendAsync(byte[] buffer, Func<SocketAsyncState, Task> callback)
{
throw new NotImplementedException();
}

byte[] IConnection.Send(byte[] request)
{
throw new NotImplementedException();
}

bool IConnection.InUse
{
get { throw new NotImplementedException(); }
}

void IConnection.MarkUsed(bool isUsed)
{
throw new NotImplementedException();
}

void IConnection.CountdownToClose(uint interval)
{
throw new NotImplementedException();
}

int IConnection.MaxCloseAttempts
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}

int IConnection.CloseAttempts
{
get { throw new NotImplementedException(); }
}

bool IConnection.IsDisposed
{
get { throw new NotImplementedException(); }
}

bool IConnection.HasShutdown
{
get { throw new NotImplementedException(); }
}

void IConnection.Authenticate()
{
throw new NotImplementedException();
}

void IDisposable.Dispose()
{
throw new NotImplementedException();
}
}
}
2 changes: 1 addition & 1 deletion Src/Couchbase/Authentication/SASL/ISaslMechanism.cs
Expand Up @@ -5,7 +5,7 @@ namespace Couchbase.Authentication.SASL
/// <summary>
/// Provides and interface for implementating a SASL authentication mechanism (CRAM MD5 or PLAIN).
/// </summary>
interface ISaslMechanism
public interface ISaslMechanism
{
/// <summary>
/// The username or Bucket name.
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/Core/IMappedNode.cs
@@ -1,6 +1,6 @@
namespace Couchbase.Core
{
internal interface IMappedNode
public interface IMappedNode
{
IServer LocatePrimary();

Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/Core/IServer.cs
Expand Up @@ -13,7 +13,7 @@ namespace Couchbase.Core
/// <summary>
/// Represents a Couchbase Server node on the network.
/// </summary>
internal interface IServer : IDisposable, IQueryCacheInvalidator
public interface IServer : IDisposable, IQueryCacheInvalidator
{
/// <summary>
/// Gets a value indicating whether this instance is MGMT node.
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/Core/IVBucket.cs
Expand Up @@ -4,7 +4,7 @@ namespace Couchbase.Core
/// <summary>
/// Represents a VBucket partition in a Couchbase cluster
/// </summary>
internal interface IVBucket : IMappedNode
public interface IVBucket : IMappedNode
{
/// <summary>
/// Locates a replica for a given index.
Expand Down
8 changes: 8 additions & 0 deletions Src/Couchbase/IO/ConnectionBase.cs
Expand Up @@ -244,6 +244,14 @@ public virtual void Dispose()
_inUse = false;
_timer.Dispose();
}

/// <summary>
/// Authenticates this instance.
/// </summary>
public virtual void Authenticate()
{
//noop
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion Src/Couchbase/IO/IConnection.cs
Expand Up @@ -9,7 +9,7 @@ namespace Couchbase.IO
/// <summary>
/// Represents a TCP connection to a Couchbase Server instance.
/// </summary>
internal interface IConnection : IDisposable
public interface IConnection : IDisposable
{
/// <summary>
/// The Socket used for IO.
Expand Down Expand Up @@ -116,6 +116,11 @@ internal interface IConnection : IDisposable
/// <c>true</c> if this instance has shutdown; otherwise, <c>false</c>.
/// </value>
bool HasShutdown { get; }

/// <summary>
/// Authenticates this instance.
/// </summary>
void Authenticate();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/IO/IConnectionPool.cs
Expand Up @@ -10,7 +10,7 @@ namespace Couchbase.IO
/// <summary>
/// Represents a pool of TCP connections to a Couchbase Server node.
/// </summary>
internal interface IConnectionPool : IDisposable
public interface IConnectionPool : IDisposable
{
/// <summary>
/// Returns a <see cref="IConnection"/> the pool, creating a new one if none are available
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/IO/IOStrategy.cs
Expand Up @@ -9,7 +9,7 @@ namespace Couchbase.IO
/// <summary>
/// Primary interface for the IO engine.
/// </summary>
internal interface IOStrategy : IDisposable
public interface IOStrategy : IDisposable
{
/// <summary>
/// Executes an operation for a given key.
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/IO/Operations/IOperation'.cs
Expand Up @@ -4,7 +4,7 @@

namespace Couchbase.IO.Operations
{
internal interface IOperation<out T> : IOperation
public interface IOperation<out T> : IOperation
{
Couchbase.IOperationResult<T> GetResultWithValue();

Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/IO/Operations/IOperation.cs
Expand Up @@ -8,7 +8,7 @@

namespace Couchbase.IO.Operations
{
internal interface IOperation
public interface IOperation
{
OperationCode OperationCode { get; }

Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/IQueryCacheInvalidator.cs
Expand Up @@ -4,7 +4,7 @@ namespace Couchbase
/// <summary>
/// Provides a method signature for invalidating and clearing a cache.
/// </summary>
interface IQueryCacheInvalidator
public interface IQueryCacheInvalidator
{
/// <summary>
/// Invalidates and clears the query cache. This method can be used to explicitly clear the internal N1QL query cache. This cache will
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/N1QL/IQueryClient.cs
Expand Up @@ -8,7 +8,7 @@ namespace Couchbase.N1QL
/// <summary>
/// An interface for client-side support for executing N1QL queries against a Couchbase Server.
/// </summary>
internal interface IQueryClient : IQueryCacheInvalidator
public interface IQueryClient : IQueryCacheInvalidator
{
/// <summary>
/// Executes an ad-hoc N1QL query against a Couchbase Server.
Expand Down
2 changes: 1 addition & 1 deletion Src/Couchbase/Views/IViewClient.cs
Expand Up @@ -6,7 +6,7 @@ namespace Couchbase.Views
/// <summary>
/// An interface for client-side support for querying Couchbase views.
/// </summary>
internal interface IViewClient
public interface IViewClient
{
/// <summary>
/// Executes a <see cref="IViewQuery"/> asynchronously against a View.
Expand Down

0 comments on commit 03ad54e

Please sign in to comment.