25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

documentation update (thanks to Karim Gemayel)

This commit is contained in:
Christophe Romain 2010-10-18 16:53:21 +02:00
parent 91cf9194d8
commit 0f3bd782c4

View File

@ -35,112 +35,149 @@
%% ------------------------------- %% -------------------------------
%% Pubsub types %% Pubsub types
%%% @type host() = string(). %% @type host() = string().
%%% <p><tt>host</tt> is the name of the PubSub service. For example, it can be %% <p><tt>host</tt> is the name of the PubSub service. For example, it can be
%%% <tt>"pubsub.localhost"</tt>.</p> %% <tt><<"pubsub.localhost">></tt>.</p>
%%% @type pubsubNode() = [string()]. %% @type nodeId() = binary().
%%% <p>A node is defined by a list of its ancestors. The last element is the name %% <p>A node is defined by a list of its ancestors. The last element is the name
%%% of the current node. For example: %% of the current node. For example:
%%% ```["home", "localhost", "cromain", "node1"]'''</p> %% ```<<"/home/localhost/user">>'''</p>
%%% @type stanzaError() = #xmlelement{}. %% @type nodeIdx() = integer().
%%% Example:
%%% ```{xmlelement, "error",
%%% [{"code", Code}, {"type", Type}],
%%% [{xmlelement, Condition, [{"xmlns", ?NS_STANZAS}], []}]}'''
%%% @type pubsubIQResponse() = #xmlelement{}. %% @type itemId() = string().
%%% Example:
%%% ```{xmlelement, "pubsub",
%%% [{"xmlns", ?NS_PUBSUB_EVENT}],
%%% [{xmlelement, "affiliations", [],
%%% []}]}'''
%%% @type nodeOption() = {Option::atom(), Value::term()}. %% @type subId() = string().
%%% Example:
%%% ```{deliver_payloads, true}'''
%%% @type nodeType() = string(). %% @type payload() = [#xmlelement{} | #xmlcdata{}].
%%% <p>The <tt>nodeType</tt> is a string containing the name of the PubSub
%%% plugin to use to manage a given node. For example, it can be
%%% <tt>"flat"</tt>, <tt>"hometree"</tt> or <tt>"blog"</tt>.</p>
%%% @type jid() = #jid{ %% @type stanzaError() = #xmlelement{}.
%%% user = string(), %% Example:
%%% server = string(), %% ```{xmlelement, "error",
%%% resource = string(), %% [{"code", Code}, {"type", Type}],
%%% luser = string(), %% [{xmlelement, Condition, [{"xmlns", ?NS_STANZAS}], []}]}'''
%%% lserver = string(), %% @type pubsubIQResponse() = #xmlelement{}.
%%% lresource = string()}. %% Example:
%% ```{xmlelement, "pubsub",
%% [{"xmlns", ?NS_PUBSUB_EVENT}],
%% [{xmlelement, "affiliations", [],
%% []}]}'''
%%% @type ljid() = {User::string(), Server::string(), Resource::string()}. %% @type nodeOption() = {Option, Value}.
%% Option = atom(),
%% Value = term().
%% Example:
%% ```{deliver_payloads, true}'''
%%% @type affiliation() = none | owner | publisher | outcast. %% @type nodeType() = string().
%%% @type subscription() = none | pending | unconfigured | subscribed. %% <p>The <tt>nodeType</tt> is a string containing the name of the PubSub
%% plugin to use to manage a given node. For example, it can be
%% <tt>"flat"</tt>, <tt>"hometree"</tt> or <tt>"blog"</tt>.</p>
%%% internal pubsub index table %% @type jid() = {jid, User, Server, Resource, LUser, LServer, LResource}.
-record(pubsub_index, {index, last, free}). %% User = string(),
%% Server = string(),
%% Resource = string(),
%% LUser = string(),
%% LServer = string(),
%% LResource = string().
%%% @type pubsubNode() = #pubsub_node{ %% @type ljid() = {User, Server, Resource}.
%%% nodeid = {Host::host(), Node::pubsubNode()}, %% User = string(),
%%% parentid = Node::pubsubNode(), %% Server = string(),
%%% nodeidx = int(), %% Resource = string().
%%% type = nodeType(),
%%% options = [nodeOption()]}.
%%% <p>This is the format of the <tt>nodes</tt> table. The type of the table
%%% is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
%%% <p>The <tt>parentid</tt> and <tt>type</tt> fields are indexed.</p>
%%% nodeidx can be anything you want.
-record(pubsub_node, {nodeid,
id,
parents = [],
type = "flat",
owners = [],
options = []
}).
%%% @type pubsubState() = #pubsub_state{ %% @type affiliation() = 'none' | 'owner' | 'publisher' | 'publish-only' | 'member' | 'outcast'.
%%% stateid = {ljid(), nodeidx()},
%%% items = [ItemId::string()], %% @type subscription() = 'none' | 'pending' | 'unconfigured' | 'subscribed'.
%%% affiliation = affiliation(),
%%% subscriptions = [subscription()]}.
%%% <p>This is the format of the <tt>affiliations</tt> table. The type of the %% @type pubsubIndex() = {pubsub_index, Index, Last, Free}.
%%% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p> %% Index = atom(),
-record(pubsub_state, {stateid, %% Last = integer(),
items = [], %% Free = [integer()].
affiliation = none, %% internal pubsub index table
subscriptions = [] -record(pubsub_index,
{
index,
last,
free
}). }).
%%% @type pubsubItem() = #pubsub_item{ %% @type pubsubNode() = {pubsub_node, NodeId, Id, Parents, Type, Owners, Options}.
%%% itemid = {ItemId::string(), nodeidx()}, %% NodeId = {host() | ljid(), nodeId()},
%%% creation = {now(), ljid()}, %% Id = nodeIdx(),
%%% modification = {now(), ljid()}, %% Parents = [nodeId()],
%%% payload = XMLContent::string()}. %% Type = nodeType(),
%%% <p>This is the format of the <tt>published items</tt> table. The type of the %% Owners = [ljid()],
%%% table is: <tt>set</tt>,<tt>disc</tt>,<tt>fragmented</tt>.</p> %% Options = [nodeOption()].
-record(pubsub_item, {itemid, %% <p>This is the format of the <tt>nodes</tt> table. The type of the table
creation = {unknown,unknown}, %% is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
modification = {unknown,unknown}, %% <p>The <tt>Parents</tt> and <tt>type</tt> fields are indexed.</p>
payload = [] %% <tt>id</tt> can be anything you want.
}). -record(pubsub_node,
{
nodeid,
id,
parents = [],
type = "flat",
owners = [],
options = []
}).
%% @type pubsubState() = {pubsub_state, StateId, Items, Affiliation, Subscriptions}.
%% StateId = {ljid(), nodeIdx()},
%% Items = [itemId()],
%% Affiliation = affiliation(),
%% Subscriptions = [{subscription(), subId()}].
%% <p>This is the format of the <tt>affiliations</tt> table. The type of the
%% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
-record(pubsub_state,
{
stateid,
items = [],
affiliation = 'none',
subscriptions = []
}).
%% @type pubsubSubscription() = #pubsub_subscription{ %% @type pubsubItem() = {pubsub_item, ItemId, Creation, Modification, Payload}.
%% subid = string(), %% ItemId = {itemId(), nodeIdx()},
%% state_key = {ljid(), pubsubNodeId()}, %% Creation = {now(), ljid()},
%% options = [{atom(), term()}] %% Modification = {now(), ljid()},
%% }. %% Payload = payload().
%% <p>This is the format of the <tt>published items</tt> table. The type of the
%% table is: <tt>set</tt>,<tt>disc</tt>,<tt>fragmented</tt>.</p>
-record(pubsub_item,
{
itemid,
creation = {'unknown','unknown'},
modification = {'unknown','unknown'},
payload = []
}).
%% @type pubsubSubscription() = {pubsub_subscription, SubId, Options}.
%% SubId = subId(),
%% Options = [nodeOption()].
%% <p>This is the format of the <tt>subscriptions</tt> table. The type of the %% <p>This is the format of the <tt>subscriptions</tt> table. The type of the
%% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p> %% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
-record(pubsub_subscription, {subid, options}). -record(pubsub_subscription,
{
subid,
options
}).
%% @type pubsubLastItem() = #pubsub_last_item{ %% @type pubsubLastItem() = {pubsub_last_item, NodeId, ItemId, Creation, Payload}.
%% nodeid = nodeidx(), %% NodeId = nodeIdx(),
%% itemid = string(), %% ItemId = itemId(),
%% payload = XMLContent::string()}. %% Creation = {now(),ljid()},
%% Payload = payload().
%% <p>This is the format of the <tt>last items</tt> table. it stores last item payload %% <p>This is the format of the <tt>last items</tt> table. it stores last item payload
%% for every node</p> %% for every node</p>
-record(pubsub_last_item, {nodeid, itemid, creation, payload}). -record(pubsub_last_item,
{
nodeid,
itemid,
creation,
payload
}).