Exemplo n.º 1
0
 /// <summary>
 /// Purges all node item.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the pubsub service for this request</param>
 /// <param name="node">The node.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 /// <remarks>
 /// If a service persists published items, a node owner may want to purge
 /// the node of all published items (thus removing all items from the
 /// persistent store, with the exception of the last published item,
 /// which MAY be cached). It is OPTIONAL for a service to implement this
 /// feature.
 /// </remarks>
 public static async Task <Iq> PurgeNodeAsync(
     this IClientIqSender iqSender, Jid to, string node, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.PurgeNode(to, node), timeout, cancellationToken));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create an instant node
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the PubSub service.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 /// <remarks>
 /// Instant nodes are nodes whose node is is automatically generated by a pubsub service.
 /// </remarks>
 public static async Task <Iq> CreateInstantNodeAsync(
     this IClientIqSender iqSender, Jid to, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.CreateInstantNode(to), timeout, cancellationToken));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Retrieve Subscriptions List
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestSubscriptionsListAsync(
     this IClientIqSender iqSender, Jid to, string node, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.RequestSubscriptionsList(to, node), timeout, cancellationToken));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Unsubscribes from a node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="subId">The sub id.</param>
 /// <param name="jid">The jid.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> UnsubscribeAsync(
     this IClientIqSender iqSender, Jid to, string node, string subId, Jid jid, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.Unsubscribe(to, node, subId, jid), timeout, cancellationToken));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Submits the node configuration.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="form">The configuration form.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> SubmitNodeConfigurationAsync(
     this IClientIqSender iqSender, Jid to, string node, XData form, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.SubmitNodeConfiguration(to, node, form), timeout, cancellationToken));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Retracts the items.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the pubsub service for this request</param>
 /// <param name="node">The node.</param>
 /// <param name="itemIds">The item ids.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RetractItemsAsync(
     this IClientIqSender iqSender, Jid to, string node, string[] itemIds, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.RetractItems(to, node, itemIds), timeout, cancellationToken));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Edit the affiliations of an entity associated with a given node or set the affiliations for a new entity.
 /// The owner MUST send only modified affiliations (i.e., a "delta"), not the complete list.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the PubSub service.</param>
 /// <param name="node">The node.</param>
 /// <param name="affiliations">The affiliations.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> ModifyAffiliationsListAsync(
     this IClientIqSender iqSender, Jid to, string node, Xmpp.PubSub.Owner.Affiliation[] affiliations, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.ModifyAffiliations(to, node, affiliations), timeout, cancellationToken));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a new node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="config">The config.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> CreateNodeAsync(
     this IClientIqSender iqSender, Jid to, string node, Configure config, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.CreateNode(to, node, config), timeout, cancellationToken));
 }