creates a new node new(client,service,nodename)
(jid of the pubsub service)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 27 def initialize(stream, jid, nodename = nil, create_if_not_exist = true) super(stream,jid) @nodename = nodename @jid = jid @stream = stream if create_if_not_exist and !node_exist? # if no nodename is given a instant node will created # (if the service supports instant nodes) @nodename = create_node else get_subscriptions end end
creates the node create(configuration=nil)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 46 def create_node(configuration = Jabber::PubSub::NodeConfig.new) unless node_exist? super(@nodename,configuration) else false end end
deletes the node delete
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 74 def delete_node delete(@nodename) end
subscribe to this node #do_subscribe
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 125 def do_subscribe subscribe_to(@nodename) get_subscriptions end
unsubscribe from this node #do_unsubscribe(subid = nil)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 134 def do_unsubscribe(subid) unsubscribe(@nodename,subid) end
get all node affiliations #get_affiliations
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 104 def get_affiliations affiliations end
gets all items from the node #get_all_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 89 def get_all_items get_items_from(@nodename) end
get the configuration of the node #get_configuration(configuration=nil)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 58 def get_configuration(subid = nil) get_options(@nodename, subid) end
get a count of items #get_items(count)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 97 def get_items(count) get_items_from(@nodename,count) end
get all subscribers subscribed on this node #get_subscribers
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 118 def get_subscribers @subscriptions = subscribers(@nodename) end
get all subscriptions on this node #get_subscriptions
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 111 def get_subscriptions get_subscriptions_from(@nodename) end
publishing content on this node #publish_content(items)
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 82 def publish_content(items) publish_item_to(@nodename,items) end
purge all items from this node #purge_items
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 141 def purge_items purge(@nodename) end
set the configuration of the node #set_configuration(configuration=nil)
default is nil
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 67 def set_configuration(configuration,subid = nil) set_options(@nodename, configuration, subid) end
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 151 def disco_info end
# File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 147 def node_exist? nodebrowser = PubSub::NodeBrowser.new(@stream) nodebrowser.nodes(@jid).include?(@nodename) end