diff --git a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java index d11f35b..7ddf19c 100644 --- a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java +++ b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java @@ -1649,6 +1649,16 @@ public class NodeCenterActions { resultCallback.onResult(ret.toString()); } + @Action(async = true) + public void publishEvent(JsonObject args, final ResultCallback rcb) { + try { + args.addProperty("action", "publishEventFromCenter"); + nodeInfos.values().iterator().next().connection.controller.sendMsg(JsonUtil.toJson(args)); + } catch (Exception e) { + LOGGER.error("publishEvent error! " + e.getMessage()); + } + } + public static class ResultCollector extends ResultCallback { private final ResultCallback committer; List result = new ArrayList<>();