Class Jabber::PubSub::NodeHelper
In: lib/xmpp4r/pubsub/helper/nodehelper.rb
Parent: ServiceHelper
Message Presence XMPPStanza Iq Singleton IdGenerator XMPPElement X IqQuery Error Connection Client Component Client Comparable JID RuntimeError AuthenticationFailure ErrorException NoNameXmlnsRegistered SOCKS5Error REXML::Element Stream SOCKS5Bytestreams SOCKS5BytestreamsTarget SOCKS5BytestreamsInitiator XMPPElement StreamHost IqSiFileRange IqSiFile StreamHostUsed IqSi XRosterItem RosterItem IqFeature XMUCUserItem XMUCUserInvite IqPubSub Items Subscription IqPubSubOwner Item Event Feature Item Identity XDataField XDataReported XDataTitle XDataInstructions IqVcard SOCKS5BytestreamsServerStreamHost TCPSocket SOCKS5Socket IqQuery IqQueryBytestreams IqQueryVersion IqQueryRoster IqQueryMUCOwner IqQueryRPC IqQueryDiscoItems IqQueryDiscoInfo IBB IBBTarget IBBInitiator Responder SimpleResponder Iq IqCommand RosterXItem XRoster RosterX X XMUCUser XMUC XDelay XData XParent MUCClient SimpleMUCClient XMLRPC::ParserWriterChooseMixin Client Server XMLRPC::ParseContentType XMLRPC::BasicServer Base DigestMD5 Plain ServiceHelper NodeHelper FileSource CallbackList Callback Semaphore StreamParser SOCKS5BytestreamsPeer SOCKS5BytestreamsServer IBBQueueItem Responder Helper MUCBrowser NodeBrowser Helper Helper lib/xmpp4r/authenticationfailure.rb lib/xmpp4r/xmppstanza.rb lib/xmpp4r/callbacks.rb lib/xmpp4r/idgenerator.rb lib/xmpp4r/connection.rb lib/xmpp4r/iq.rb lib/xmpp4r/jid.rb lib/xmpp4r/errorexception.rb lib/xmpp4r/client.rb lib/xmpp4r/stream.rb lib/xmpp4r/semaphore.rb lib/xmpp4r/streamparser.rb lib/xmpp4r/x.rb lib/xmpp4r/error.rb lib/xmpp4r/component.rb lib/xmpp4r/query.rb lib/xmpp4r/xmppelement.rb lib/xmpp4r/message.rb lib/xmpp4r/presence.rb lib/xmpp4r/bytestreams/helper/ibb/initiator.rb lib/xmpp4r/bytestreams/iq/si.rb lib/xmpp4r/bytestreams/iq/bytestreams.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb lib/xmpp4r/bytestreams/helper/ibb/base.rb lib/xmpp4r/bytestreams/helper/ibb/target.rb Bytestreams XParent lib/xmpp4r/version/iq/version.rb lib/xmpp4r/version/helper/responder.rb lib/xmpp4r/version/helper/simpleresponder.rb Version lib/xmpp4r/command/iq/command.rb lib/xmpp4r/command/helper/responder.rb Command lib/xmpp4r/roster/helper/roster.rb lib/xmpp4r/roster/iq/roster.rb lib/xmpp4r/roster/x/roster.rb Roster lib/xmpp4r/feature_negotiation/iq/feature.rb FeatureNegotiation lib/xmpp4r/muc/x/muc.rb lib/xmpp4r/muc/helper/mucclient.rb lib/xmpp4r/muc/x/mucuseritem.rb lib/xmpp4r/muc/helper/mucbrowser.rb lib/xmpp4r/muc/x/mucuserinvite.rb lib/xmpp4r/muc/iq/mucowner.rb lib/xmpp4r/muc/helper/simplemucclient.rb MUC lib/xmpp4r/rpc/helper/server.rb lib/xmpp4r/rpc/helper/client.rb lib/xmpp4r/rpc/iq/rpc.rb RPC lib/xmpp4r/sasl.rb SASL lib/xmpp4r/delay/x/delay.rb Delay lib/xmpp4r/pubsub/stanzas/subscription.rb lib/xmpp4r/pubsub/helper/servicehelper.rb lib/xmpp4r/pubsub/stanzas/item.rb lib/xmpp4r/pubsub/helper/nodehelper.rb lib/xmpp4r/pubsub/iq/pubsub.rb lib/xmpp4r/pubsub/stanzas/event.rb lib/xmpp4r/pubsub/helper/nodebrowser.rb lib/xmpp4r/pubsub/stanzas/items.rb PubSub lib/xmpp4r/httpbinding/client.rb HTTPBinding lib/xmpp4r/bytestreams/helper/filetransfer.rb TransferSource FileTransfer lib/xmpp4r/discovery/iq/discoinfo.rb lib/xmpp4r/discovery/iq/discoitems.rb Discovery lib/xmpp4r/dataforms/x/data.rb Dataforms lib/xmpp4r/vcard/helper/vcard.rb lib/xmpp4r/vcard/iq/vcard.rb Vcard Jabber dot/m_80_0.png

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]