Exemplo n.º 1
0
        public MyCouchCloudantClient(IDbClientConnection connection, MyCouchCloudantClientBootstrapper bootstrapper = null)
            : base(connection, bootstrapper ?? new MyCouchCloudantClientBootstrapper())
        {
            bootstrapper = bootstrapper ?? new MyCouchCloudantClientBootstrapper();

            Searches = bootstrapper.SearchesFn(Connection);
        }
Exemplo n.º 2
0
        public MyCouchCloudantClient(IDbClientConnection connection, MyCouchCloudantClientBootstrapper bootstrapper = null)
            : base(connection, bootstrapper ?? new MyCouchCloudantClientBootstrapper())
        {
            bootstrapper = bootstrapper ?? new MyCouchCloudantClientBootstrapper();

            Searches = bootstrapper.SearchesFn(Connection);
        }
Exemplo n.º 3
0
        public MyCouchCloudantServerClient(ServerConnectionInfo connectionInfo, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connectionInfo, "connectionInfo").IsNotNull();

            IsDisposed = false;
            bootstrapper = bootstrapper ?? MyCouchCloudantClientBootstrappers.Default;

            Connection = bootstrapper.ServerConnectionFn(connectionInfo);
            Serializer = bootstrapper.SerializerFn();
            Databases = bootstrapper.DatabasesFn(Connection);
            Replicator = bootstrapper.ReplicatorFn(Connection);
            Security = bootstrapper.SecurityFn(Connection);
        }
Exemplo n.º 4
0
        public MyCouchCloudantServerClient(ServerConnectionInfo connectionInfo, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connectionInfo, "connectionInfo").IsNotNull();

            IsDisposed   = false;
            bootstrapper = bootstrapper ?? MyCouchCloudantClientBootstrappers.Default;

            Connection = bootstrapper.ServerConnectionFn(connectionInfo);
            Serializer = bootstrapper.SerializerFn();
            Databases  = bootstrapper.DatabasesFn(Connection);
            Replicator = bootstrapper.ReplicatorFn(Connection);
            Security   = bootstrapper.SecurityFn(Connection);
        }
        public MyCouchCloudantServerClient(IServerClientConnection connection, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connection, "connection").IsNotNull();

            Connection = connection;

            bootstrapper = bootstrapper ?? new MyCouchCloudantClientBootstrapper();

            Serializer = bootstrapper.SerializerFn();
            Security   = bootstrapper.SecurityFn(Connection);
            Databases  = bootstrapper.DatabasesFn(Connection);
            Replicator = bootstrapper.ReplicatorFn(Connection);
            IsDisposed = false;
        }
Exemplo n.º 6
0
        public MyCouchCloudantServerClient(IServerClientConnection connection, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connection, "connection").IsNotNull();

            Connection = connection;

            bootstrapper = bootstrapper ?? new MyCouchCloudantClientBootstrapper();

            Serializer = bootstrapper.SerializerFn();
            Security = bootstrapper.SecurityFn(Connection);
            Databases = bootstrapper.DatabasesFn(Connection);
            Replicator = bootstrapper.ReplicatorFn(Connection);
            IsDisposed = false;
        }
Exemplo n.º 7
0
        public MyCouchCloudantClient(DbConnectionInfo connectionInfo, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connectionInfo, "connectionInfo").IsNotNull();

            IsDisposed = false;
            bootstrapper = bootstrapper ?? MyCouchCloudantClientBootstrappers.Default;

            Connection = bootstrapper.DbConnectionFn(connectionInfo);
            Serializer = bootstrapper.SerializerFn();
            DocumentSerializer = bootstrapper.DocumentSerializerFn();
            Changes = bootstrapper.ChangesFn(Connection);
            Attachments = bootstrapper.AttachmentsFn(Connection);
            Database = bootstrapper.DatabaseFn(Connection);
            Documents = bootstrapper.DocumentsFn(Connection);
            Entities = bootstrapper.EntitiesFn(Connection);
            Views = bootstrapper.ViewsFn(Connection);
            Searches = bootstrapper.SearchesFn(Connection);
            Queries = bootstrapper.QueriesFn(Connection);
        }
Exemplo n.º 8
0
        public MyCouchCloudantClient(DbConnectionInfo connectionInfo, MyCouchCloudantClientBootstrapper bootstrapper = null)
        {
            Ensure.That(connectionInfo, "connectionInfo").IsNotNull();

            IsDisposed   = false;
            bootstrapper = bootstrapper ?? MyCouchCloudantClientBootstrappers.Default;

            Connection         = bootstrapper.DbConnectionFn(connectionInfo);
            Serializer         = bootstrapper.SerializerFn();
            DocumentSerializer = bootstrapper.DocumentSerializerFn();
            Changes            = bootstrapper.ChangesFn(Connection);
            Attachments        = bootstrapper.AttachmentsFn(Connection);
            Database           = bootstrapper.DatabaseFn(Connection);
            Documents          = bootstrapper.DocumentsFn(Connection);
            Entities           = bootstrapper.EntitiesFn(Connection);
            Views    = bootstrapper.ViewsFn(Connection);
            Searches = bootstrapper.SearchesFn(Connection);
            Queries  = bootstrapper.QueriesFn(Connection);
        }
Exemplo n.º 9
0
        private static IMyCouchClient CreateDbClient(string dbName)
        {
            var config = Environment;
            var connectionInfo = new DbConnectionInfo(config.ServerUrl, dbName);

            if (config.HasCredentials())
                connectionInfo.BasicAuth = new BasicAuthString(config.User, config.Password);

            if (config.IsAgainstCloudant())
            {
                var bootstrapper = new MyCouchCloudantClientBootstrapper
                {
                    DbConnectionFn = cnInfo => new CustomCloudantDbConnection(cnInfo)
                };

                return new MyCouchCloudantClient(connectionInfo, bootstrapper);
            }

            return new MyCouchClient(connectionInfo);
        }
Exemplo n.º 10
0
 public MyCouchCloudantClient(Uri serverAddress, string dbName, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new DbConnectionInfo(serverAddress, dbName), bootstrapper)
 {
 }
Exemplo n.º 11
0
 public MyCouchCloudantServerClient(Uri serverAddress, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new ServerConnectionInfo(serverAddress), bootstrapper) { }
Exemplo n.º 12
0
 public MyCouchCloudantServerClient(string serverAddress, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new Uri(serverAddress), bootstrapper) { }
Exemplo n.º 13
0
 public MyCouchCloudantServerClient(Uri serverAddress, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new ServerConnectionInfo(serverAddress), bootstrapper)
 {
 }
Exemplo n.º 14
0
 public MyCouchCloudantServerClient(string serverAddress, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new Uri(serverAddress), bootstrapper)
 {
 }
 static MyCouchCloudantClientBootstrappers()
 {
     Default = new MyCouchCloudantClientBootstrapper();
 }
Exemplo n.º 16
0
 static MyCouchCloudantClientBootstrappers()
 {
     Default = new MyCouchCloudantClientBootstrapper();
 }
Exemplo n.º 17
0
 public MyCouchCloudantClient(Uri serverAddress, string dbName, MyCouchCloudantClientBootstrapper bootstrapper = null)
     : this(new DbConnectionInfo(serverAddress, dbName), bootstrapper) { }