/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given username (which is a Couchbase Bucket) and password. /// </summary> /// <param name="ioStrategy">The <see cref="IOStrategy"/>to use for I/O.</param> /// <param name="username">The name of the Bucket you are connecting to.</param> /// <param name="password">The password for the Bucket.</param> public CramMd5Mechanism(IOStrategy ioStrategy, string username, string password, IByteConverter converter) { _ioStrategy = ioStrategy; Username = username; Password = password; _converter = converter; }
public PlainTextMechanism(IOStrategy strategy, string username, string password, IByteConverter converter) { _strategy = strategy; Username = username; Password = password; _converter = converter; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, IByteConverter, ISaslMechanism> saslFactory, IByteConverter converter, ITypeSerializer serializer) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, serializer) { }
public HttpStreamingProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { }
public HttpStreamingProvider(ClientConfiguration clientConfig, Func<IConnectionPool, ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) : base(clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, converter, transcoder, loggerFactory) { }
public CouchbaseConfigContext(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, IByteConverter, ISaslMechanism> saslFactory, IByteConverter converter, ITypeSerializer serializer) : base(bucketConfig, clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, serializer) { }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) { Key = key; Transcoder = transcoder; Opaque = opaque; CreationTime = DateTime.UtcNow; Timeout = timeout; VBucket = vBucket; Converter = transcoder.Converter; MaxRetries = DefaultRetries; Data = new MemoryStream(); Header = new OperationHeader {Status = ResponseStatus.None}; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { if (ClientConfig.EnableConfigHeartBeat) _heartBeat = new Timer(_heartBeat_Elapsed, null, ClientConfig.HeartbeatConfigInterval, Timeout.Infinite); else _heartBeat = new Timer(_heartBeat_Elapsed, null, Timeout.Infinite, Timeout.Infinite); }
protected ConfigProviderBase(ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) { _clientConfig = clientConfig; _ioServiceFactory = ioServiceFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; Converter = converter; Transcoder = transcoder; }
protected ConfigProviderBase(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, IByteConverter, ISaslMechanism> saslFactory, IByteConverter converter, ITypeSerializer serializer) { _clientConfig = clientConfig; _ioStrategyFactory = ioStrategyFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; Converter = converter; Serializer = serializer; }
public ClusterController(ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) { _clientConfig = clientConfig; _ioServiceFactory = ioServiceFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; Converter = converter; Transcoder = transcoder; Initialize(); }
protected ConfigContextBase(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, IByteConverter, ISaslMechanism> saslFactory, IByteConverter converter, ITypeSerializer serializer) { _bucketConfig = bucketConfig; _clientConfig = clientConfig; IOStrategyFactory = ioStrategyFactory; ConnectionPoolFactory = connectionPoolFactory; _creationTime = DateTime.Now; SaslFactory = saslFactory; Converter = converter; Serializer = serializer; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { _heartBeat = new Timer { Interval = ClientConfig.HeartbeatConfigInterval, Enabled = ClientConfig.EnableConfigHeartBeat, AutoReset = false }; _heartBeat.Elapsed += _heartBeat_Elapsed; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) : base(clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, converter, transcoder, loggerFactory) { AutoResetEvent autoEvent = new AutoResetEvent(false); _heartBeat = new Timer(_heartBeat_Elapsed, autoEvent, Timeout.Infinite, Timeout.Infinite); if (ClientConfig.EnableConfigHeartBeat) { _heartBeat.Change((int) ClientConfig.HeartbeatConfigInterval, Timeout.Infinite); } }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) { if (RequiresKey && string.IsNullOrWhiteSpace(key)) { throw new MissingKeyException(); } Key = key; Transcoder = transcoder; Opaque = opaque; CreationTime = DateTime.UtcNow; Timeout = timeout; VBucket = vBucket; Converter = transcoder.Converter; MaxRetries = DefaultRetries; Data = new MemoryStream(); Header = new OperationHeader {Status = ResponseStatus.None}; }
public Connection(IConnectionPool connectionPool, Socket socket, IByteConverter converter, BufferAllocator allocator) : base(socket, converter) { ConnectionPool = connectionPool; Configuration = ConnectionPool.Configuration; //set the max close attempts so that a connection in use is not disposed MaxCloseAttempts = Configuration.MaxCloseAttempts; _allocator = allocator; //create a seae with an accept socket and completed event _eventArgs = new SocketAsyncEventArgs(); _eventArgs.AcceptSocket = socket; _eventArgs.Completed += OnCompleted; //set the buffer to use with this saea instance _allocator.SetBuffer(_eventArgs); Offset = _eventArgs.Offset; }
public MultiplexingConnection(IConnectionPool connectionPool, Socket socket, IByteConverter converter, BufferAllocator allocator) : base(socket, converter, allocator) { ConnectionPool = connectionPool; Configuration = ConnectionPool.Configuration; //set the max close attempts so that a connection in use is not disposed MaxCloseAttempts = Configuration.MaxCloseAttempts; _statesInFlight = new ConcurrentDictionary<uint, IState>(); _statePool = new Queue<SyncState>(); //allocate a buffer _receiveBuffer = new byte[Configuration.BufferSize]; _receiveBufferLength = 0; //Start a dedicated background thread for receiving server responses. _receiveThread = new Thread(ReceiveThreadBody); _receiveThread.IsBackground = true; _receiveThread.Start(); }
public Connection(IConnectionPool connectionPool, Socket socket, IByteConverter converter, BufferAllocator allocator) : base(socket, converter, allocator) { ConnectionPool = connectionPool; Configuration = ConnectionPool.Configuration; //set the max close attempts so that a connection in use is not disposed MaxCloseAttempts = Configuration.MaxCloseAttempts; //create a seae with an accept socket and completed event _eventArgs = new SocketAsyncEventArgs(); _eventArgs.AcceptSocket = socket; _eventArgs.Completed += OnCompleted; //set the buffer to use with this saea instance if (!BufferAllocator.SetBuffer(_eventArgs)) { // failed to acquire a buffer because the allocator was exhausted throw new BufferUnavailableException("Unable to allocate a buffer for this connection because the BufferAllocator is exhausted."); } }
public ConnectionBase(Socket socket, IByteConverter converter, BufferAllocator bufferAllocator) : this(socket, new OperationAsyncState(), converter, bufferAllocator) { }
/// <summary> /// Reads a <see cref="UInt32"/> from a buffer, using network byte order. /// </summary> /// <param name="converter">The converter.</param> /// <param name="buffer">The buffer.</param> /// <returns></returns> public static uint ToUInt32(this IByteConverter converter, ReadOnlySpan <byte> buffer) { return(converter.ToUInt32(buffer, true)); }
public SaslStep(string key, string value, IByteConverter converter) : base(key, value, converter) { }
public FloatConverter(IDataProtectionProvider dataProtectionProvider, IByteConverter <float> byteConverter) : base(dataProtectionProvider.CreateProtector(_purpose), byteConverter) { }
public TypeSerializer(IByteConverter converter) { _converter = converter; }
protected ConnectionBase(Socket socket, IByteConverter converter) : this(socket, new OperationAsyncState(), converter, BufferManager.CreateBufferManager(1024 * 1000, 1024)) { }
/// <summary> /// Writes a <see cref="Int16"/> to a buffer, using network byte order. /// </summary> /// <param name="converter">The converter.</param> /// <param name="value">The value.</param> /// <param name="buffer">The buffer.</param> public static void FromInt16(this IByteConverter converter, short value, Span <byte> buffer) { converter.FromInt16(value, buffer, true); }
public DefaultTranscoder(IByteConverter converter) : this(converter, new JsonSerializerSettings(), new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }) { }
public void Setup() { _converter = new DefaultConverter(); _transcoder = new DefaultTranscoder(_converter, new DefaultSerializer()); _response = CreateResponse(_converter, _transcoder, DocSize); }
public DefaultTranscoder(IByteConverter converter, ITypeSerializer serializer) { Serializer = serializer; Converter = converter; }
public DefaultTranscoder(IByteConverter converter) : this(converter, new DefaultSerializer()) { }
public ULongConverter(IDataProtectionProvider dataProtectionProvider, IByteConverter <ulong> byteConverter) : base(dataProtectionProvider.CreateProtector(_purpose), byteConverter) { }
internal SslConnection(ConnectionPool <SslConnection> connectionPool, Socket socket, SslStream sslStream, IByteConverter converter) : base(socket, converter) { ConnectionPool = connectionPool; _sslStream = sslStream; Configuration = ConnectionPool.Configuration; _timingEnabled = Configuration.EnableOperationTiming; }
public DefaultTranscoder(IByteConverter converter, JsonSerializerSettings incomingSerializerSettings, JsonSerializerSettings outgoingSerializerSettings) { _converter = converter; _incomingSerializerSettings = incomingSerializerSettings; _outgoingSerializerSettings = outgoingSerializerSettings; }
/// <summary> /// CTOR for testing/dependency injection. /// </summary> /// <param name="configuration">The <see cref="PoolConfiguration"/> to use.</param> /// <param name="endPoint">The <see cref="IPEndPoint"/> of the Couchbase Server.</param> /// <param name="factory">A functory for creating <see cref="IConnection"/> objects./></param> /// <param name="converter">The <see cref="IByteConverter"/>that this instance is using.</param> internal ConnectionPoolBase(PoolConfiguration configuration, IPEndPoint endPoint, Func <IConnectionPool <T>, IByteConverter, BufferAllocator, T> factory, IByteConverter converter) { Configuration = configuration; Factory = factory; Converter = converter; BufferAllocator = Configuration.BufferAllocator(Configuration); EndPoint = endPoint; }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given <see cref="IOStrategy"/>. /// </summary> /// <param name="ioStrategy">The I/O strategy to use.</param> /// <param name="converter">The <see cref="IByteConverter"/> to use for converting to and from byte arrays.</param> public CramMd5Mechanism(IOStrategy ioStrategy, IByteConverter converter) { _ioStrategy = ioStrategy; _converter = converter; }
public EncryptedArrayConverter(IDataProtector dataProtector, JsonSerializerOptions options, IByteConverter <T> byteConverter) { _dataProtector = dataProtector; }
protected Get(string key, IVBucket vBucket, IByteConverter converter, ITypeTranscoder transcoder, uint opaque) : base(key, default(T), transcoder, vBucket, converter, opaque) { }
/// <summary> /// CTOR for testing/dependency injection. /// </summary> /// <param name="configuration">The <see cref="PoolConfiguration"/> to use.</param> /// <param name="endPoint">The <see cref="IPEndPoint"/> of the Couchbase Server.</param> /// <param name="factory">A functory for creating <see cref="IConnection"/> objects./></param> public ConnectionPool(PoolConfiguration configuration, IPEndPoint endPoint, Func <ConnectionPool <T>, IByteConverter, BufferAllocator, T> factory, IByteConverter converter) { _configuration = configuration; _factory = factory; _converter = converter; _bufferAllocator = Configuration.BufferAllocator(Configuration); EndPoint = endPoint; }
public ClusterManager(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, IByteConverter, ISaslMechanism> saslFactory, IByteConverter converter, ITypeSerializer serializer) { _clientConfig = clientConfig; _ioStrategyFactory = ioStrategyFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; _converter = converter; _serializer = serializer; Initialize(); }
/// <summary> /// Initializes a new instance of the <see cref="ConnectionPool{T}"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="endPoint">The end point.</param> /// <param name="factory">The factory.</param> /// <param name="converter">The converter.</param> internal ConnectionPool(PoolConfiguration configuration, IPEndPoint endPoint, Func <IConnectionPool <T>, IByteConverter, BufferAllocator, T> factory, IByteConverter converter) : base(configuration, endPoint, factory, converter) { }
public EqualityConstraint(string property, dynamic value, IByteConverter byteConverter) { Value = byteConverter.Convert(value); Property = property; }
public DecimalSerializer(IByteConverter converter) { Contracts.Requires.That(converter != null); this.converter = converter; }
/// <summary> /// Writes a <see cref="UInt64" /> to a new buffer, using network byte order. /// </summary> /// <param name="converter">The converter.</param> /// <param name="value">The value.</param> public static byte[] FromUInt64(this IByteConverter converter, ulong value) { return(converter.FromUInt64(value, true)); }
/// <summary> /// Reads a <see cref="UInt64"/> from a buffer, using network byte order. /// </summary> /// <param name="converter">The converter.</param> /// <param name="buffer">The buffer.</param> /// <returns></returns> public static ulong ToUInt64(this IByteConverter converter, ReadOnlySpan <byte> buffer) { return(converter.ToUInt64(buffer, true)); }
internal SslConnection(ConnectionPool <SslConnection> connectionPool, Socket socket, IByteConverter converter) : this(connectionPool, socket, new SslStream(new NetworkStream(socket)), converter) { }
public ISOParser(IByteConverter byteConverter) { this.byteConverter = byteConverter; }
public CharConverter(IDataProtectionProvider dataProtectionProvider, IByteConverter <char> byteConverter) : base(dataProtectionProvider.CreateProtector(_purpose), byteConverter) { }
public PlainTextMechanism(IOStrategy strategy, IByteConverter converter) { _strategy = strategy; _converter = converter; }
/// <summary> /// Creates a new bloom filter with appropriate bit width and hash functions for your expected size and error rate. /// </summary> /// <param name="expectedItems">The maximum number of items you expect to be in the bloom filter</param> /// <param name="acceptableErrorRate">The maximum rate of false positives you can accept. Must be a value between 0.00-1.00</param> /// <param name="byteConverter"></param> /// <returns>A new bloom filter configured appropriately for number of items and error rate</returns> public static GenericOptimizedBloomFilter <T> Create(int expectedItems, double acceptableErrorRate, IByteConverter <T> byteConverter) { return(new GenericOptimizedBloomFilter <T>(expectedItems, acceptableErrorRate, byteConverter)); }
/// <inheritdoc /> public GenericOptimizedBloomFilter(int expectedItems, double acceptableErrorRate, IByteConverter <T> byteConverter) : base(expectedItems, acceptableErrorRate, byteConverter) { _collectionState = new BitArray(CollectionLength, false); }
/// <summary> /// Writes a <see cref="UInt64"/> to a buffer, using network byte order. /// </summary> /// <param name="converter">The converter.</param> /// <param name="value">The value.</param> /// <param name="buffer">The buffer.</param> public static void FromUInt64(this IByteConverter converter, ulong value, Span <byte> buffer) { converter.FromUInt64(value, buffer, true); }
private Delete(string key, IVBucket vBucket, IByteConverter converter, ITypeTranscoder transcoder, uint opaque) : base(key, null, transcoder, vBucket, converter, opaque) { }
public PlainTextMechanism(string username, string password, IByteConverter converter) { Username = username; Password = password; _converter = converter; }
public Delete(string key, IVBucket vBucket, IByteConverter converter, ITypeTranscoder transcoder) : base(key, vBucket, converter, transcoder) { }
/// <inheritdoc /> protected GenericOptimizedBloomFilter(int bitArraySize, int numHashes, IByteConverter <T> byteConverter) : base(bitArraySize, numHashes, byteConverter) { _collectionState = new BitArray(bitArraySize, false); }
public StringEqualsConstraint(string property, string value, IByteConverter byteConverter) : base(property, value, byteConverter) { }
private static ISOParser CreateParser(IByteConverter byteConverter = null) { ISOParser isoParser = new ISOParser(byteConverter ?? new Mock<IByteConverter>().Object); return isoParser; }