Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (51 sloc) 1.172 kb
using System;
namespace FluentCassandra.Connections
{
public abstract class ConnectionProvider : IConnectionProvider
{
/// <summary>
///
/// </summary>
/// <param name="builder"></param>
protected ConnectionProvider(IConnectionBuilder builder)
{
ConnectionBuilder = builder;
Servers = ServerManagerFactory.Get(builder);
}
/// <summary>
///
/// </summary>
public IConnectionBuilder ConnectionBuilder { get; private set; }
/// <summary>
///
/// </summary>
public IServerManager Servers { get; private set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public abstract IConnection CreateConnection();
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual IConnection Open()
{
var conn = CreateConnection();
conn.Open();
return conn;
}
public abstract void ErrorOccurred(IConnection connection, Exception exc = null);
/// <summary>
///
/// </summary>
/// <param name="connection"></param>
/// <returns></returns>
public virtual bool Close(IConnection connection)
{
if (connection.IsOpen)
connection.Close();
return true;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.