aboutsummaryrefslogtreecommitdiff
path: root/src/gen_pubsub_nodetree.erl
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2015-04-08 17:12:05 +0200
committerChristophe Romain <christophe.romain@process-one.net>2015-04-21 15:24:16 +0200
commite0563e3918984d151fbea45a5f6fc8255913726d (patch)
treee62bcc5cc538a722f81c3f53291e02594e576711 /src/gen_pubsub_nodetree.erl
parentImprove join/leave cluster scripts (diff)
PubSub improvements
This commit contains - code cleanup - use of db_type instead of old mod_pubsub_odbc - some minor optimizations - some minor bugfixes
Diffstat (limited to 'src/gen_pubsub_nodetree.erl')
-rw-r--r--src/gen_pubsub_nodetree.erl73
1 files changed, 28 insertions, 45 deletions
diff --git a/src/gen_pubsub_nodetree.erl b/src/gen_pubsub_nodetree.erl
index 8cbe1d3df..ce6750dba 100644
--- a/src/gen_pubsub_nodetree.erl
+++ b/src/gen_pubsub_nodetree.erl
@@ -32,49 +32,31 @@
-include("jlib.hrl").
--type(host() :: mod_pubsub:host()
- | mod_pubsub_odbc:host()
-).
-
--type(nodeId() :: mod_pubsub:nodeId()
- | mod_pubsub_odbc:nodeId()
-).
-
--type(nodeIdx() :: mod_pubsub:nodeIdx()
- | mod_pubsub_odbc:nodeIdx()
-).
-
--type(itemId() :: mod_pubsub:itemId()
- | mod_pubsub_odbc:itemId()
-).
-
--type(pubsubNode() :: mod_pubsub:pubsubNode()
- | mod_pubsub_odbc:pubsubNode()
-).
-
--type(nodeOptions() :: mod_pubsub:nodeOptions()
- | mod_pubsub_odbc:nodeOptions()
-).
+-type(host() :: mod_pubsub:host()).
+-type(nodeId() :: mod_pubsub:nodeId()).
+-type(nodeIdx() :: mod_pubsub:nodeIdx()).
+-type(pubsubNode() :: mod_pubsub:pubsubNode()).
+-type(nodeOptions() :: mod_pubsub:nodeOptions()).
-callback init(Host :: host(),
- ServerHost :: binary(),
- Opts :: [any()]) -> atom().
+ ServerHost :: binary(),
+ Opts :: [any()]) -> atom().
-callback terminate(Host :: host(), ServerHost :: binary()) -> atom().
-callback options() -> nodeOptions().
-callback set_node(PubsubNode :: pubsubNode()) ->
- ok | {result, NodeIdx::mod_pubsub_odbc:nodeIdx()} | {error, xmlel()}.
+ ok | {result, NodeIdx::nodeIdx()} | {error, xmlel()}.
-callback get_node(Host :: host(),
- NodeId :: nodeId(),
- From :: jid()) ->
+ NodeId :: nodeId(),
+ From :: jid()) ->
pubsubNode() |
{error, xmlel()}.
-callback get_node(Host :: host(),
- NodeId :: nodeId()) ->
+ NodeId :: nodeId()) ->
pubsubNode() |
{error, xmlel()}.
@@ -83,42 +65,43 @@
{error, xmlel()}.
-callback get_nodes(Host :: host(),
- From :: jid())->
+ From :: jid())->
[pubsubNode()].
-callback get_nodes(Host :: host())->
[pubsubNode()].
-callback get_parentnodes(Host :: host(),
- NodeId :: nodeId(),
- From :: jid()) ->
+ NodeId :: nodeId(),
+ From :: jid()) ->
[pubsubNode()] |
{error, xmlel()}.
-callback get_parentnodes_tree(Host :: host(),
- NodeId :: nodeId(),
- From :: jid()) ->
+ NodeId :: nodeId(),
+ From :: jid()) ->
[{0, [pubsubNode(),...]}].
-callback get_subnodes(Host :: host(),
- NodeId :: nodeId(),
- From :: ljid()) ->
+ NodeId :: nodeId(),
+ From :: jid()) ->
[pubsubNode()].
-callback get_subnodes_tree(Host :: host(),
- NodeId :: nodeId(),
- From :: ljid()) ->
+ NodeId :: nodeId(),
+ From :: jid()) ->
[pubsubNode()].
-callback create_node(Host :: host(),
- NodeId :: nodeId(),
- Type :: binary(),
- Owner :: jid(),
- Options :: nodeOptions(),
- Parents :: [nodeId()]) ->
+ NodeId :: nodeId(),
+ Type :: binary(),
+ Owner :: jid(),
+ Options :: nodeOptions(),
+ Parents :: [nodeId()]) ->
{ok, NodeIdx::nodeIdx()} |
- {error, xmlel()}.
+ {error, xmlel()} |
+ {error, {virtual, {host(), nodeId()}}}.
-callback delete_node(Host :: host(),
- NodeId :: nodeId()) ->
+ NodeId :: nodeId()) ->
[pubsubNode()].