Exemplo n.º 1
0
        private Exception ListMdbStatus(IStoreRpc rpcAdmin, Guid[] dbGuids, out MdbStatus[] status)
        {
            Exception result = null;

            status = null;
            TDataObject dataObject = base.DataObject;

            try
            {
                status = rpcAdmin.ListMdbStatus(dbGuids);
            }
            catch (MapiExceptionNetworkError mapiExceptionNetworkError)
            {
                result = mapiExceptionNetworkError;
            }
            catch (MapiExceptionNotFound mapiExceptionNotFound)
            {
                result = mapiExceptionNotFound;
            }
            catch (MapiRetryableException ex)
            {
                base.WriteError(new InvalidOperationException(Strings.ErrorFailedToUnmountDatabase(dataObject.Identity.ToString(), ex.Message)), ErrorCategory.InvalidOperation, dataObject.Identity);
            }
            catch (MapiPermanentException ex2)
            {
                base.WriteError(new InvalidOperationException(Strings.ErrorFailedToUnmountDatabase(dataObject.Identity.ToString(), ex2.Message)), ErrorCategory.InvalidOperation, dataObject.Identity);
            }
            return(result);
        }
        // Token: 0x0600049F RID: 1183 RVA: 0x00018E14 File Offset: 0x00017014
        public static Exception IsDatabaseMounted(Guid dbGuid, string activeNode, TimeSpan timeout, out bool isMounted)
        {
            isMounted = false;
            Exception result = null;
            bool      flag   = false;

            try
            {
                using (IStoreRpc newStoreControllerInstance = Dependencies.GetNewStoreControllerInstance(activeNode))
                {
                    Guid[] dbGuids = new Guid[]
                    {
                        dbGuid
                    };
                    MdbStatus[] array = newStoreControllerInstance.ListMdbStatus(dbGuids);
                    if (array == null || array.Length == 0)
                    {
                        AmTrace.Error("IsDatabaseMounted got an empty result", new object[0]);
                    }
                    else if (array[0].Status.HasFlag(MdbStatusFlags.Online))
                    {
                        flag = true;
                    }
                    else
                    {
                        AmTrace.Error("IsDatabaseMounted got an non-online status for db {0} : {1}", new object[]
                        {
                            dbGuid,
                            array[0].Status
                        });
                    }
                }
                isMounted = flag;
            }
            catch (MapiPermanentException ex)
            {
                result = ex;
            }
            catch (MapiRetryableException ex2)
            {
                result = ex2;
            }
            return(result);
        }