Module relay_registry :: Class Co2RelayRegistry
[show private | hide private]
[frames | no frames]

Class Co2RelayRegistry

Co2Registry --+
              |
             Co2RelayRegistry


relay specific registry.
Method Summary
  __init__(self, vars)
first calls Co2Registry's __init__, then does some initial stuff for its own (load eventual satellite dump file, init and kick off pinger and limiter etc..
  __str__(self)
(inherited from Co2Registry)

string

callable as: co2.get_method_help, sys.methodHelp, web.get_method_help
x_co2_get_method_help(self, param_dict)
get help (the __doc__ string) for a specific method. (inherited from Co2Registry)

list of strings

callable as: co2.co2_get_method_names, sys.listMethods, web.get_method_names
x_co2_get_method_names(self, param_dict)
get the names of available methods. (inherited from Co2Registry)

dictionary: 'args': list of argument names (strings), 'args_d': dictionary (key=argument name, value=argument value), 'args_v': list of variable arguments (unused in xmlrpc), 'args_kw': list of keyword arguments (unused in xmlrpc)

callable as: co2.get_method_signature, sys.methodSignature, web.get_method_signature
x_co2_get_method_signature(self, param_dict)
get a discription of how to use a specific method. (inherited from Co2Registry)

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites
x_co2_get_num_satellites(self, param_dict)
get number of currently registered satellites.

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility)
x_co2_get_satellite(self, param_dict)
get status / statistical information from a satellite.

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime
x_co2_get_satellite_ctime(self, param_dict)
get a satellites creation (=registration) time.

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility)
x_co2_get_satellite_props(self, param_dict)
get status / statistical information from a satellite.

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites
x_co2_get_satellites(self, param_dict)
get IDs of currently registered satellites.
string x_relay_deregister(self, param_dict)
revoke a satellite's registration.

int

callable as: relay.get_max_satellites
x_relay_get_max_satellites(self, param_dict)
get the maximum number of satellites that are allowed to be registered simultaniously.

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites
x_relay_get_num_satellites(self, param_dict)
get number of currently registered satellites.

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime
x_relay_get_satellite_ctime(self, param_dict)
get a satellites creation (=registration) time.

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility)
x_relay_get_satellite_props(self, param_dict)
get status / statistical information from a satellite.
  x_relay_get_satellite_props_raw(self, param_dict)

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites
x_relay_get_satellites(self, param_dict)
get IDs of currently registered satellites.

string

callable as: relay.register
x_relay_register(self, param_dict)
register a satellite.
string x_relay_relay(self, param_dict)
relay data to satellites.

dictionary [key: value-type (description)]: co2_author: string (server author); kernel: string (host kernel name); uptime: int (server uptime in seconds); operating_system: string (host operating system); maintainer: string (server maintainer); start_time: DateTime (server start time); sw_platform: string (co2 software platform); hw_platform: string (host hardware platform); co2_version: string (co2 version); maintainer_email: string (server maintainer email); hardware: string (host hardware); plugins: list of strings (loaded plugins); server_time: DateTime (server time); processor: string (host processor)

callable as: system.get_properties, web.get_properties
x_sys_get_properties(self, param_dict)
get system properties. (inherited from Co2Registry)

list of strings

callable as: co2.co2_get_method_names, sys.listMethods, web.get_method_names
x_sys_listMethods(self, param_dict)
get the names of available methods. (inherited from Co2Registry)

string

callable as: co2.get_method_help, sys.methodHelp, web.get_method_help
x_sys_methodHelp(self, param_dict)
get help (the __doc__ string) for a specific method. (inherited from Co2Registry)

dictionary: 'args': list of argument names (strings), 'args_d': dictionary (key=argument name, value=argument value), 'args_v': list of variable arguments (unused in xmlrpc), 'args_kw': list of keyword arguments (unused in xmlrpc)

callable as: co2.get_method_signature, sys.methodSignature, web.get_method_signature
x_sys_methodSignature(self, param_dict)
get a discription of how to use a specific method. (inherited from Co2Registry)
  x_top_call_method(self, param_dict)
'anonymized' call method. (inherited from Co2Registry)

string

callable as: ping, web.ping
x_top_ping(self, param_dict)
answer a ping request. (inherited from Co2Registry)

param_dict

callable as: test, web.test
x_top_test(self, param_dict)
just a test method... (inherited from Co2Registry)
  x_web_call_method(self, param_dict)
'anonymized' call method. (inherited from Co2Registry)

string

