Package rocon_gateway :: Module hub_manager :: Class HubManager
[frames] | no frames]

Class HubManager

source code

object --+
         |
        HubManager

Instance Methods
 
__init__(self, hub_whitelist, hub_blacklist)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
shutdown(self) source code
 
is_connected(self) source code
 
list_remote_gateway_names(self)
Parse all the hubs and retrieve the list of remote gateway names.
source code
 
create_remote_gateway_hub_index(self)
Utility function to parse all hubs for the remote gateways and create a dictionary of the type:
source code
 
remote_gateway_info(self, remote_gateway_name)
Return information that a remote gateway has posted on the hub(s).
source code
 
get_remote_gateway_firewall_flag(self, remote_gateway_name)
Return information that a remote gateway has posted on the hub(s).
source code
 
send_unflip_request(self, remote_gateway_name, remote_rule)
Send an unflip request to the specified gateway through the first common hub that can be found.
source code
 
connect_to_hub(self, ip, port)
Attempts to make a connection and register the gateway with a hub.
source code
 
disengage_hub(self, hub_to_be_disengaged)
Disengages a hub.
source code
 
advertise(self, connection) source code
 
unadvertise(self, connection) source code
 
match_remote_gateway_name(self, remote_gateway_name)
Parses the hub lists looking for strong (identical) and weak (matches the name without the uuid hash) matches.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, hub_whitelist, hub_blacklist)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

list_remote_gateway_names(self)

source code 

Parse all the hubs and retrieve the list of remote gateway names.

Note: not sure where is most convenient, here or in gateway class.

@return list of remote gateway names (with hashes), e.g. gateway345ae2c... @rtype list of str

create_remote_gateway_hub_index(self)

source code 

Utility function to parse all hubs for the remote gateways and
create a dictionary of the type:

  dic['remote_gateway_name'] = ['hub1', 'hub2']

where the hub list is a list of actual hub object references.

remote_gateway_info(self, remote_gateway_name)

source code 

Return information that a remote gateway has posted on the hub(s).

Parameters:
  • remote_gateway_name - the hash name for the remote gateway @type str

    @return remote gateway information @rtype gateway_msgs.RemotGateway or None

get_remote_gateway_firewall_flag(self, remote_gateway_name)

source code 

Return information that a remote gateway has posted on the hub(s).

@param remote_gateway_name : the hash name for the remote gateway
@type string

@return True, false if the flag is set or not, None if remote
        gateway information cannot found
@rtype Bool

send_unflip_request(self, remote_gateway_name, remote_rule)

source code 

Send an unflip request to the specified gateway through the first common hub that can be found.

Doesn't raise GatewayUnavailableError if nothing got sent as the higher level doesn't need any logic there yet (only called from gateway.shutdown).

Parameters:
  • remote_gateway_name - the hash name for the remote gateway @type string
  • remote_rule - the remote rule to unflip @type gateway_msgs.RemoteRule

connect_to_hub(self, ip, port)

source code 

Attempts to make a connection and register the gateway with a hub.

@param ip @param port

@return an integer indicating error (important for the service call) @rtype gateway_msgs.ErrorCodes

@raise

disengage_hub(self, hub_to_be_disengaged)

source code 

Disengages a hub. Make sure all necessary connections are cleaned up before calling this (Gateway.disengage_hub).

@param hub_to_be_disengaged