internal void SuspendDatabaseCopyIfNecessary(ReplayConfiguration config)
        {
            string text = string.Empty;

            text = config.TargetMachine;
            if (!this.m_fConfigOnly && !WmiWrapper.IsFileExisting(text, config.DestinationEdbPath))
            {
                string fileName = string.Empty;
                fileName = Path.Combine(config.DestinationLogPath, EseHelper.MakeLogfileName(config.LogFilePrefix, "." + config.LogExtension, 1L));
                if (!WmiWrapper.IsFileExisting(SharedHelper.GetFqdnNameFromNode(config.SourceMachine), fileName))
                {
                    try
                    {
                        this.WriteWarning(Strings.EnableDBCSuspendReplayNoDbComment(config.Name));
                        ReplayRpcClientWrapper.RequestSuspend(text, config.IdentityGuid, Strings.EnableDBCSuspendReplayNoDbComment(config.Name));
                        ReplayEventLogConstants.Tuple_DbSeedingRequired.LogEvent(null, new object[]
                        {
                            config.Name,
                            text
                        });
                    }
                    catch (TaskServerTransientException ex)
                    {
                        ExTraceGlobals.CmdletsTracer.TraceDebug <TaskServerTransientException>((long)this.GetHashCode(), "SeedDatabase: Caught exception in RPC: {0}", ex);
                        base.WriteError(new InvalidOperationException(Strings.SgcFailedToSuspendRpc(config.Name, ex.Message)), ErrorCategory.InvalidOperation, this.Identity);
                    }
                    catch (TaskServerException ex2)
                    {
                        ExTraceGlobals.CmdletsTracer.TraceDebug <TaskServerException>((long)this.GetHashCode(), "SeedDatabase: Caught exception in RPC: {0}", ex2);
                        if (!(ex2 is ReplayServiceSuspendWantedSetException))
                        {
                            if (ex2 is ReplayServiceSuspendRpcPartialSuccessCatalogFailedException)
                            {
                                base.WriteWarning(ex2.Message);
                            }
                            else
                            {
                                base.WriteError(new InvalidOperationException(Strings.SgcFailedToSuspendRpc(config.Name, ex2.Message)), ErrorCategory.InvalidOperation, this.Identity);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected override void RpcOperation()
        {
            Database database = this.DataObject.GetDatabase <Database>();

            if (!base.IsActivationRpcSupported)
            {
                ReplayRpcClientWrapper.RequestSuspend(base.GetServerFqdn(), database.Guid, this.SuspendComment);
                return;
            }
            DatabaseCopyActionFlags flags = DatabaseCopyActionFlags.Replication | DatabaseCopyActionFlags.Activation;

            if (this.ActivationOnly)
            {
                flags = DatabaseCopyActionFlags.Activation;
            }
            if (base.IsRequestSuspend3RpcSupported)
            {
                ReplayRpcClientHelper.RequestSuspend3(base.GetServerFqdn(), database.Guid, this.SuspendComment, (uint)flags, 2U);
                return;
            }
            ReplayRpcClientWrapper.RequestSuspend2(base.GetServerFqdn(), database.Guid, this.SuspendComment, (uint)flags);
        }