Пример #1
0
        public object Any(ProcessEventRequest request)
        {
            var subscriptionId   = GetHeader("SID");
            var notificationType = GetHeader("NT");
            var callback         = GetHeader("CALLBACK");
            var timeoutString    = GetHeader("TIMEOUT");

            var timeout = ParseTimeout(timeoutString);

            if (string.Equals(Request.Verb, "SUBSCRIBE", StringComparison.OrdinalIgnoreCase))
            {
                if (string.IsNullOrEmpty(notificationType))
                {
                    return(GetSubscriptionResponse(_eventManager.RenewEventSubscription(subscriptionId, timeout)));
                }

                return(GetSubscriptionResponse(_eventManager.CreateEventSubscription(notificationType, timeout, callback)));
            }

            return(GetSubscriptionResponse(_eventManager.CancelEventSubscription(subscriptionId)));
        }
Пример #2
0
        public object Any(ProcessEventRequest request)
        {
            var subscriptionId = GetHeader("SID");
            var notificationType = GetHeader("NT");
            var callback = GetHeader("CALLBACK");
            var timeoutString = GetHeader("TIMEOUT");

            var timeout = ParseTimeout(timeoutString);

            if (string.Equals(Request.Verb, "SUBSCRIBE", StringComparison.OrdinalIgnoreCase))
            {
                if (string.IsNullOrEmpty(notificationType))
                {
                    return GetSubscriptionResponse(_eventManager.RenewEventSubscription(subscriptionId, timeout));
                }

                return GetSubscriptionResponse(_eventManager.CreateEventSubscription(notificationType, timeout, callback));
            }

            return GetSubscriptionResponse(_eventManager.CancelEventSubscription(subscriptionId));
        }