callable as: co2.get_method_help, sys.methodHelp, web.get_method_help
x_web_get_method_help(self, param_dict)
get help (the __doc__ string) for a specific method. (inherited from Co2Registry)

list of strings

callable as: co2.co2_get_method_names, sys.listMethods, web.get_method_names
x_web_get_method_names(self, param_dict)
get the names of available methods. (inherited from Co2Registry)

dictionary: 'args': list of argument names (strings), 'args_d': dictionary (key=argument name, value=argument value), 'args_v': list of variable arguments (unused in xmlrpc), 'args_kw': list of keyword arguments (unused in xmlrpc)

callable as: co2.get_method_signature, sys.methodSignature, web.get_method_signature
x_web_get_method_signature(self, param_dict)
get a discription of how to use a specific method. (inherited from Co2Registry)

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites
x_web_get_num_satellites(self, param_dict)
get number of currently registered satellites.

dictionary [key: value-type (description)]: co2_author: string (server author); kernel: string (host kernel name); uptime: int (server uptime in seconds); operating_system: string (host operating system); maintainer: string (server maintainer); start_time: DateTime (server start time); sw_platform: string (co2 software platform); hw_platform: string (host hardware platform); co2_version: string (co2 version); maintainer_email: string (server maintainer email); hardware: string (host hardware); plugins: list of strings (loaded plugins); server_time: DateTime (server time); processor: string (host processor)

callable as: system.get_properties, web.get_properties
x_web_get_properties(self, param_dict)
get system properties. (inherited from Co2Registry)

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime
x_web_get_satellite_ctime(self, param_dict)
get a satellites creation (=registration) time.

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility)
x_web_get_satellite_props(self, param_dict)
get status / statistical information from a satellite.

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites
x_web_get_satellites(self, param_dict)
get IDs of currently registered satellites.

string

callable as: ping, web.ping
x_web_ping(self, param_dict)
answer a ping request. (inherited from Co2Registry)

param_dict

callable as: test, web.test
x_web_test(self, param_dict)
just a test method... (inherited from Co2Registry)
  _exit_hook(self)
called on server exit.
  _load_plugins(self, loader_vars, plugin_vars)
kick off the plugin loader. (inherited from Co2Registry)
  _load_system_methods(self)
register system (=internal) methods. (inherited from Co2Registry)
  _ping(self, satellite)
  _register_method(self, name, method)
register a method to be callable through xmlrpc. (inherited from Co2Registry)
  _relay(self, data_dict)
dummy method to be overridden by subclasses (satellite_registry.Co2SatelliteRegistry and relay_registry.Co2RelayRegistry. (inherited from Co2Registry)

string

exceptions thrown when making the call to a satellite are logged and ignored.
_relay_real(self, param_dict)
relay data to all registered satellites (except the sender).
  _serialize_sat_data(self)
_serialize_sat_data(): dump an xml file to disc containing all data needed for the relay to re-register the satellites automatically on restart, so that satellites don't have to register again themselves.
  _verify_registration(self, host_id)
verify whether a host id is registered.

Method Details

__init__(self, vars)
(Constructor)

first calls Co2Registry's __init__, then does some initial stuff for its own (load eventual satellite dump file, init and kick off pinger and limiter etc..
Parameters:
vars - registry specific variables
           (type=dictionary)

x_co2_get_num_satellites(self, param_dict={})

get number of currently registered satellites.
Returns:
number of currently registered satellites
           (type=

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites)

x_co2_get_satellite(self, param_dict)

get status / statistical information from a satellite.
Parameters:
param_dict - data
           (type=dictionary (key='host_id', value=<host_id>).)
Returns:
satellite properties
           (type=

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility))

x_co2_get_satellite_ctime(self, param_dict)

get a satellites creation (=registration) time.
Returns:
satellite's ctime, seconds since epoche
           (type=

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime)

x_co2_get_satellite_props(self, param_dict)

get status / statistical information from a satellite.
Parameters:
param_dict - data
           (type=dictionary (key='host_id', value=<host_id>).)
Returns:
satellite properties
           (type=

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility))

x_co2_get_satellites(self, param_dict={})

get IDs of currently registered satellites.
Returns:
host_id's
           (type=

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites)

x_relay_deregister(self, param_dict)

revoke a satellite's registration. should be called by satellites before they shut down. the calling client's address must match the supplied host id.
Parameters:
param_dict -
Returns:
'OK' on success
           (type=string)
Raises:
KeyError - exceptions.KeyError if no satellite with matching host_id is registered.
Co2RegistryError -

registry.Co2RegistryError if one satellite requests to remove another satellite.

callable as: relay.deregister

