smia.logic.acl_smia_messages_utils module

async smia.logic.acl_smia_messages_utils.get_xmpp_server_from_jid(agent_object_jid)[source]

This method get the XMPP server from the JID of the agent.

Parameters:

agent_object_jid – the JID object of the SMIA SPADE agent.

Returns:

XMPP server.

Return type:

str

async smia.logic.acl_smia_messages_utils.get_agent_id_from_jid(agent_object_jid)[source]

This method get the identifier of the agent from the JID of the agent.

Parameters:

agent_object_jid – the JID object of the SMIA SPADE agent.

Returns:

XMPP server.

Return type:

str

smia.logic.acl_smia_messages_utils.get_sender_from_acl_msg(acl_msg)[source]

This method returns the identifier of an agent from an ACL message, considering the suffixes that can be added by the XMPP server.

Parameters:

acl_msg (spade.message.Message) – ACL message object.

Returns:

identifier of the sender of the message.

Return type:

str

async smia.logic.acl_smia_messages_utils.create_random_thread(agent_object)[source]

This method creates a value for the thread of a SPADE-ACL message, using the agent identifier and random string.

Parameters:

agent_object (spade.Agent) – the SPADE agent object of the SMIA agent.

Returns:

thread value

Return type:

str

async smia.logic.acl_smia_messages_utils.generate_json_from_schema(schema: dict, **kwargs) dict[source]

This method generates a valid JSON from a predefined JSON Schema.

Parameters:
  • schema (dict) – JSON schema object.

  • **kwargs – attributes along with their values to build the JSON.

Returns:

valid JSON object regarding the given schema.

Return type:

dict

smia.logic.acl_smia_messages_utils.get_parsed_body_from_acl_msg(acl_msg)[source]

This method gets the body of an ACL message and returns parsed.

Parameters:

acl_msg (spade.message.Message) – the ACL message object.

Returns:

parsed body of the ACL message.