Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
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);
            }
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 11
0
        public void RequestSubscriptions(Jid to, Jid from, IqCB cb, object cbArgs)
        {
            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, cbArgs);
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
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);
        }