예제 #1
0
		public ReplicationDestination[] GetForDatabase(string databaseName)
		{
			if (forDatabases.Keys.Contains(databaseName) == false || forDatabases[databaseName] == null)
				return null;

			var result = new ReplicationDestination[forDatabases[databaseName].Count];
			forDatabases[databaseName].CopyTo(result);
			return result;
		}
예제 #2
0
		protected bool Equals(ReplicationDestination other)
		{
			return string.Equals(Username, other.Username) && string.Equals(Password, other.Password) &&
			       string.Equals(Domain, other.Domain) && string.Equals(ApiKey, other.ApiKey) &&
			       string.Equals(Database, other.Database) &&
			       TransitiveReplicationBehavior == other.TransitiveReplicationBehavior &&
			       IgnoredClient.Equals(other.IgnoredClient) && Disabled.Equals(other.Disabled) &&
			       string.Equals(ClientVisibleUrl, other.ClientVisibleUrl);
		}
예제 #3
0
 protected bool Equals(ReplicationDestination other)
 {
     return(string.Equals(Username, other.Username) && string.Equals(Password, other.Password) &&
            string.Equals(Domain, other.Domain) && string.Equals(ApiKey, other.ApiKey) &&
            string.Equals(Database, other.Database) &&
            TransitiveReplicationBehavior == other.TransitiveReplicationBehavior &&
            IgnoredClient.Equals(other.IgnoredClient) && Disabled.Equals(other.Disabled) &&
            string.Equals(ClientVisibleUrl, other.ClientVisibleUrl));
 }
예제 #4
0
 public bool IsEqualTo(ReplicationDestination other)
 {
     return(string.Equals(Username, other.Username) && string.Equals(Password, other.Password) &&
            string.Equals(Domain, other.Domain) && string.Equals(ApiKey, other.ApiKey) &&
            string.Equals(Database, other.Database, StringComparison.InvariantCultureIgnoreCase) &&
            TransitiveReplicationBehavior == other.TransitiveReplicationBehavior &&
            IgnoredClient.Equals(other.IgnoredClient) && Disabled.Equals(other.Disabled) &&
            ((string.Equals(Url, other.Url, StringComparison.InvariantCultureIgnoreCase) && string.IsNullOrWhiteSpace(ClientVisibleUrl)) ||
             (!string.IsNullOrWhiteSpace(ClientVisibleUrl) && string.Equals(ClientVisibleUrl, other.ClientVisibleUrl, StringComparison.InvariantCultureIgnoreCase))));
 }
예제 #5
0
 public bool IsEqualTo(ReplicationDestination other)
 {
     return(string.Equals(Username, other.Username) && string.Equals(Password, other.Password) &&
            string.Equals(Domain, other.Domain) && string.Equals(ApiKey, other.ApiKey) &&
            string.Equals(Database, other.Database, StringComparison.OrdinalIgnoreCase) &&
            TransitiveReplicationBehavior == other.TransitiveReplicationBehavior &&
            IgnoredClient.Equals(other.IgnoredClient) && Disabled.Equals(other.Disabled) &&
            ((string.Equals(Url, other.Url, StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace(ClientVisibleUrl)) ||
             (!string.IsNullOrWhiteSpace(ClientVisibleUrl) && string.Equals(ClientVisibleUrl, other.ClientVisibleUrl, StringComparison.OrdinalIgnoreCase))) &&
            Extensions.DictionaryExtensions.ContentEquals(SpecifiedCollections, other.SpecifiedCollections));
 }
예제 #6
0
        private void SetupDB(IDocumentStore store, string dbName, bool addReplicationTarget, string targetDbName)
        {
            DeleteDatabase(store, dbName, true);

            var databaseDocument = new DatabaseDocument
            {
                Id       = dbName,
                Settings =
                {
                    { "Raven/ActiveBundles", "Replication"             },
                    { "Raven/DataDir",       "~\\Databases\\" + dbName }
                }
            };

            store.DatabaseCommands.EnsureDatabaseDocumentExists(databaseDocument);

            if (addReplicationTarget)
            {
                var replicationDestination = new Raven.Abstractions.Replication.ReplicationDestination()
                {
                    Url = SecondaryDocumentStore.Url,
                    TransitiveReplicationBehavior = TransitiveReplicationOptions.None,
                    Database = targetDbName
                };

                var newReplicationDocument = new Raven.Abstractions.Replication.ReplicationDocument()
                {
                    Destinations = new List <ReplicationDestination>()
                    {
                        replicationDestination
                    }
                };

                using (var session = store.OpenSession(dbName))
                {
                    session.Store(newReplicationDocument, @"Raven/Replication/Destinations");

                    session.SaveChanges();
                }
            }

            new RavenDocumentsByEntityName().Execute(
                store.DatabaseCommands.ForDatabase(dbName),
                store.Conventions
                );

            new DocsIndex().Execute(
                store.DatabaseCommands.ForDatabase(dbName),
                store.Conventions
                );
        }
예제 #7
0
 public bool IsEqualTo(ReplicationDestination other)
 {
     return string.Equals(Username, other.Username) && string.Equals(Password, other.Password) &&
            string.Equals(Domain, other.Domain) && string.Equals(ApiKey, other.ApiKey) &&
            string.Equals(Database, other.Database, StringComparison.OrdinalIgnoreCase) &&
            TransitiveReplicationBehavior == other.TransitiveReplicationBehavior &&				   
            IgnoredClient.Equals(other.IgnoredClient) && Disabled.Equals(other.Disabled) &&
            ((string.Equals(Url, other.Url, StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace(ClientVisibleUrl)) ||
            (!string.IsNullOrWhiteSpace(ClientVisibleUrl) && string.Equals(ClientVisibleUrl, other.ClientVisibleUrl, StringComparison.OrdinalIgnoreCase)));
 }
예제 #8
0
 protected bool Equals(ReplicationDestination other)
 {
     return IsEqualTo(other);
 }
예제 #9
0
 protected bool Equals(ReplicationDestination other)
 {
     return(IsEqualTo(other));
 }