Infinity.CommunicationGroup¶
| Subclasses: | Infinity.CommunicationHostedGroup,Infinity.CommunicationJoinedGroup | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| cancel_messages(connection) | |
| get_method_for_connection(conn) | |
| get_method_for_network(network) | |
| get_name() | |
| get_publisher_id(for_connection) | |
| get_target() | |
| is_member(connection) | |
| send_group_message(xml) | |
| send_message(connection, xml) | |
| set_target(target) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_get_method(index) | |
| do_get_publisher_id(for_connection) | |
| do_member_added(connection) | |
| do_member_removed(connection) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| communication-manager | Infinity.CommunicationManager | w/co | The communication manager used for sending requests | 
| communication-registry | Infinity.CommunicationRegistry | w/co | The registry to register connections with | 
| name | str | r/w/co | The name of the group | 
| target | Infinity.CommunicationObject | r/w | The communication object to call on received and sent data | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| member-added | This signal is emitted when a connection has been added to the group. | 
| member-removed | This signal is emitted when a connection has been removed from the group. | 
Class Details¶
- 
class Infinity.CommunicationGroup(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - Structure: - Infinity.CommunicationGroupClass- Infinity.CommunicationGroupis an opaque data type. You should only access it via the public API functions.- 
cancel_messages(connection)¶
- Parameters: - connection ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionfor which to cancel messages.- Stops all messages scheduled to be sent to connection from being sent. Messages for which - Infinity.CommunicationObject.enqueued() has already been called cannot be cancelled anymore.
 - 
get_method_for_connection(conn)¶
- Parameters: - conn ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionfor which to retrieve the method.- Returns: - A method name. The string is owned by the group, you don’t need to free it. - Return type: - str- Returns the method name of the method used for communication on conn’s network within group. conn does not need to be a member of self for this function to be called. 
 - 
get_method_for_network(network)¶
- Parameters: - network ( - str) – A network specifier, such as “tcp/ip” or “jabber”.- Returns: - A method name. The string is owned by the group, you don’t need to free it. - Return type: - str- Returns the method name of the method used for communication on network within self. 
 - 
get_name()¶
- Returns: - The name of the group. The returned string is owned by the group, you don’t need to free it. - Return type: - str- Returns the name of the group. 
 - 
get_publisher_id(for_connection)¶
- Parameters: - for_connection ( - Infinity.XmlConnection) – A- Infinity.XmlConnection.- Returns: - The publisher’s host ID. Free with - GLib.free().- Return type: - str- Returns a host identifier for the group’s publisher (see - Infinity.XmlConnection- :local-idand- Infinity.XmlConnection- :remote-id). If the local host is the publisher, then this will simply return for_connection’s local ID, otherwise the remote ID of the connection to the publisher on for_connection’s network is returned.
 - 
get_target()¶
- Returns: - A - Infinity.CommunicationGroup, or- None.- Return type: - Infinity.CommunicationObjector- None- Returns the group’s target. The target of a group is the - Infinity.CommunicationObjectto which received and sent messages are reported.
 - 
is_member(connection)¶
- Parameters: - connection ( - Infinity.XmlConnection) – A- Infinity.XmlConnection.- Returns: - Trueif connection is a member of self,- Falseotherwise.- Return type: - bool- Returns whether connection is a member of self. 
 - 
send_group_message(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – The message to send.- Sends a message to all members of self. This function takes ownership of xml. 
 - 
send_message(connection, xml)¶
- Parameters: - connection (Infinity.XmlConnection) – TheInfinity.XmlConnectionto which to send the message.
- xml (libxml2.NodePtr) – The message to send.
 - Sends a message connection which must be a member of self. connection needs to be a member of this group. This function takes ownership of xml. 
- connection (
 - 
set_target(target)¶
- Parameters: - target ( - Infinity.CommunicationObject) – A- Infinity.CommunicationObject, or- None.- Sets the group’s target. The target of a group is the - Infinity.CommunicationObjectto which received and sent messages are reported. If target is- None, then the target will be unset.- You can safely call this function with an object that holds a reference on the group since the - Infinity.CommunicationGrouponly holds a weak reference to its target. This means that you need to keep a reference on target yourself.
 - 
do_get_publisher_id(for_connection) virtual¶
- Parameters: - for_connection ( - Infinity.XmlConnection) – A- Infinity.XmlConnection.- Returns: - The publisher’s host ID. Free with - GLib.free().- Return type: - str- Returns a host identifier for the group’s publisher (see - Infinity.XmlConnection- :local-idand- Infinity.XmlConnection- :remote-id). If the local host is the publisher, then this will simply return for_connection’s local ID, otherwise the remote ID of the connection to the publisher on for_connection’s network is returned.
 - 
do_member_added(connection) virtual¶
- Parameters: - connection ( - Infinity.XmlConnection) –
 - 
do_member_removed(connection) virtual¶
- Parameters: - connection ( - Infinity.XmlConnection) –
 
- 
Signal Details¶
- 
Infinity.CommunicationGroup.signals.member_added(communication_group, connection)¶
- Signal Name: - member-added- Flags: - Parameters: - communication_group (Infinity.CommunicationGroup) – The object which received the signal
- connection (Infinity.XmlConnection) – The newly joined connection.
 - This signal is emitted when a connection has been added to the group. 
- communication_group (
- 
Infinity.CommunicationGroup.signals.member_removed(communication_group, connection)¶
- Signal Name: - member-removed- Flags: - Parameters: - communication_group (Infinity.CommunicationGroup) – The object which received the signal
- connection (Infinity.XmlConnection) – The connection that was removed
 - This signal is emitted when a connection has been removed from the group. 
- communication_group (
Property Details¶
- 
Infinity.CommunicationGroup.props.communication_manager¶
- Name: - communication-manager- Type: - Infinity.CommunicationManager- Default Value: - None- Flags: - WRITABLE,- CONSTRUCT_ONLY- The communication manager used for sending requests 
- 
Infinity.CommunicationGroup.props.communication_registry¶
- Name: - communication-registry- Type: - Infinity.CommunicationRegistry- Default Value: - None- Flags: - WRITABLE,- CONSTRUCT_ONLY- The registry to register connections with 
- 
Infinity.CommunicationGroup.props.name¶
- Name: - name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The name of the group 
- 
Infinity.CommunicationGroup.props.target¶
- Name: - target- Type: - Infinity.CommunicationObject- Default Value: - None- Flags: - READABLE,- WRITABLE- The communication object to call on received and sent data