Пример #1
0
        public void CreateCollectionNode(Jid to, Jid from, string node, bool defaultConfig, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Create = new Create(node, Type.collection);

            if (defaultConfig)
            {
                pubsubIq.PubSub.Configure = new Configure();
            }

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #2
0
        public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, string subid, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            Unsubscribe unsub = new Unsubscribe(node, unsubscribe);

            if (subid != null)
            {
                unsub.SubId = subid;
            }

            pubsubIq.PubSub.Unsubscribe = unsub;

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #3
0
        public void CreateNode(Jid to, Jid from, string node, bool defaultConfig, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Create = new Create(node);

            if (defaultConfig)
            {
                pubsubIq.PubSub.Configure = new Configure();
            }

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
            }
        }
Пример #4
0
        public void CreateInstantNode(Jid to, Jid from, IqCB cb,object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Create = new Create();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #5
0
        public void RequestSubscriptionOptions(Jid to, Jid from, Jid subscribe, string node, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Options = new Options(subscribe, node);

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #6
0
        public void CreateInstantNode(Jid to, Jid from, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Create = new Create();

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #7
0
        public void RequestAffiliations(Jid to, Jid from, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Affiliations = new Affiliations();

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #8
0
        public void Subscribe(Jid to, Jid from, Jid subscribe, string node, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Subscribe = new Subscribe(node, subscribe);

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #9
0
        public void RequestSubscriptions(Jid to, Jid from, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            pubsubIq.PubSub.Subscriptions = new Subscriptions();

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
            }
        }
Пример #10
0
        public void RetractItem(Jid to, Jid from, string node, string id, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }


            pubsubIq.PubSub.Retract = new Retract(node, id);

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #11
0
        /// <summary>
        /// Publish a payload to a Node
        /// </summary>
        /// <param name="to"></param>
        /// <param name="from"></param>
        /// <param name="node"></param>
        /// <param name="payload"></param>
        /// <param name="cb"></param>
        /// <param name="cbArgs"></param>
        public void PublishItem(Jid to, Jid from, string node, Item payload, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
            {
                pubsubIq.From = from;
            }

            Publish publish = new Publish(node);

            publish.AddItem(payload);

            pubsubIq.PubSub.Publish = publish;

            if (cb == null)
            {
                m_connection.Send(pubsubIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
            }
        }
Пример #12
0
        public void RequestAffiliations(Jid to, Jid from, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Affiliations = new Affiliations();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #13
0
        public void CreateNode(Jid to, Jid from, string node, bool defaultConfig, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Create = new Create(node);

            if (defaultConfig)
                pubsubIq.PubSub.Configure = new Configure();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
        }
Пример #14
0
        public void RequestSubscriptions(Jid to, Jid from, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Subscriptions = new Subscriptions();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
        }
Пример #15
0
        public void RequestSubscriptionOptions(Jid to, Jid from, Jid subscribe, string node, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.get, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Options = new Options(subscribe, node);

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #16
0
        public void Subscribe(Jid to, Jid from, Jid subscribe, string node, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Subscribe = new Subscribe(node, subscribe);

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
        }
Пример #17
0
        public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Unsubscribe = new Unsubscribe(node, unsubscribe);

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #18
0
        public void RetractItem(Jid to, Jid from, string node, string id, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;


            pubsubIq.PubSub.Retract = new Retract(node, id);

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #19
0
        /// <summary>
        /// Publish a payload to a Node
        /// </summary>
        /// <param name="to"></param>
        /// <param name="from"></param>
        /// <param name="node"></param>
        /// <param name="payload"></param>
        /// <param name="cb"></param>
        /// <param name="cbArgs"></param>
        public void PublishItem(Jid to, Jid from, string node, Item payload, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            Publish publish = new Publish(node);
            publish.AddItem(payload);
            
            pubsubIq.PubSub.Publish = publish;

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #20
0
        public void CreateCollectionNode(Jid to, Jid from, string node, bool defaultConfig, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Create = new Create(node, Type.collection);

            if (defaultConfig)
                pubsubIq.PubSub.Configure = new Configure();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
Пример #21
0
        public void Unsubscribe(Jid to, Jid from, Jid unsubscribe, string node, string subid, IqHandler cb)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            Unsubscribe unsub = new Unsubscribe(node, unsubscribe);
            if (subid != null)
                unsub.SubId = subid;

            pubsubIq.PubSub.Unsubscribe = unsub;

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb);
        }