开发者

In Openfire, how can I get who have subscribed a node?

开发者 https://www.devze.com 2023-01-16 09:09 出处:网络
Some client subscribe a node, I want to know how to get the subscriber. Is there some plugins in the Openfire can do this开发者_JS百科?You will need to build the smack version from the repo to get Pu

Some client subscribe a node, I want to know how to get the subscriber.

Is there some plugins in the Openfire can do this开发者_JS百科?


You will need to build the smack version from the repo to get PubSub support. See my blog for details. Once you have build smack, this is how you retrieve the list of subscribers

//Assume pubsub jid is pubsub.myserver
PubSubManager mgr = new PubSubManager(conn, "pubsub.myserver");

//Assume we are dealing with leafnode
LeafNode node = (LeafNode)mgr.getNode("mynode");

List<Subscriptions> subscriptions = node.getSubscriptions();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号