Protocol labdata stanza¶
XMPP extension¶
All communication is passing throught XMPP Multi-User-Chat room. Inside
groupchat messages we attach labdata XML tag, that contains all silf
specific information.
Example:
<message from='exp@muc.ilf/operator' to='exp@muc.ilf' type='groupchat'>
<labdata xmlns="silf:protocol:version:get" type="query" id="q1"/>
</message>
Labdata stanza¶
Labdata contains following features:
namespace
Namespace used forlabdatatag is used to: define action that thislabdataperforms and partially defines content of labdata tag.
type
SILF uses very simple protocol for conversational state,
typesignifies whether this message is query or response.It also (with
namespacedefines content of labdata tag.There are three possible values:
query,result,dataanderror.
id
ID is used to identify query-response pairs of the same conversation. If query (labdata with type
query) hasidvalue offoo, responseto this message should have the sameid(in most cases namespace will be the same).From protocol standpoint
idis a unique blob of text without any structure. Current implementation usessuuidas ``id``s contents.
content
We always useJSONcontent for labdata contents. Specific JSON structure is defined bynamespaceandtypetags.
Conversation¶
Labdata uses query-response conversation pattern.
Stand alone messages
Stand-alone messages can have two types: data and error. Data is used to
send some information out of conversation, error to send an error condition
out of conversation.
Conversation messages
Conversation is simple:
- One party sends message with type
query, namespacefooand a particularid - Other responds with
messagewith the same namespace andid, type can be either
resultwhich means that any operation requested byquerywas succesfull.errorwhich signifies error condition.