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);
            }
        }
        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);
            }
        }
        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);
            }
        }
Exemple #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);
        }
        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);
            }
        }
        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);
            }
        }
        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);
            }
        }
        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);
            }
        }
        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);
            }
        }
Exemple #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);
            }
        }
Exemple #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);
            }
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }