Class: OpenfireAdmin::Client
- Inherits:
-
Object
- Object
- OpenfireAdmin::Client
- Defined in:
- lib/openfire_admin/client.rb
Overview
HighLevel client
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#available_plugins ⇒ Object
plugins list array of available plugins.
-
#initialize(loginurl = "http://localhost:9090") ⇒ Client
constructor
constructor.
-
#installed_plugins ⇒ Object
plugins list array of installed plugins.
- #login(username, password) ⇒ Object
- #logined? ⇒ Boolean
- #setup_mode? ⇒ Boolean
- #setup_wizard ⇒ Object
-
#system_cache ⇒ Object
return SystemCache array.
-
#system_properties ⇒ Object
get properties.
- #users ⇒ Object
Constructor Details
#initialize(loginurl = "http://localhost:9090") ⇒ Client
constructor
16 17 18 |
# File 'lib/openfire_admin/client.rb', line 16 def initialize(loginurl="http://localhost:9090") @client = AdminClient.new(loginurl) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/openfire_admin/client.rb', line 14 def client @client end |
Instance Method Details
#available_plugins ⇒ Object
plugins list array of available plugins. if you need not installed plugins, ( self.available_plugins - self.install_plugin )
51 52 53 |
# File 'lib/openfire_admin/client.rb', line 51 def available_plugins PluginList.availables(@client) end |
#installed_plugins ⇒ Object
plugins list array of installed plugins
56 57 58 |
# File 'lib/openfire_admin/client.rb', line 56 def installed_plugins PluginList.installed(@client) end |
#login(username, password) ⇒ Object
34 35 36 37 |
# File 'lib/openfire_admin/client.rb', line 34 def login(username, password) @client.login(username, password) @logined = true end |
#logined? ⇒ Boolean
30 31 32 |
# File 'lib/openfire_admin/client.rb', line 30 def logined? @logined end |
#setup_mode? ⇒ Boolean
20 21 22 23 24 |
# File 'lib/openfire_admin/client.rb', line 20 def setup_mode? @client.get("/login.jsp") do |res| res.code == "302" and res["location"] =~ %r"/setup/" end end |
#setup_wizard ⇒ Object
26 27 28 |
# File 'lib/openfire_admin/client.rb', line 26 def setup_wizard SetupWizard.new(@client) end |
#system_cache ⇒ Object
return SystemCache array
45 46 47 |
# File 'lib/openfire_admin/client.rb', line 45 def system_cache @client.system_cache.map{|c| SystemCache.new( @client, c[:cacheID], c[:name] )} end |
#system_properties ⇒ Object
get properties
40 41 42 |
# File 'lib/openfire_admin/client.rb', line 40 def system_properties PropertyMap.new(@client) end |
#users ⇒ Object
59 60 61 |
# File 'lib/openfire_admin/client.rb', line 59 def users UserAdmin.new(@client) end |