Exemple #1
0
        public static IADDatabaseCopy[] GetDatabaseCopies(Guid dbGuid, ref IADDatabase database)
        {
            Exception ex = null;

            IADDatabaseCopy[] array = null;
            LocalizedString   value = LocalizedString.Empty;

            try
            {
                if (database == null)
                {
                    database = AmHelper.FindDatabaseByGuid(dbGuid);
                }
                array = database.DatabaseCopies;
                if (array == null || array.Length == 0)
                {
                    value = ReplayStrings.AmBcsDatabaseHasNoCopies;
                    AmTrace.Error("GetDatabaseCopies(): Database has 0 copies in the AD.", new object[0]);
                }
            }
            catch (AmDatabaseNotFoundException ex2)
            {
                AmTrace.Error("GetDatabaseCopies(): AmDatabaseNotFoundException occurred (dbGuid={0}, exception={1})", new object[]
                {
                    dbGuid,
                    ex2
                });
                ex = ex2;
            }
            catch (ADTransientException ex3)
            {
                AmTrace.Error("GetDatabaseCopies(): ADTransientException occurred for GetDatabaseCopies() (database={0}, dbGuid={1}, exception={2})", new object[]
                {
                    database.Name,
                    dbGuid,
                    ex3
                });
                ex = ex3;
            }
            catch (ADExternalException ex4)
            {
                AmTrace.Error("GetDatabaseCopies(): ADExternalException occurred for GetDatabaseCopies() (database={0}, dbGuid={1}, exception={2})", new object[]
                {
                    database.Name,
                    dbGuid,
                    ex4
                });
                ex = ex4;
            }
            catch (ADOperationException ex5)
            {
                AmTrace.Error("GetDatabaseCopies(): ADOperationException occurred for GetDatabaseCopies() (database={0}, dbGuid={1}, exception={2})", new object[]
                {
                    database.Name,
                    dbGuid,
                    ex5
                });
                ex = ex5;
            }
            if (array == null || array.Length == 0)
            {
                throw new AmBcsFailedToQueryCopiesException((database == null) ? dbGuid.ToString() : database.Name, (ex != null) ? ex.Message : value, ex);
            }
            return(array);
        }
        // Token: 0x06000820 RID: 2080 RVA: 0x000276E0 File Offset: 0x000258E0
        internal static IADDatabase FindDatabaseByGuid(Guid dbGuid, bool throwOnError)
        {
            Exception ex;

            return(AmHelper.FindDatabaseByGuid(dbGuid, throwOnError, out ex));
        }
        // Token: 0x06000824 RID: 2084 RVA: 0x00027920 File Offset: 0x00025B20
        internal static bool IsDatabaseRcrEnabled(Guid mdbGuid)
        {
            IADDatabase iaddatabase = AmHelper.FindDatabaseByGuid(mdbGuid);

            return(iaddatabase.ReplicationType == ReplicationType.Remote);
        }
 // Token: 0x0600081F RID: 2079 RVA: 0x000276D5 File Offset: 0x000258D5
 internal static IADDatabase FindDatabaseByGuid(Guid dbGuid)
 {
     return(AmHelper.FindDatabaseByGuid(dbGuid, true));
 }