%% API
-export([get_nodes/0, call/4, multicall/3, multicall/4]).
--export([join/1, leave/1]).
+-export([join/1, leave/1, get_known_nodes/0]).
-include("ejabberd.hrl").
-include("logger.hrl").
get_nodes() ->
mnesia:system_info(running_db_nodes).
+-spec get_known_nodes() -> [node()].
+
+get_known_nodes() ->
+ lists:usort(mnesia:system_info(db_nodes)
+ ++ mnesia:system_info(extra_db_nodes)).
+
-spec call(node(), module(), atom(), [any()]) -> any().
call(Node, Module, Function, Args) ->
%%%% get_nodes
get_nodes(Lang) ->
- RunningNodes = mnesia:system_info(running_db_nodes),
- StoppedNodes = lists:usort(mnesia:system_info(db_nodes)
- ++ mnesia:system_info(extra_db_nodes))
+ RunningNodes = ejabberd_cluster:get_nodes(),
+ StoppedNodes = ejabberd_clustet:get_known_nodes()
-- RunningNodes,
FRN = if RunningNodes == [] -> ?CT(<<"None">>);
true ->
?XCT(<<"h3">>, <<"Stopped Nodes">>), FSN].
search_running_node(SNode) ->
- search_running_node(SNode,
- mnesia:system_info(running_db_nodes)).
+ RunningNodes = ejabberd_cluster:get_nodes(),
+ search_running_node(SNode, RunningNodes).
search_running_node(_, []) -> false;
search_running_node(SNode, [Node | Nodes]) ->