Class Jabber::PubSub::NodeHelper
In: lib/xmpp4r/pubsub/helper/nodehelper.rb
Parent: ServiceHelper

Methods

Attributes

jiod  [R] 
my_subscriptions  [R] 
name  [R] 
nodename  [R] 

Public Class methods

creates a new node new(client,service,nodename)

stream:[Jabber::Stream]
jid:[String] (jid of the pubsub service)
nodename:[String]

[Source]

    # 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

Public Instance methods

creates the node create(configuration=nil)

configuration:[Jabber::XData]

[Source]

    # 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

[Source]

    # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 71
71:       def delete_node
72:         delete(@nodename)
73:       end

subscribe to this node do_subscribe

[Source]

     # 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]

[Source]

     # 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

[Source]

     # 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

[Source]

    # 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]

[Source]

    # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 55
55:       def get_configuration(subid=nil)
56:         get_options(@nodename,subid)
57:       end

get a count of items get_items(count)

count:[Fixnum]

[Source]

    # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 94
94:       def get_items(count)
95:         items(@nodename,count)
96:       end

get all subscribers subscribed on this node get_subscribers

[Source]

     # 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

[Source]

     # 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]

[Source]

    # 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

[Source]

     # 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

[Source]

    # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 64
64:       def set_configuration(configuration,subid=nil)
65:         set_options(@nodename,configuration,subid)
66:       end

Private Instance methods

[Source]

     # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 148
148:       def disco_info
149:       end

[Source]

     # File lib/xmpp4r/pubsub/helper/nodehelper.rb, line 144
144:       def node_exist?
145:         nodebrowser = PubSub::NodeBrowser.new(@stream)
146:         nodebrowser.nodes.include?(nodename)
147:       end

[Validate]