All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
rocon_gateway.hub_api.Hub Class Reference

List of all members.

Public Member Functions

def __init__
def advertise
 Posting Information to the Hub.
def connect
 Hub Connections.
def get_remote_connection_state
def get_remote_gateway_firewall_flag
def list_remote_gateway_names
def matches_remote_gateway_name
def post_flip_details
def post_pull_details
def register_gateway
def remote_gateway_info
 Hub Data Retrieval.
def remove_flip_details
def remove_pull_details
def send_flip_request
 Gateway-Gateway Communications.
def send_unflip_request
def unadvertise
def unregister_gateway

Public Attributes

 name
 remote_gateway_listener_thread
 uri

Static Public Attributes

 callback = None
 pool = None
 pubsub = None
 server = None

Private Member Functions

def _send_unflip_request

Private Attributes

 _firewall
 _gateway_name
 _redis_channels
 _redis_keys
 _redis_pubsub_server
 _remote_gateway_request_callbacks
 _unique_gateway_name

Detailed Description

Definition at line 137 of file hub_api.py.


Constructor & Destructor Documentation

def rocon_gateway.hub_api.Hub.__init__ (   self,
  remote_gateway_request_callbacks,
  gateway_name,
  firewall 
)
  @param remote_gateway_request_callbacks : to handle redis responses
  @type list of function pointers (back to GatewaySync class

  @param gateway_name : recommended name for this gateway
  @type string

  @param firewall : whether this gateway blocks flips or not (we publish this info)
  @type Bool

Definition at line 144 of file hub_api.py.


Member Function Documentation

def rocon_gateway.hub_api.Hub._send_unflip_request (   self,
  gateway,
  rule 
) [private]

Definition at line 524 of file hub_api.py.

def rocon_gateway.hub_api.Hub.advertise (   self,
  connection 
)

Posting Information to the Hub.

  Places a topic, service or action on the public interface. On the
  redis server, this representation will always be:

   - topic : a triple { name, type, xmlrpc node uri }
   - service : a triple { name, rosrpc uri, xmlrpc node uri }
   - action : ???

  @param connection: representation of a connection (topic, service, action)
  @type  connection: str
  @raise .exceptions.ConnectionTypeError: if connection arg is invalid.

Definition at line 352 of file hub_api.py.

def rocon_gateway.hub_api.Hub.connect (   self,
  ip,
  portarg 
)

Hub Connections.

Definition at line 173 of file hub_api.py.

  Equivalent to getConnectionState, but generates it from the public
  interface of a foreign gateway
       

Definition at line 316 of file hub_api.py.

  Returns the value of the remote gateway's firewall (flip)
  flag.

  @param gateway : gateway string id
  @param string

  @return state of the flag
  @rtype Bool

  @raise UnavailableGatewayError when specified gateway is not on the hub

Definition at line 329 of file hub_api.py.

  Return a list of the gateways (name list, not redis keys).
  e.g. ['gateway32','pirate33']

Definition at line 284 of file hub_api.py.

  Use this when gateway can be a regular expression and
  we need to check it off against list_remote_gateway_names()

Definition at line 303 of file hub_api.py.

def rocon_gateway.hub_api.Hub.post_flip_details (   self,
  gateway,
  name,
  type,
  node 
)
  Post flip details to the redis server. This has no actual functionality,
  it is just useful for debugging with the remote_gateway_info service.

  @param gateway : the target of the flip
  @type string
  @param name : the name of the connection
  @type string
  @param type : the type of the connection (one of ConnectionType.xxx
  @type string
  @param node : the node name it was pulled from
  @type string

Definition at line 381 of file hub_api.py.

def rocon_gateway.hub_api.Hub.post_pull_details (   self,
  gateway,
  name,
  type,
  node 
)
  Post pull details to the hub. This has no actual functionality,
  it is just useful for debugging with the remote_gateway_info service.

  @param gateway : the gateway it is pulling from
  @type string
  @param name : the name of the connection
  @type string
  @param type : the type of the connection (one of ConnectionType.xxx
  @type string
  @param node : the node name it was pulled from
  @type string

Definition at line 417 of file hub_api.py.

  Register a gateway with the hub. Note that you must have already
  connected before calling this function.

  On registration, the hub will provide a unique identifier number
  which will be appended to the suggested name of this gateway to
  ensure a unique id string and key for this gateway.

  @return: success or failure of the operation
  @rtype: bool

  @todo - maybe merge with 'connect', or at the least check if it
  is actually connected here first.

Definition at line 184 of file hub_api.py.

def rocon_gateway.hub_api.Hub.remote_gateway_info (   self,
  gateway 
)

Hub Data Retrieval.

  Return remote gateway information for the specified gateway string id.

  @param gateways : gateway id string to search for
  @type string
  @return remote gateway information
  @rtype gateway_msgs.msg.RemotGateway or None

Definition at line 247 of file hub_api.py.

def rocon_gateway.hub_api.Hub.remove_flip_details (   self,
  gateway,
  name,
  type,
  node 
)
  Post flip details to the redis server. This has no actual functionality,
  it is just useful for debugging with the remote_gateway_info service.

  @param gateway : the target of the flip
  @type string
  @param name : the name of the connection
  @type string
  @param type : the type of the connection (one of ConnectionType.xxx
  @type string
  @param node : the node name it was pulled from
  @type string

Definition at line 399 of file hub_api.py.

def rocon_gateway.hub_api.Hub.remove_pull_details (   self,
  gateway,
  name,
  type,
  node 
)
  Post pull details to the hub. This has no actual functionality,
  it is just useful for debugging with the remote_gateway_info service.

  @param gateway : the gateway it was pulling from
  @type string
  @param name : the name of the connection
  @type string
  @param type : the type of the connection (one of ConnectionType.xxx
  @type string
  @param node : the node name it was pulled from
  @type string

Definition at line 435 of file hub_api.py.

def rocon_gateway.hub_api.Hub.send_flip_request (   self,
  gateway,
  connection 
)

Gateway-Gateway Communications.

  Sends a message to the remote gateway via redis pubsub channel. This is called from the
  watcher thread, when a flip rule gets activated.

   - redis channel name: rocon:<remote_gateway_name>
   - data : list of [ command, gateway, rule type, type, xmlrpc_uri ]
    - [0] - command       : in this case 'flip'
    - [1] - gateway       : the name of this gateway, i.e. the flipper
    - [2] - name          : local name
    - [3] - node          : local node name
    - [4] - connection_type : one of ConnectionType.PUBLISHER etc
    - [5] - type_info     : a ros format type (e.g. std_msgs/String or service api)
    - [6] - xmlrpc_uri    : the xmlrpc node uri

  @param command : string command name - either 'flip' or 'unflip'
  @type str

  @param flip_rule : the flip to send
  @type gateway_msgs.msg.RemoteRule

  @param type_info : topic type (e.g. std_msgs/String)
  @param str

  @param xmlrpc_uri : the node uri
  @param str

Definition at line 457 of file hub_api.py.

def rocon_gateway.hub_api.Hub.send_unflip_request (   self,
  gateway,
  rule 
)

Definition at line 492 of file hub_api.py.

def rocon_gateway.hub_api.Hub.unadvertise (   self,
  connection 
)
  Removes a topic, service or action from the public interface.

  @param connection: representation of a connection (topic, service, action)
  @type  connection: str
  @raise .exceptions.ConnectionTypeError: if connectionarg is invalid.

Definition at line 369 of file hub_api.py.

  Remove all gateway info from the hub.

  @return: success or failure of the operation
  @rtype: bool

Definition at line 219 of file hub_api.py.


Member Data Documentation

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 142 of file hub_api.py.

Definition at line 153 of file hub_api.py.

Definition at line 139 of file hub_api.py.

Definition at line 141 of file hub_api.py.

Definition at line 197 of file hub_api.py.

Definition at line 140 of file hub_api.py.

Definition at line 153 of file hub_api.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


rocon_gateway
Author(s): Daniel Stonier, Jihoon Lee,
autogenerated on Tue Jan 15 2013 17:43:24