Esempio n. 1
0
        /// <summary>
        ///     Initializes this instance.
        /// </summary>
        public static void Initialize(string bucketName)
        {
            if (DatabaseManager._databases == null)
            {
                DatabaseManager._databases = new LogicArrayList <CouchbaseDatabase[]>();
            }

            CouchbaseDatabase[] databases = new CouchbaseDatabase[ServiceSettings.GetDatabaseUrls().Length];

            for (int i = 0; i < databases.Length; i++)
            {
                databases[i] = new CouchbaseDatabase(i, new ClientConfiguration
                {
                    Servers = new List <Uri>
                    {
                        new Uri("http://" + ServiceSettings.GetDatabaseUrls()[i])
                    }
                }, bucketName, ServiceSettings.GetDatabaseUserName(), ServiceSettings.GetDatabasePassword());
            }

            DatabaseManager._databases.Add(databases);
        }