Public Member Functions | Public Attributes | Private Attributes | List of all members
rocon_gateway.hub_manager.HubManager Class Reference

Hub Manager. More...

Inheritance diagram for rocon_gateway.hub_manager.HubManager:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, hub_whitelist, hub_blacklist)
 Init & Shutdown. More...
 
def advertise (self, connection)
 
def connect_to_hub (self, new_hub, firewall_flag, gateway_unique_name, gateway_disengage_hub, gateway_ip, existing_advertisements)
 Hub Connections. More...
 
def create_remote_gateway_hub_index (self)
 
def disengage_hub (self, hub_to_be_disengaged)
 
def get_flip_requests (self)
 
def get_remote_gateway_firewall_flag (self, remote_gateway_name)
 
def is_connected (self)
 
def is_connected_to_hub (self, ip, port)
 
def list_remote_gateway_names (self)
 Introspection. More...
 
def match_remote_gateway_name (self, remote_gateway_name)
 
def publish_network_statistics (self, statistics)
 
def remote_gateway_info (self, remote_gateway_name)
 
def send_unflip_request (self, remote_gateway_name, remote_rule)
 
def unadvertise (self, connection)
 

Public Attributes

 hubs
 

Private Attributes

 _hub_lock
 
 _param
 

Detailed Description

Hub Manager.

:ivar hubs: list of gateway hub instances
:vartype hubs: [rocon_gateway.GatewayHub]

Definition at line 25 of file hub_manager.py.

Constructor & Destructor Documentation

def rocon_gateway.hub_manager.HubManager.__init__ (   self,
  hub_whitelist,
  hub_blacklist 
)

Init & Shutdown.

Definition at line 35 of file hub_manager.py.

Member Function Documentation

def rocon_gateway.hub_manager.HubManager.advertise (   self,
  connection 
)

Definition at line 267 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.connect_to_hub (   self,
  new_hub,
  firewall_flag,
  gateway_unique_name,
  gateway_disengage_hub,
  gateway_ip,
  existing_advertisements 
)

Hub Connections.

  Attempts to make a connection and register the gateway with a hub.
  This is called from the gateway node's _register_gateway method.

  @param ip
  @param port
  @param firewall_flag
  @param gateway_unique_name
  @param remote_gateway_request_callbacks
  @type method : Gateway.remote_gateway_request_callbacks()
  @param gateway_disengage_hub : this is the hub connection lost hook
  @type method : Gateway.disengage_hub()
  @param gateway_ip
  @param existing advertisements
  @type { utils.ConnectionTypes : utils.Connection[] }

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

  @raise

Definition at line 181 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.create_remote_gateway_hub_index (   self)
  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.

Definition at line 66 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.disengage_hub (   self,
  hub_to_be_disengaged 
)
  Disengages a hub. Make sure all necessary connections
  are cleaned up before calling this (Gateway.disengage_hub).

  @param hub_to_be_disengaged

Definition at line 250 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.get_flip_requests (   self)
  Returns all unblocked flip requests received by this hub

  @return list of flip registration requests
  @rtype list of utils.Registration

Definition at line 86 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.get_remote_gateway_firewall_flag (   self,
  remote_gateway_name 
)
  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

Definition at line 121 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.is_connected (   self)

Definition at line 42 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.is_connected_to_hub (   self,
  ip,
  port 
)
  Check if the gateway is properly connected to the hub.

Definition at line 225 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.list_remote_gateway_names (   self)

Introspection.

  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

Definition at line 49 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.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.

Definition at line 279 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.publish_network_statistics (   self,
  statistics 
)
  Publish network statistics to every hub this gateway is connected to.

  @param statistics
  @type gateway_msgs.ConnectionStatistics

Definition at line 296 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.remote_gateway_info (   self,
  remote_gateway_name 
)
  Return information that a remote gateway has posted on the hub(s).

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

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

Definition at line 100 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.send_unflip_request (   self,
  remote_gateway_name,
  remote_rule 
)
  Send an unflip request to the specified gateway through all available
  hubs.

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

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

  @param remote_rule : the remote rule to unflip
  @type gateway_msgs.RemoteRule

Definition at line 145 of file hub_manager.py.

def rocon_gateway.hub_manager.HubManager.unadvertise (   self,
  connection 
)

Definition at line 273 of file hub_manager.py.

Member Data Documentation

rocon_gateway.hub_manager.HubManager._hub_lock
private

Definition at line 40 of file hub_manager.py.

rocon_gateway.hub_manager.HubManager._param
private

Definition at line 36 of file hub_manager.py.

rocon_gateway.hub_manager.HubManager.hubs

Definition at line 39 of file hub_manager.py.


The documentation for this class was generated from the following file:


rocon_gateway
Author(s): Daniel Stonier , Jihoon Lee , Piyush Khandelwal
autogenerated on Mon Jun 10 2019 14:40:10