Public Interface. More...

Public Member Functions | |
| def | __init__ (self, default_rule_blacklist, default_rules) |
| def | add_rule (self, rule) |
| Public Interfaces. More... | |
| def | advertise_all (self, blacklist) |
| def | getBlacklist (self) |
| def | getConnections (self) |
| List Accessors. More... | |
| def | getInterface (self) |
| def | getWatchlist (self) |
| def | remove_rule (self, rule) |
| def | unadvertise_all (self) |
| def | update (self, connections, generate_advertisement_connection_details) |
Public Attributes | |
| advertise_all_enabled | |
| blacklist | |
| lock | |
| public | |
| watchlist | |
Private Member Functions | |
| def | _allowRule (self, rule) |
| def | _generatePublic (self, rule) |
| def | _matchAgainstRuleList (self, rules, rule) |
| Filter. More... | |
Private Attributes | |
| _default_blacklist | |
Public Interface.
The public interface is the set of rules
(pubs/subs/services/actions) that are exposed and made available for
freely sharing with a multimaster system.
It consists of:
* list of currently available rules to be shared
* list of rules and filters that will be watched
and shared if they become available
Definition at line 54 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.__init__ | ( | self, | |
| default_rule_blacklist, | |||
| default_rules | |||
| ) |
Initialises the public interface @param default_rule_blacklist : connection type keyed dictionary of rules @type str keyed dictionary of gateway_msgs.msg.Rule[] @param default_rules : connection type keyed dictionary of rules @type str keyed dictionary of gateway_msgs.msg.Rule[]
Definition at line 67 of file public_interface.py.
|
private |
Determines whether a given rule should be allowed given the status of the current watchlist and blacklist @param rule : the given rule/rule to match @type Rule @return whether rule is allowed @rtype bool
Definition at line 288 of file public_interface.py.
|
private |
Given a rule, determines if the rule is allowed. If it is allowed, then returns the corresponding Rule object @param rules : the given rules to match @type Rule @return The generated Rule if allowed, None if no match @rtype Rule || None
Definition at line 311 of file public_interface.py.
|
private |
Filter.
Match a given rule/rule against a given rule list @param rules : the rules against which to match @type dict of list of Rule objects @param rule : the given rule/rule to match @type Rule @return the list of rules matched, None if no rules found @rtype list of Rules || None
Definition at line 263 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.add_rule | ( | self, | |
| rule | |||
| ) |
Public Interfaces.
Watch for a new public rule, as described for by the incoming message. @param rule : a rule msg from the advertise call @type Rule @return the rule if added, or None if the rule exists already @rtype Rule || None
Definition at line 104 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.advertise_all | ( | self, | |
| blacklist | |||
| ) |
Allow all rules apart from the ones in the provided blacklist + default blacklist @param blacklist : list of Rule objects @type list : list of Rule objects @return failure if already advertising all, success otherwise @rtype bool
Definition at line 162 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.getBlacklist | ( | self | ) |
Definition at line 251 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.getConnections | ( | self | ) |
List Accessors.
List of all rules with connection information that is being published. @return dictionary of utils.Connections keyed by type.
Definition at line 221 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.getInterface | ( | self | ) |
List of all rules currently being advertised. @return list of all connections posted on hubs @rtype list of gateway_msgs.msg.Rule
Definition at line 229 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.getWatchlist | ( | self | ) |
Definition at line 243 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.remove_rule | ( | self, | |
| rule | |||
| ) |
Attempt to remove a watchlist rule from the public interface. Be a bit careful looking for a rule to remove, depending on the node name, which can be set (exact rule/node name match) or None in which case all nodes of that kind of advertisement will match. @param rule : a rule to unadvertise @type Rule @return the list of rules removed @rtype Rule[]
Definition at line 123 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.unadvertise_all | ( | self | ) |
Disallow the allow all mode, if enabled. If allow all mode is not enabled, remove everything from the public interface
Definition at line 200 of file public_interface.py.
| def rocon_gateway.public_interface.PublicInterface.update | ( | self, | |
| connections, | |||
| generate_advertisement_connection_details | |||
| ) |
Checks a list of rules and determines which ones should be added/removed to the public interface. Modifies the public interface accordingly, and returns the list of rules to the gateway for hub operations @param rules: the list of rules available locally @type dict of lists of Rule objects @param generate_advertisement_connection_details : function from LocalMaster that generates Connection.type_info and Connection.xmlrpc_uri @type method (see LocalMaster.generate_advertisement_connection_details) @return: new public connections, as well as connections to be removed @rtype: utils.Connection[], utils.Connection[]
Definition at line 325 of file public_interface.py.
|
private |
Definition at line 82 of file public_interface.py.
| rocon_gateway.public_interface.PublicInterface.advertise_all_enabled |
Definition at line 91 of file public_interface.py.
| rocon_gateway.public_interface.PublicInterface.blacklist |
Definition at line 85 of file public_interface.py.
| rocon_gateway.public_interface.PublicInterface.lock |
Definition at line 93 of file public_interface.py.
| rocon_gateway.public_interface.PublicInterface.public |
Definition at line 89 of file public_interface.py.
| rocon_gateway.public_interface.PublicInterface.watchlist |
Definition at line 79 of file public_interface.py.