Beispiel #1
0
		public static Categories Create(string uri)
        {
			Categories categories = new Categories();

            categories.Uri = uri;

            return categories;
        }
Beispiel #2
0
        public static RoamingData Create(Categories categories)
        {
            RoamingData roamingData = new RoamingData();

            roamingData.categories = categories;

            return roamingData;
        }
		public void PreNotifySubscriber(IEnumerable<Category> categories, string[] exclude)
		{
			foreach (var category in categories)
			{
				if (exclude == null || Array.Exists<string>(exclude, exclude1 => exclude1 == category.Name) == false)
					if (SubsCategories.Contains(category.Name))
					{
						if (updateCategories == null)
							updateCategories = Categories.Create(Uri);
						updateCategories.Items.Add(category);
					}
			}
		}
		/// <summary>
		/// ProcessPublication
		/// </summary>
		/// <param name="uri"></param>
		/// <param name="categories"></param>
		/// <param name="endpointId">+sip.instance or Contact header</param>
		/// <returns></returns>
		public OutContent ProcessPublication(string uri, Categories categories, string endpointId)
		{
			lock (sync)
			{
				try
				{
					Publication publication = this.ResolvePublication(uri);

					return new OutContent(publication.Process(categories, endpointId), this.sync);
				}
				catch (Exception e)
				{
					throw new EnhancedPresenceException("ProcessPublication falied", e);
				}
			}
		}
Beispiel #5
0
        public static Categories Parse(XmlReader reader)
        {
			Categories categories = new Categories();

            while (reader.Read())
            {
                if ((reader.Name == "categories" || reader.Name == "publications")
                    && reader.NodeType == XmlNodeType.Element)
                {
                    categories.Uri = reader.GetAttribute("uri");
                }

                if ((reader.Name == "category" || reader.Name == "publication")
                    && reader.NodeType == XmlNodeType.Element)
                {
                    categories.Items.Add(
                        Category.Parse(reader)
                        );
                }
            }

            return categories;
        }
		private void SubscriptionResource_NotifySubscriber(SubscriptionResource resource, Categories categories)
		{
			notifyEvent.BeginInvoke(resource.Expires
				, (resource.Expires > 0) ? @"active" : @"terminated"
				, new OutContent(categories, this.sync)
				, resource.Subscription.Param
				, new AsyncCallback(SubscriptionResource_NotifySubscriber_EndInvoke)
				, notifyEvent);
		}
		public void NotifySubscriber()
		{
			if (this.proccessingSubscribe == false)
			{
				if (updateCategories != null)
				{
					SubscriptionResource.NotifySubscriberEvent(this, updateCategories);
					updateCategories = null;
				}
			}
		}
		public Categories EndSubscribeProccessing()
		{
			Categories result = updateCategories;
			if (result == null)
				result = Categories.Create(Uri);

			this.updateCategories = null;
			this.proccessingSubscribe = false;

			return result;
		}
Beispiel #9
0
		public RoamingData Process(Categories categories, string endpointId)
		{
			this.Process(categories.Items, endpointId);

			return RoamingData.Create(categories);
		}