Module: AgentXmpp

Defined in:
lib/agent_xmpp/xmpp/iq.rb,
lib/agent_xmpp/main.rb,
lib/agent_xmpp/config.rb,
lib/agent_xmpp/app/boot.rb,
lib/agent_xmpp/xmpp/jid.rb,
lib/agent_xmpp/xmpp/sasl.rb,
lib/agent_xmpp/xmpp/stanza.rb,
lib/agent_xmpp/xmpp/x_data.rb,
lib/agent_xmpp/patches/hash.rb,
lib/agent_xmpp/xmpp/element.rb,
lib/agent_xmpp/xmpp/message.rb,
lib/agent_xmpp/client/client.rb,
lib/agent_xmpp/patches/array.rb,
lib/agent_xmpp/patches/float.rb,
lib/agent_xmpp/xmpp/iq_disco.rb,
lib/agent_xmpp/xmpp/presence.rb,
lib/agent_xmpp/app/controller.rb,
lib/agent_xmpp/patches/object.rb,
lib/agent_xmpp/patches/string.rb,
lib/agent_xmpp/xmpp/iq_pubsub.rb,
lib/agent_xmpp/xmpp/iq_roster.rb,
lib/agent_xmpp/client/response.rb,
lib/agent_xmpp/xmpp/iq_command.rb,
lib/agent_xmpp/xmpp/iq_version.rb,
lib/agent_xmpp/client/connection.rb,
lib/agent_xmpp/client/message_pipe.rb,
lib/agent_xmpp/client/roster_model.rb,
lib/agent_xmpp/xmpp/error_response.rb,
lib/agent_xmpp/client/publish_model.rb,
lib/agent_xmpp/client/services_model.rb,
lib/agent_xmpp/client/message_delegate.rb

Overview

Original from XMPP4R - XMPP Library for Ruby Website::home.gna.org/xmpp4r/

Defined Under Namespace

Modules: Delegator, StandardLibrary, Xmpp Classes: AgentXmppError, BaseController, Boot, Client, Connection, Controller, MessageDelegate, MessagePipe, PublishModel, PublishNode, Response, RosterItemModel, RosterModel, ServicesModel

Constant Summary collapse

VERSION =

.….….….….….….….….….….….….….….….….….….….….….….….….….….

"0.0.0"
AGENT_XMPP_NAME =
'AgentXMPP'
OS_VERSION =
IO.popen('uname -sr').readlines.to_s.strip
SUBSCRIBE_RETRY_PERIOD =
60
IDENTITY =
{:category => 'client', :name => AGENT_XMPP_NAME, :type => 'bot'}
FEATURES =
['http://jabber.org/protocol/disco#info', 
'http://jabber.org/protocol/disco#items',
'jabber:iq:version',
'jabber:x:data',
'http://jabber.org/protocol/commands',
'http://jabber.org/protocol/muc']
DEFAULT_PUBSUB_CONFIG =
{
  :title                    => 'event',
  :access_model             => 'presence',
  :publish_model            => 'publishers',
  :max_items                => 20,
  :deliver_notifications    => 1,
  :deliver_payloads         => 1,
  :persist_items            => 1,
  :subscribe                => 1,
  :notify_config            => 0,
  :notify_delete            => 0,
  :notify_retract           => 0,
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.app_pathObject

Returns the value of attribute app_path.



36
37
38
# File 'lib/agent_xmpp/config.rb', line 36

def app_path
  @app_path
end

.configObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



24
25
26
# File 'lib/agent_xmpp/main.rb', line 24

def config
  @config
end

.config_fileObject

Returns the value of attribute config_file.



36
37
38
# File 'lib/agent_xmpp/config.rb', line 36

def config_file
  @config_file
end

.log_fileObject

Returns the value of attribute log_file.



36
37
38
# File 'lib/agent_xmpp/config.rb', line 36

def log_file
  @log_file
end

Class Method Details

.jidObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



52
53
54
# File 'lib/agent_xmpp/main.rb', line 52

def jid
  @jid ||= Xmpp::Jid.new("#{config['jid']}/#{resource}")
end

.jid=(jid) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….….….



57
58
59
# File 'lib/agent_xmpp/main.rb', line 57

def jid=(jid)
  @jid = jid
end

.loggerObject



37
# File 'lib/agent_xmpp/config.rb', line 37

def logger; @logger ||= Logger.new(STDOUT); end

.logger=(logger) ⇒ Object



38
# File 'lib/agent_xmpp/config.rb', line 38

def logger=(logger); @logger = logger; end

.passwordObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



72
73
74
# File 'lib/agent_xmpp/main.rb', line 72

def password
  config['password']
end

.portObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



67
68
69
# File 'lib/agent_xmpp/main.rb', line 67

def port
  config['port'] || 5222
end

.priorityObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/agent_xmpp/main.rb', line 77

def priority
  @priority ||= if config['priority']
                if config['priority'] < -127
                  -127
                elsif config['priority'] > 128
                  128
                else
                  config['priority']
                end
              else; 1; end
end

.publishedObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



47
48
49
# File 'lib/agent_xmpp/main.rb', line 47

def published
  @published ||= PublishModel.new(config['publish'])
end

.pubsub_rootObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



32
33
34
# File 'lib/agent_xmpp/main.rb', line 32

def pubsub_root
  @pubsub_root ||= "/home/#{AgentXmpp.jid.domain}"  
end

.resourceObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



62
63
64
# File 'lib/agent_xmpp/main.rb', line 62

def resource
  config['resource'] || Socket.gethostname
end

.rosterObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



27
28
29
# File 'lib/agent_xmpp/main.rb', line 27

def roster
  @roster ||= RosterModel.new(jid, config['roster'])
end

.servicesObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



42
43
44
# File 'lib/agent_xmpp/main.rb', line 42

def services
  @services ||= ServicesModel.new
end

.user_pubsub_rootObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



37
38
39
# File 'lib/agent_xmpp/main.rb', line 37

def user_pubsub_root
  @user_pubsub_root ||= "#{@pubsub_root}/#{AgentXmpp.jid.node}" 
end