即使断开与XMPP服务器的连接,如何保持组聊天室(MUC)始终存在? [英] How to keep the groupchat room (MUC) existing all the time even if disconnected from the XMPP server?

查看:151
本文介绍了即使断开与XMPP服务器的连接,如何保持组聊天室(MUC)始终存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XMPP(Jabber)协议中的openfire/jsjac开发即时消息模块(J2EE Web应用程序的一部分).

I am developing a instant message module (part of J2EE web app) using openfire/jsjac within the protocol of XMPP (Jabber).

openfire用户/组管理/表已被重定向到我们的业务数据库表,这意味着我不再需要在openfire中维护用户/组.所有的用户/组关系都已在业务数据库中设置.

The openfire users/groups management/tables has been redirected to our business database tables,which means I do not need to maintain users/groups in openfire any more. all the users/group relationship has been set in business database.

下面是我根据需要在主窗格上绘制的图像. 由于信誉低,我无法发布图片,因此我发布了即时消息主用户界面图片的网址.很抱歉给您带来不便. 即时消息主用户界面图片

Below is the Image i draw about the main pane according to requirement. because of my low reputaion i can not post an image, So i post a url for the image of my instantmessage main UI. Sorry for the unconvenience. instantmessage main UI Image

你们可以看到在左窗格中没有用户/组列表.根据历史记录保存的会话使我感到困惑,尤其是关于组的问题. 我从XMPP.org阅读了"XEP-0045:多用户聊天".我了解有关群聊的一般工作流程: XEP-0045:多用户聊天"

You guys can see that in the left pane,there are not a users/groups list.There are sessions saved according to history, which puzzle me,specially about group. I read the "XEP-0045: Multi-User Chat" from XMPP.org. I know about general workflow about group chat: XEP-0045: Multi-User Chat"

  1. 创建房间,生成roomJid.
  2. 配置房间.(保留房间)
  3. 从业务数据库中获取用户,然后将用户绑定(添加)到新创建的会议室.
  4. 向房间发送消息.
  5. 服务将向所有组成员发送消息.

知道房间类型为永久房间时,解释为"如果最后一个居住者离开,房间不会被破坏;反义词:临时房间."通过文档 在同一文档中有一些句子说:

And knew about that there is room type is persistent room is explained as "A room that is not destroyed if the last occupant exits; antonym: Temporary Room." by doc. And in the same doc there are some sentences said:

会议室所有者必须能够销毁会议室,尤其是在会议室是永久性的情况下.工作流程如下:

  1. 会议室所有者要求销毁会议室,可以选择指定原因和其他场所.
  2. 会议室将所有用户从会议室中移除(包括有关备用位置和被移除原因的适当信息),并摧毁了该会议室,即使该会议室被定义为永久性的.
  1. The room owner requests that the room be destroyed, optionally specifying a reason and an alternate venue.
  2. The room removes all users from the room (including appropriate information about the alternate location and the reason for being removed) and destroys the room, even if it was defined as persistent.

读完上面的句子后,我感到很困惑,仍然有一些问题我很困惑.

After reading the above sentence, i am more puzzled, there are several problems i am still confused.

  1. 乘员出口"是什么意思?如果居住者从系统中退出(离线),则表示存在".所有居住者都处于脱机状态,这是否意味着持久类型"将使我们创建的房间保持现有状态?那么房间信息保存在哪里?在明火或其他地方?
  2. 假设所有占用者都存在(脱机),并且在此创建的房间中没有将其破坏,那么绑定信息又如何呢?我的意思是假设所有者(admin)授予了一个用户成员身份,如果该用户存在或处于脱机状态,则永久会议室将保留其成员身份,对吗?换句话说,只要房间不被破坏,所有的配置和绑定信息都不会丢失,对吗?
  3. openfire服务器遇到重新启动的情况,所创建的房间及其信息是否仍然存在?
  4. 如果所有者重新登录,如何重新找到创建的房间?通过保存房间ID?
  1. what is meaning of "occupant exits"? if a occupant log out from the system(offline),is that mean "exist".And all the occupants are offline, is that means the "persistent type" will make the room we created kept existing? So where the room info are saved? in openfire or somewhere other?
  2. Assume that all the occupants exist(offline), althrough this created room was not destoryed, how about the binding information? i mean assume that one user was granted membership by owner(admin), if this user exist or offline, the persistent room will keep his membership role, right? in other words, as long as the room is not destoryed, all the configuration and binding info will not lost,right?
  3. How about the situation that the openfire server encounter restarting, whether the created room and its information are still there?
  4. how to re-find the created room if the owner re-login? through saving the room id?

除上述问题外,我认为实现具有持久空间的MUC的工作流程.您可以检查一下,看看流程中存在什么问题吗?

besides the above question, I thought the workflow to realize the MUC with a persistent room. would you please check that and see what problem existed in the flow?

我为具有持久空间的MUC工作流程

  1. 所有者将状态对象发送到服务器以创建房间并提供房间JID,并设置房间ID.
  2. 所有者将IQ对象发送到服务器以配置创建的房间并将房间类型设置为永久".
  3. 所有者发送IQ对象以向其他用户授予成员身份.(绑定信息)
  4. 所有者将消息对象发送给ROOM标识,并且ROOM标识会将所有消息转发给其绑定的成员.
  5. 该会议室的普通成员处理消息(接收)并获得会议室标识和会议室ID (我希望包括房主在内的所有用户都可以在使用此会议室ID时重新定义会议室他们重新登录..)
  1. The owner send presence object to server to creat room and give the room JID, and set the room ID.
  2. The owner send IQ object to Server to configure the created room and set room type as "persistent".
  3. The owner send IQ object to grants other users the membership role.(binding info)
  4. The owner send message Object to ROOM jid, and ROOM jid will forward all the message to its binded members.
  5. Common members of this room handle message(receive) and get the room jid and room id (i hope all users including owner can use this room id to re-find the room when they relogin.. )

因此,无论角色是什么,所有者或普通成员,如何在会议室类型为永久"的前提下根据会议室编号或会议室ID重新创建并加入会议室? strong>

So no matter what the role is , owner or common member, how to refind and rejoin the created room according to the room jid or room id with a precondition that the room type is "persistent"??

推荐答案

  1. 规范说必须能够销毁",而不是必须销毁".持久的MUC 不要在最后一个用户离开MUC时自动销毁

  1. The spec says "must be able to destroy", not "has to destroy". Persistent MUCs do not get automatically destroyed when the last user leaves the MUC

I取决于MUC组件的实现.如果将持久性MUC存储在持久性存储中,则它能够在重新启动时重新加载所有持久性MUC. IIRC是Openfire的MUC组件.

I depends on the implementation of the MUC component. If it stores the persistent MUCs on persistent storage, then it's able to reload all persistent MUCs on restart. IIRC the MUC component of Openfire does so.

使其具有持久性.

这篇关于即使断开与XMPP服务器的连接,如何保持组聊天室(MUC)始终存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