x_relay_get_max_satellites(self, param_dict={})

get the maximum number of satellites that are allowed to be registered simultaniously.
Returns:
satellite limit
           (type=

int

callable as: relay.get_max_satellites)

x_relay_get_num_satellites(self, param_dict={})

get number of currently registered satellites.
Returns:
number of currently registered satellites
           (type=

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites)

x_relay_get_satellite_ctime(self, param_dict)

get a satellites creation (=registration) time.
Returns:
satellite's ctime, seconds since epoche
           (type=

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime)

x_relay_get_satellite_props(self, param_dict)

get status / statistical information from a satellite.
Parameters:
param_dict - data
           (type=dictionary (key='host_id', value=<host_id>).)
Returns:
satellite properties
           (type=

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility))

x_relay_get_satellites(self, param_dict={})

get IDs of currently registered satellites.
Returns:
host_id's
           (type=

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites)

x_relay_register(self, param_dict)

register a satellite. satellites that want to use relaying must call this method first. if the limit self.vars['max_sats'] (set in the config file) is reached, an exception is thrown and a Fault is returned to the caller.
Parameters:
param_dict - data
           (type=dictionary: 'port': the satellites listening port (int), 'plugins': list of plugin names (strings) loaded by the satellite, 'nick': nickname (string) 'notify_pass': sort of a password the relay has to use to be allowed to call the registering satellite's notify method, ie. to subsequently relay to the satellite.)
Returns:
the id the satellite has to use for further communication with the relay
           (type=

string

callable as: relay.register)

x_relay_relay(self, param_dict)

relay data to satellites. this actually only puts the data into the limiter.Limiter's queue.
Parameters:
param_dict - data to be relayed
           (type=dictionary, must contain a key 'host_id' (value: a registered satellite's id) and a key 'data' (value: whatever data the satellite wants to send))
Returns:
'OK'
           (type=string)
Raises:
Co2RegistryError -

registry.Co2RegistryError on failure (returned to the caller as xmlrpclib.Fault)

callable as: relay.relay

x_web_get_num_satellites(self, param_dict={})

get number of currently registered satellites.
Returns:
number of currently registered satellites
           (type=

int

callable as: relay.get_num_satellites, co2.get_num_satellites, web.get_num_satellites)

x_web_get_satellite_ctime(self, param_dict)

get a satellites creation (=registration) time.
Returns:
satellite's ctime, seconds since epoche
           (type=

float

callable as: relay.get_satellite_ctime, co2.get_satellite_ctime, web.get_satellite_ctime)

x_web_get_satellite_props(self, param_dict)

get status / statistical information from a satellite.
Parameters:
param_dict - data
           (type=dictionary (key='host_id', value=<host_id>).)
Returns:
satellite properties
           (type=

dictionary: addr: address (list [<ip>, <port>]), host_id: the satellite's id (string), nick: the satellite's nickname (string, defaults to host_id), ctime: time of registration with the relay (DateTime), ping_current: last ping time in msecs, -1 if not pinged (float, xmlrpc: double), ping_count: number of pings sent, ping_min: shortest ping time (float, xmlrpc: double), ping_max: longest ping time (float, xmlrpc: double), ping_min: average ping time (float, xmlrpc: double), ping_fails: number of failed ping requests by the relay (int); send_count: number of relay.relay calls by that satellite (int), send_time: most recent message originating from this satellite (DateTime); recv_count: number of notify calls to that satellite (int), recv_time: most recent message relayed to this satellite (DateTime)

callable as: relay.get_satellite_props, co2.get_satellite_props, web.get_satellite_props (and co2.get_satellite for backwards compatibility))

x_web_get_satellites(self, param_dict={})

get IDs of currently registered satellites.
Returns:
host_id's
           (type=

list of strings

callable as: relay.get_satellites, co2.get_satellites, web.get_satellites)

_exit_hook(self)

called on server exit. triggers cleaning up.

_relay_real(self, param_dict)

relay data to all registered satellites (except the sender). ie. call their notify method with param_dict.
Parameters:
param_dict - data to be relayed
           (type=dictionary)
Returns:
'OK'
           (type=

string

exceptions thrown when making the call to a satellite are logged and ignored.)

_serialize_sat_data(self)

_serialize_sat_data(): dump an xml file to disc containing all data needed for the relay to re-register the satellites automatically on restart, so that satellites don't have to register again themselves.

_verify_registration(self, host_id)

verify whether a host id is registered.
Parameters:
host_id - co2 host id
           (type=string)
Raises:
Co2RegistryError - registry.Co2RegistryError if no satellite with the specified id is registered.

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net