tigase增加离线消息和保存历史记录
来源:互联网 发布:猎流网店优化 编辑:程序博客网 时间:2024/06/05 18:44
http://www.verydemo.com/article_c81_i83197.html
init.properties增加配置
--comp-name-1=message-archive--comp-class-1=tigase.archive.MessageArchiveComponentmessage-archive/archive-repo-uri=jdbc:mysql://192.168.1.15:3306/tigasedb?user=tigase&password=tigase&useUnicode=true&characterEncoding=UTF-8--sm-plugins=+message-archive-xep-0136sess-man/plugins-conf/message-archive-xep-0136/component-jid=message-archive@s3-1sess-man/plugins-conf/message-archive-xep-0136/default-store-method=bodysess-man/plugins-conf/message-archive-xep-0136/required-store-method=body
历史记录全部保存,和记录类型指定为body,修改类MessageArchivePlugin
//~--- get methods ----------------------------------------------------------private boolean getAutoSave(final XMPPResourceConnection session)throws NotAuthorizedException {/** comment by guahaoif (requiredStoreMethod != StoreMethod.False)return true;Boolean auto = (Boolean) session.getCommonSessionData(ID + "/" + AUTO);if (auto == null) {try {String data = session.getData(SETTINGS, AUTO, "false");auto = Boolean.parseBoolean(data);session.putCommonSessionData(ID + "/" + AUTO, auto);} catch (TigaseDBException ex) {log.log(Level.WARNING, "Error getting Message Archive state: {0}", ex.getMessage());auto = false;}}return auto;**///modified for all save;return true;}private StoreMethod getStoreMethod(XMPPResourceConnection session) throws NotAuthorizedException {/**comment by guahaoStoreMethod save = (StoreMethod) session.getCommonSessionData(ID + "/" + DEFAULT_SAVE);if (save == null) {try {String data = session.getData(SETTINGS, DEFAULT_SAVE, defaultStoreMethod.toString());save = StoreMethod.valueof(data);session.putCommonSessionData(ID + "/" + DEFAULT_SAVE, save);} catch (TigaseDBException ex) {log.log(Level.WARNING, "Error getting Message Archive state: {0}", ex.getMessage());save = StoreMethod.False;}}if (save.ordinal() < requiredStoreMethod.ordinal()) {save = requiredStoreMethod;session.putCommonSessionData(ID + "/" + DEFAULT_SAVE, save);try {setStoreMethod(session, save);} catch (TigaseDBException ex) {log.log(Level.WARNING, "Error updating message archiving level to required level {0}", ex.getMessage());}}return save;**/StoreMethod save = requiredStoreMethod;session.putCommonSessionData(ID + "/" + DEFAULT_SAVE, save);try {setStoreMethod(session, save);} catch (TigaseDBException ex) {log.log(Level.WARNING, "Error updating message archiving level to required level {0}", ex.getMessage());}return save;}
知道这个后,你会知道,并非安装了message-archive 组件后,日志就可以记录了;而是要客户端允许了;
那么如何安装?
把message-archive.jar 拷贝到 jars/tigase-message-archiving.jar 然后再 etc/init.properties 写下如下配置;
####begin
--comp-name-1=m
参考如下文章一切ok
http://hi.baidu.com/bngoogle/archive/tag/tigase
https://projects.tigase.org/projects/message-archiving/wiki/Configuration
https://projects.tigase.org/projects/message-archiving/wiki/Configuration
Configuration
Basic configuration
Below is example configuration required by component:
In this example configuration is passed connection string to database (if connection string is empty default user repository will be used as database to store archived messages) and JID of message archive component.
If component-jid
option is omitted message-archive@local-machine-name will be used as component-jid
.
Additional options
We added following additional features, which are available since 1.0.1 release.
Setting default value of archiving level for messages on a server
Settting this property will change default archiving level for messages for every account on server for which per account default archiving level is not set. User will be able to change this value setting default modes as described in XEP-0136 section 2.4
Example in which we set default server message archiving level to message
:
Setting required value of archiving level for messages on a server
Settting this property will change required archiving level for messages for every account on server. User will be able to change this to any lower value by setting default modes as described in XEP-0136 section 2.4, but user will be allowed to set higher archiving level. If this property is set to higher value then default archiving level is set then this setting will be used as default archiving level setting.
Example in which we set required server message archiving level to body
:
- tigase增加离线消息和保存历史记录
- openfire 保存离线消息
- Tigase 如何避免丢失消息
- TextBox 不保存历史记录
- android AutoCompleteTextView 保存历史记录
- tigase
- tigase
- 文件传输及离线消息的获取 离线消息和离线文件的实现
- 系统保存客户操作历史记录
- IE地址栏无法保存历史记录
- Tigase开发笔记6:packet流转机制 -> 一条消息(packet)的请求和响应过程解析
- tigase rest Api 发送消息 解决消息中文乱码问题
- Android搜索框(保存历史记录和自动匹配)带有ScrollView嵌套ListView阻尼效果
- h5的插入历史记录和替换历史记录
- 取消root命令历史记录增加安全性
- js 刷新和 历史记录
- tigase的源码下载和服务安装
- HTML5 离线保存数据
- SQL Server 数据库安全
- iphone 导航栏高度
- makefile
- Android之Action Bar完全解析,使用官方推荐的最佳导航栏(上)
- 几种光纤接口(ST,SC,LC,FC)
- tigase增加离线消息和保存历史记录
- MLC颗粒+eMMC 5.0,Kuner扩容iPhone6
- C语言定义与声明
- TextBox自动完成控件
- jdk,jre,jvm的区别
- Java对txt文件管理
- 深入理解linux内核--字符设备块设备
- 一个Gmail刷新动画的Demo
- SQL Server 学习指南