public static void HandleRequest(RpcGenericRequestInfo requestInfo, ref RpcGenericReplyInfo replyInfo)
        {
            RpcGenericReplyInfo tmpReplyInfo = null;

            RpcKillServiceImpl.Request req = null;
            RpcKillServiceImpl.Reply   rep = new RpcKillServiceImpl.Reply();
            Exception ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
            {
                req = ActiveManagerGenericRpcHelper.ValidateAndGetAttachedRequest <RpcKillServiceImpl.Request>(requestInfo, 1, 0);
                ReplayCrimsonEvents.ReceivedRequestToKillService.Log <string, string, RpcKillServiceImpl.Request>(req.ServiceName, req.OriginatingServerName, req);
                lock (RpcKillServiceImpl.locker)
                {
                    RpcKillServiceImpl.HandleRequestInternal(req, rep);
                }
                tmpReplyInfo = ActiveManagerGenericRpcHelper.PrepareServerReply(requestInfo, rep, 1, 0);
            });

            if (tmpReplyInfo != null)
            {
                replyInfo = tmpReplyInfo;
            }
            if (ex != null)
            {
                throw new AmServerException(ex.Message, ex);
            }
        }
Exemple #2
0
        // Token: 0x0600079D RID: 1949 RVA: 0x00024D10 File Offset: 0x00022F10
        public static void HandleRequest(RpcGenericRequestInfo requestInfo, ref RpcGenericReplyInfo replyInfo)
        {
            RpcGenericReplyInfo tmpReplyInfo = null;

            RpcUpdateLastLogImpl.Request req = null;
            RpcUpdateLastLogImpl.Reply   rep = new RpcUpdateLastLogImpl.Reply();
            Exception ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
            {
                req = ActiveManagerGenericRpcHelper.ValidateAndGetAttachedRequest <RpcUpdateLastLogImpl.Request>(requestInfo, 1, 0);
                ExDateTime exDateTime = ExDateTime.MinValue;
                AmCachedLastLogUpdater pamCachedLastLogUpdater = AmSystemManager.Instance.PamCachedLastLogUpdater;
                if (pamCachedLastLogUpdater != null)
                {
                    exDateTime = pamCachedLastLogUpdater.AddEntries(req.ServerName, req.InitiatedTimeUtc, req.LastLogEntries);
                }
                rep.LastSuccessfulUpdateTimeUtc = exDateTime.UniversalTime;
                tmpReplyInfo = ActiveManagerGenericRpcHelper.PrepareServerReply(requestInfo, rep, 1, 0);
            });

            if (tmpReplyInfo != null)
            {
                replyInfo = tmpReplyInfo;
            }
            if (ex != null)
            {
                throw new AmServerException(ex.Message, ex);
            }
        }
Exemple #3
0
        // Token: 0x0600079E RID: 1950 RVA: 0x00024D78 File Offset: 0x00022F78
        internal static DateTime Send(AmServerName originatingServer, AmServerName targetServer, Dictionary <string, string> dbLastLogMap)
        {
            RpcUpdateLastLogImpl.Request attachedRequest = new RpcUpdateLastLogImpl.Request(originatingServer.Fqdn, dbLastLogMap);
            RpcGenericRequestInfo        requestInfo     = ActiveManagerGenericRpcHelper.PrepareClientRequest(attachedRequest, 2, 1, 0);

            RpcUpdateLastLogImpl.Reply reply = ActiveManagerGenericRpcHelper.RunRpcAndGetReply <RpcUpdateLastLogImpl.Reply>(requestInfo, targetServer.Fqdn, RegistryParameters.PamLastLogRpcTimeoutInMsec);
            return(reply.LastSuccessfulUpdateTimeUtc);
        }
        internal static RpcKillServiceImpl.Reply SendKillRequest(string serverName, string serviceName, DateTime minTimeCheck, bool isForce, int timeoutInMSec)
        {
            Exception ex = null;

            RpcKillServiceImpl.Reply reply = null;
            bool isSucceded = false;
            bool flag       = true;

            try
            {
                ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
                {
                    ReplayCrimsonEvents.SendingServiceKillRequest.Log <string, string>(serviceName, serverName);
                    RpcKillServiceImpl.Request attachedRequest = new RpcKillServiceImpl.Request(serviceName, minTimeCheck, false);
                    RpcGenericRequestInfo requestInfo          = ActiveManagerGenericRpcHelper.PrepareClientRequest(attachedRequest, 1, 1, 0);
                    reply      = ActiveManagerGenericRpcHelper.RunRpcAndGetReply <RpcKillServiceImpl.Reply>(requestInfo, serverName, timeoutInMSec);
                    isSucceded = reply.IsSucceeded;
                });
                flag = false;
            }
            finally
            {
                if (isSucceded)
                {
                    ReplayCrimsonEvents.ServiceKillRequestSucceeded.Log <string, string, string>(serviceName, serverName, reply.ToString());
                }
                else
                {
                    string text = "Unknown";
                    if (ex != null)
                    {
                        text = string.Format("Error: {0}", ex.Message);
                    }
                    else if (reply != null)
                    {
                        if (reply.IsThrottled)
                        {
                            text = "Throttled";
                        }
                        else if (reply.IsSkippedDueToTimeCheck)
                        {
                            text = "SkippedDueToTimeCheck";
                        }
                        else if (reply.IsSkippedDueToRegistryOverride)
                        {
                            text = "SkippedDueToRegistryOverride";
                        }
                    }
                    ReplayCrimsonEvents.ServiceKillRequestFailed.Log <string, string, bool, string, bool, string>(serviceName, serverName, reply != null && reply.IsThrottled, text, flag, (reply != null) ? reply.ToString() : "<null>");
                }
            }
            return(reply);
        }