Package archipelagentxmppserver :: Module xmppserver :: Class TNXMPPServerController
[hide private]
[frames] | no frames]

Class TNXMPPServerController

source code

archipelcore.archipelPlugin.TNArchipelPlugin --+
                                               |
                                              TNXMPPServerController

Instance Methods [hide private]
 
__init__(self, configuration, entity, entry_point_group)
Initialize the plugin.
source code
 
register_handlers(self)
This method will be called by the plugin user when it will be necessary to register module for listening to stanza.
source code
 
unregister_handlers(self)
Unregister the handlers.
source code
 
create_autogroups_if_needed(self, origin, user_info, parameters)
Will create the auto_group when plugin loaded and add hypervisor if needed
source code
 
handle_autogroup_for_entities(self, origin, user_info, entities)
Will add all new virtual machines in autogroup if configured to and if not already in another SRG
source code
dict
_send_xmlrpc_call(self, method, args)
Sends the xml rpc call with given args
source code
 
_fetch_users(self, xmppserver, callback, args=None)
Fetch users and populate the internal list
source code
 
process_groups_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_XMPPSERVER_GROUPS IQ is received.
source code
xmpp.Protocol.Iq
iq_group_create(self, iq)
Create a new shared roster.
source code
 
group_create(self, ID, name, description, display="")
Create a new shared roster group
source code
xmpp.Protocol.Iq
iq_group_delete(self, iq)
Delete a shared group.
source code
 
group_delete(self, ID)
Destroy a shared roster group
source code
xmpp.Protocol.Iq
iq_group_list(self, iq)
List shared groups.
source code
 
group_list(self)
Returns a list of existing groups
source code
xmpp.Protocol.Iq
iq_group_add_users(self, iq)
Add a user into a shared group.
source code
 
group_add_users(self, ID, users)
Add users into a group
source code
xmpp.Protocol.Iq
iq_group_delete_users(self, iq)
delete a user from a shared group
source code
 
group_delete_users(self, ID, users)
Delete users from a group
source code
 
proxify_user_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_XMPPSERVER_USERS IQ is received.
source code
 
process_users_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_XMPPSERVER_USERS IQ is received.
source code
xmpp.Protocol.Iq
iq_users_register(self, iq)
Register some new users.
source code
 
users_register(self, users)
Register new users
source code
xmpp.Protocol.Iq
iq_users_unregister(self, iq)
Unregister somes users.
source code
 
users_unregister(self, users)
Unregister users
source code
xmpp.Protocol.Iq
iq_users_number(self, iq)
Return number of registered users.
source code
 
users_number(self, base_reply, only_humans=True)
Return total number of registered users
source code
xmpp.Protocol.Iq
iq_users_list(self, iq)
List all registered users.
source code
 
users_list(self, base_reply, page, only_humans=True)
List all registered users
source code
xmpp.Protocol.Iq
iq_users_filter(self, iq)
Filter all registered users.
source code
 
users_filter(self, base_reply, filterString)
Filter all registered users.
source code
xmpp.Protocol.Iq
iq_users_change_password(self, iq)
Change password for users.
source code
 
users_change_password(self, users)
Change password for users
source code
Static Methods [hide private]
dict
plugin_info()
Return informations about the plugin.
source code
Method Details [hide private]

__init__(self, configuration, entity, entry_point_group)
(Constructor)

source code 

Initialize the plugin.

Parameters:
  • configuration (Configuration object) - the configuration
  • entity (TNArchipelEntity) - the entity that owns the plugin
  • entry_point_group (string) - the group name of plugin entry_point
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.__init__

register_handlers(self)

source code 

This method will be called by the plugin user when it will be necessary to register module for listening to stanza.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.register_handlers

unregister_handlers(self)

source code 

Unregister the handlers.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.unregister_handlers

plugin_info()
Static Method

source code 

Return informations about the plugin.

Returns: dict
dictionary contaning plugin informations
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.plugin_info

create_autogroups_if_needed(self, origin, user_info, parameters)

source code 

Will create the auto_group when plugin loaded and add hypervisor if needed

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user info
  • parameters (object) - runtime argument

handle_autogroup_for_entities(self, origin, user_info, entities)

source code 

Will add all new virtual machines in autogroup if configured to and if not already in another SRG

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user info
  • entity (list) - list of entities

_send_xmlrpc_call(self, method, args)

source code 

Sends the xml rpc call with given args

Parameters:
  • method (function) - the xmlrpc method to launch
  • args (dict) - containing the xmlrpc call arguments
Returns: dict
the xmlrpc reply

_fetch_users(self, xmppserver, callback, args=None)

source code 

Fetch users and populate the internal list

Parameters:
  • xmppserver (String) - the xmpp server to query
  • callback (function) - the callback to call when fetching is complete
  • args (dict) - optional kwards of the callback

process_groups_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_XMPPSERVER_GROUPS IQ is received. It understands IQ of type:

  • create
  • delete
  • list
  • addusers
  • deleteusers
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_group_create(self, iq)

source code 

Create a new shared roster.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

group_create(self, ID, name, description, display="")

source code 

Create a new shared roster group

Parameters:
  • ID (string) - the ID of the group
  • name (string) - the name of the group
  • description (string) - the description of the group
  • display (list) - list fo group(s) which can see the group

iq_group_delete(self, iq)

source code 

Delete a shared group.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

group_delete(self, ID)

source code 

Destroy a shared roster group

Parameters:
  • ID (string) - the ID of the group to delete

iq_group_list(self, iq)

source code 

List shared groups.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_group_add_users(self, iq)

source code 

Add a user into a shared group.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

group_add_users(self, ID, users)

source code 

Add users into a group

Parameters:
  • ID (string) - the ID of the group
  • users (list) - list of the users to add in the group

iq_group_delete_users(self, iq)

source code 

delete a user from a shared group

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

group_delete_users(self, ID, users)

source code 

Delete users from a group

Parameters:
  • ID (string) - the ID of the group
  • users (list) - list of users to remove

proxify_user_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_XMPPSERVER_USERS IQ is received. It will try to proxify the request to the central agent.

Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

process_users_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_XMPPSERVER_USERS IQ is received. It understands IQ of type:

  • register
  • unregister
  • list
  • filter
  • number
  • changepassword
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_users_register(self, iq)

source code 

Register some new users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

users_register(self, users)

source code 

Register new users

Parameters:
  • users (list) - list of users to register

iq_users_unregister(self, iq)

source code 

Unregister somes users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

users_unregister(self, users)

source code 

Unregister users

Parameters:
  • users (list) - list of users to unregister

iq_users_number(self, iq)

source code 

Return number of registered users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_users_list(self, iq)

source code 

List all registered users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_users_filter(self, iq)

source code 

Filter all registered users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_users_change_password(self, iq)

source code 

Change password for users.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

users_change_password(self, users)

source code 

Change password for users

Parameters:
  • users (list) - list of users to change password