exampple v0.7.1 Exampple.Router.Conn

Conn is a module to store the information related to a XMPP request. Conn has the following information inside:

  • domain: the component domain.
  • from_jid: the JID where the stanza is coming from.
  • to_jid: the JID where the stanza is sent to.
  • id: the ID for the stanza.
  • type: the type attribute of the stanza. Depending on the stanza type it could be chat, groupchat, normal, get, set, ...
  • xmlns: the namespace for the XML stanza.
  • stanza_type: the stanza type, it could be iq, message or presence. It is possible to receive other kind of XML stanzas, but it is not common.
  • stanza: the original stanza in %Xmlel{} format.
  • reponse: the generated response in use if we pass the connection to the Exampple.Component module.
  • envelope: it is a closure needed if we are receiving stanzas which are using an envelope. It is not needed to handle it manually, see further information about this in Exampple.Router.

Link to this section Summary

Functions

Obtains the response stored inside of the conn. Checking if there is an envelope used or not.

Creates a new connection passing a %Xmlel{} struct in xmlel as the first parameter and a domain as a second parameter (or nil by default) to create a %Conn{} struct.

Link to this section Types

Link to this type

t()

t() :: %Exampple.Router.Conn{
  domain: term(),
  envelope: term(),
  from_jid: term(),
  id: term(),
  response: term(),
  stanza: term(),
  stanza_type: term(),
  to_jid: term(),
  type: term(),
  xmlns: term()
}

Link to this section Functions

Link to this function

get_response(conn)

Obtains the response stored inside of the conn. Checking if there is an envelope used or not.

Link to this function

new(xmlel, domain \\ nil)

Creates a new connection passing a %Xmlel{} struct in xmlel as the first parameter and a domain as a second parameter (or nil by default) to create a %Conn{} struct.