Class | Jabber::PubSub::NodeHelper |
In: |
lib/xmpp4r/pubsub/helper/nodehelper.rb
|
Parent: | ServiceHelper |
jid | [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 27 27: def initialize(stream, jid, nodename = nil, create_if_not_exist = true) 28: super(stream,jid) 29: @nodename = nodename 30: @jid = jid 31: @stream = stream 32: 33: if create_if_not_exist and not node_exist? 34: # if no nodename is given a instant node will created 35: # (if the service supports instant nodes) 36: @nodename = create_node 37: else 38: get_subscriptions 39: end 40: end
creates the node create(configuration=nil)
configuration: | [Jabber::XData] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 46 46: def create_node(configuration = Jabber::PubSub::NodeConfig.new) 47: unless node_exist? 48: super(@nodename,configuration) 49: else 50: false 51: end 52: end
deletes the node delete
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 74 74: def delete_node 75: delete(@nodename) 76: end
subscribe to this node do_subscribe
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 125 125: def do_subscribe 126: subscribe_to(@nodename) 127: get_subscriptions 128: end
unsubscribe from this node do_unsubscribe(subid = nil)
subid: | [String] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 134 134: def do_unsubscribe(subid) 135: unsubscribe(@nodename,subid) 136: end
get all node affiliations get_affiliations
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 104 104: def get_affiliations 105: affiliations 106: end
gets all items from the node get_all_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 89 89: def get_all_items 90: items(@nodename) 91: end
get the configuration of the node get_configuration(configuration=nil)
configuration: | [Jabber::XData] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 58 58: def get_configuration(subid = nil) 59: get_options(@nodename, subid) 60: end
get all subscribers subscribed on this node get_subscribers
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 118 118: def get_subscribers 119: @subscriptions = subscribers(@nodename) 120: end
get all subscriptions on this node get_subscriptions
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 111 111: def get_subscriptions 112: get_subscriptions_from(@nodename) 113: end
publishing content on this node publish_content(items)
items: | [REXML::Element] |
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 82 82: def publish_content(items) 83: publish_item_to(@nodename,items) 84: end
purge all items from this node purge_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 141 141: def purge_items 142: purge(@nodename) 143: 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 67 67: def set_configuration(configuration,subid = nil) 68: set_options(@nodename, configuration, subid) 69: end