C# Class jabber.connection.PubSubNode

Inheritance: jabber.connection.StreamComponent, IEnumerable
Show file Open project: codebutler/jabber-net Class Usage Examples

Public Methods

Method Description
AddItemAddCallback ( ItemCB callback ) : void

Adds a handler for the OnItemAdd event, and calls the handler for any existing items. To prevent races, use this rather than .OnItemAdd +=.

AutomatedSubscribe ( ) : void

Creates the node then subscribes. If the creation succeeded, or if the node already exists, retrieve the items for the node. This is the typical starting point. Please make sure to register callbacks before calling this function.

Configure ( IqCB callback, object state ) : void

Request configuration form as the owner

Create ( ) : void

Creates the node with default configuration.

Create ( jabber config ) : void

Creates the node using the specified configuration form.

Delete ( ) : void

Deletes the node from the XMPP server.

DeleteItem ( string id ) : void

Deletes a single item from the XMPP server.

GetItems ( ) : void

Gets the items from the node on the XMPP server.

ItemAdded ( PubSubItem item ) : void

Notifies the client that an item has been add to this PubSubNode.

ItemRemoved ( PubSubItem item ) : void

Notifies the client that an item has been removed from this PubSubNode.

PublishItem ( string id, XmlElement contents ) : void

Publishes an item to the node.

Purge ( ) : void

Delete all items from a node at once.

Subscribe ( ) : void

Sends a subscription request. Items request will be sent automatically on successful subscribe.

Unsubscribe ( ) : void

Unsubscribes from the node.

this ( string id ) : XmlElement

Returns the contents of the specified item

Private Methods

Method Description
FireError ( Op op, string message, XmlElement protocol ) : void
FireItems ( jabber.protocol.iq.EventItems items ) : void
GetItemsIfPending ( ) : void
GotCreated ( object sender, IQ iq, object state ) : void
GotDelete ( object sender, IQ iq, object data ) : void
GotItems ( object sender, IQ iq, object state ) : void
GotPurge ( object sender, IQ iq, object data ) : void
GotSubscribed ( object sender, IQ iq, object state ) : void
GotUnsubsribed ( object sender, IQ iq, object data ) : void
IEnumerable ( ) : IEnumerator
NeedsAsking ( STATE state ) : bool
OnConfigure ( object sender, IQ iq, object data ) : void
OnDeleteNode ( object sender, IQ iq, object data ) : void
OnPublished ( object sender, IQ iq, object data ) : void
PubSubNode ( jabber.connection.XmppStream stream, JID jid, string node, int maxItems ) : System

Create a Node. Next, call Create and/or Subscribe.

SubscribeIfPending ( ) : void
addInfo ( PubSubIQ iq ) : void
createCommand ( PubSubCommandType type ) : PubSubIQ
this ( Op op ) : STATE

Method Details

AddItemAddCallback() public method

Adds a handler for the OnItemAdd event, and calls the handler for any existing items. To prevent races, use this rather than .OnItemAdd +=.
public AddItemAddCallback ( ItemCB callback ) : void
callback ItemCB Callback to call with every item.
return void

AutomatedSubscribe() public method

Creates the node then subscribes. If the creation succeeded, or if the node already exists, retrieve the items for the node. This is the typical starting point. Please make sure to register callbacks before calling this function.
public AutomatedSubscribe ( ) : void
return void

Configure() public method

Request configuration form as the owner
public Configure ( IqCB callback, object state ) : void
callback IqCB Callback. Must not be null. Will not be called back /// if there is an error, but instead OnError will be called.
state object State information to be passed back to callback
return void

Create() public method

Creates the node with default configuration.
public Create ( ) : void
return void

Create() public method

Creates the node using the specified configuration form.
public Create ( jabber config ) : void
config jabber Null for the default configuration
return void

Delete() public method

Deletes the node from the XMPP server.
public Delete ( ) : void
return void

DeleteItem() public method

Deletes a single item from the XMPP server.
public DeleteItem ( string id ) : void
id string Id of item.
return void

GetItems() public method

Gets the items from the node on the XMPP server.
public GetItems ( ) : void
return void

ItemAdded() public method

Notifies the client that an item has been add to this PubSubNode.
public ItemAdded ( PubSubItem item ) : void
item PubSubItem Item that was added.
return void

ItemRemoved() public method

Notifies the client that an item has been removed from this PubSubNode.
public ItemRemoved ( PubSubItem item ) : void
item PubSubItem Item that was removed.
return void

PublishItem() public method

Publishes an item to the node.
public PublishItem ( string id, XmlElement contents ) : void
id string If null, the server will assign an item ID.
contents System.Xml.XmlElement The XML inside the item. Should be in a new namespace.
return void

Purge() public method

Delete all items from a node at once.
public Purge ( ) : void
return void

Subscribe() public method

Sends a subscription request. Items request will be sent automatically on successful subscribe.
public Subscribe ( ) : void
return void

Unsubscribe() public method

Unsubscribes from the node.
public Unsubscribe ( ) : void
return void

this() public method

Returns the contents of the specified item
public this ( string id ) : XmlElement
id string Index of the element to retrieve.
return XmlElement