Class | Jabber::PubSub::NodeHelper |
In: |
lib/xmpp4r/pubsub/helper/nodehelper.rb
|
Parent: | ServiceHelper |
jiod | [R] | |
my_subscriptions | [R] | |
name | [R] | |
nodename | [R] |
creates a new node new(client,service,nodename)
stream: | [Jabber::Stream] |
jid: | [String] (jid of the pubsub service) |
nodename: | [String] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 28 28: def initialize(stream,jid,nodename=nil,create_if_not_exist=true) 29: super(stream,jid) 30: @nodename = nodename 31: @jid = jid 32: @stream = client 33: 34: get_subscriptions 35: 36: if create_if_not_exist and not node_exist? 37: # if no nodename is given a instant node will created 38: # (if the service supports instant nodes) 39: @nodename = create_node 40: end 41: end
creates the node create(configuration=nil)
configuration: | [Jabber::XData] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 47 47: def create_node(configuration=nil) 48: create(@nodename,configuration) 49: end
deletes the node delete
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 71 71: def delete_node 72: delete(@nodename) 73: end
subscribe to this node do_subscribe
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 122 122: def do_subscribe 123: subscribe(@nodename) 124: get_subscriptions 125: end
unsubscribe from this node do_unsubscribe(subid = nil)
subid: | [String] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 131 131: def do_unsubscribe(subid) 132: unsubscribe(@nodename,subid) 133: end
get all node affiliations get_affiliations
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 101 101: def get_affiliations 102: affiliations 103: end
gets all items from the node get_all_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 86 86: def get_all_items 87: items(@nodename) 88: end
get the configuration of the node get_configuration(configuration=nil)
configuration: | [Jabber::XData] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 55 55: def get_configuration(subid=nil) 56: get_options(@nodename,subid) 57: end
get all subscribers subscribed on this node get_subscribers
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 115 115: def get_subscribers 116: @subscriptions = subscribers(@nodename) 117: end
get all subscriptions on this node get_subscriptions
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 108 108: def get_subscriptions 109: subscriptions(@nodename) 110: end
publishing content on this node publish_content(items)
items: | [REXML::Element] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 79 79: def publish_content(items) 80: publish(@nodename,items) 81: end
purge all items from this node purge_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 138 138: def purge_items 139: purge(@nodename) 140: end
set the configuration of the node set_configuration(configuration=nil)
configuration: | [Jabber::XData] |
subid: | [String] default is nil |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 64 64: def set_configuration(configuration,subid=nil) 65: set_options(@nodename,configuration,subid) 66: end