2019-03-16 17:04:23 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012-2017 The original author or authors
|
|
|
|
|
* ------------------------------------------------------
|
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
|
* and Apache License v2.0 which accompanies this distribution.
|
|
|
|
|
*
|
|
|
|
|
* The Eclipse Public License is available at
|
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
*
|
|
|
|
|
* The Apache License v2.0 is available at
|
|
|
|
|
* http://www.opensource.org/licenses/apache2.0.php
|
|
|
|
|
*
|
|
|
|
|
* You may elect to redistribute this code under either of these licenses.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package io.moquette.spi;
|
|
|
|
|
|
2023-11-28 11:04:12 +08:00
|
|
|
import cn.wildfirechat.pojos.*;
|
2021-12-17 21:24:56 +08:00
|
|
|
import cn.wildfirechat.proto.ProtoConstants;
|
2019-03-16 17:04:23 +08:00
|
|
|
import cn.wildfirechat.proto.WFCMessage;
|
|
|
|
|
import com.xiaoleilu.loServer.model.FriendData;
|
|
|
|
|
import io.moquette.persistence.DatabaseStore;
|
2020-01-05 12:32:35 +08:00
|
|
|
import io.moquette.persistence.MemorySessionStore;
|
2019-03-16 17:04:23 +08:00
|
|
|
import io.moquette.persistence.UserClientEntry;
|
|
|
|
|
import io.moquette.spi.impl.subscriptions.Topic;
|
|
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
|
import io.netty.handler.codec.mqtt.MqttQoS;
|
2019-05-22 20:24:21 +08:00
|
|
|
import cn.wildfirechat.common.ErrorCode;
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2023-11-28 11:04:12 +08:00
|
|
|
import java.util.*;
|
2019-03-16 17:04:23 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Defines the SPI to be implemented by a StorageService that handle persistence of messages
|
|
|
|
|
*/
|
|
|
|
|
public interface IMessagesStore {
|
|
|
|
|
|
|
|
|
|
class StoredMessage {
|
|
|
|
|
|
|
|
|
|
final MqttQoS m_qos;
|
|
|
|
|
final byte[] m_payload;
|
|
|
|
|
final String m_topic;
|
|
|
|
|
private boolean m_retained;
|
|
|
|
|
private String m_clientID;
|
|
|
|
|
private MessageGUID m_guid;
|
|
|
|
|
|
|
|
|
|
public StoredMessage(byte[] message, MqttQoS qos, String topic) {
|
|
|
|
|
m_qos = qos;
|
|
|
|
|
m_payload = message;
|
|
|
|
|
m_topic = topic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MqttQoS getQos() {
|
|
|
|
|
return m_qos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTopic() {
|
|
|
|
|
return m_topic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setGuid(MessageGUID guid) {
|
|
|
|
|
this.m_guid = guid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MessageGUID getGuid() {
|
|
|
|
|
return m_guid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getClientID() {
|
|
|
|
|
return m_clientID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setClientID(String m_clientID) {
|
|
|
|
|
this.m_clientID = m_clientID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ByteBuf getPayload() {
|
|
|
|
|
return Unpooled.copiedBuffer(m_payload);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setRetained(boolean retained) {
|
|
|
|
|
this.m_retained = retained;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isRetained() {
|
|
|
|
|
return m_retained;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String toString() {
|
|
|
|
|
return "PublishEvent{clientID='" + m_clientID + '\'' + ", m_retain="
|
|
|
|
|
+ m_retained + ", m_qos=" + m_qos + ", m_topic='" + m_topic + '\'' + '}';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DatabaseStore getDatabaseStore();
|
2019-04-04 07:39:41 +08:00
|
|
|
WFCMessage.Message storeMessage(String fromUser, String fromClientId, WFCMessage.Message message);
|
2019-06-12 22:57:30 +08:00
|
|
|
void storeSensitiveMessage(WFCMessage.Message message);
|
2021-12-17 21:24:56 +08:00
|
|
|
int getNotifyReceivers(String fromUser, WFCMessage.Message.Builder message, Set<String> notifyReceivers, ProtoConstants.RequestSourceType requestSourceType);
|
2019-05-31 07:51:54 +08:00
|
|
|
Set<String> getAllEnds();
|
2019-03-16 17:04:23 +08:00
|
|
|
WFCMessage.PullMessageResult fetchMessage(String user, String exceptClientId, long fromMessageId, int pullType);
|
2021-11-23 13:56:59 +08:00
|
|
|
WFCMessage.PullMessageResult loadRemoteMessages(String user, WFCMessage.Conversation conversation, long beforeUid, int count, Collection<Integer> contentTypes);
|
2022-01-05 11:26:40 +08:00
|
|
|
long insertUserMessages(String sender, int conversationType, String target, int line, int messageContentType, String userId, long messageId, boolean directing);
|
2025-07-05 16:47:15 +08:00
|
|
|
ErrorCode canAddGroupMembers(String operator, List<WFCMessage.GroupMember> memberList, Map<String, Integer> failedMembers);
|
|
|
|
|
WFCMessage.GroupInfo createGroup(String operator, WFCMessage.GroupInfo groupInfo, List<WFCMessage.GroupMember> memberList, String memberExtra, boolean isAdmin, Map<String, Integer> failedMembers);
|
|
|
|
|
ErrorCode addGroupMembers(String operator, boolean isAdmin, String groupId, List<WFCMessage.GroupMember> memberList, String extra, Map<String, Integer> failedMembers);
|
2019-07-05 08:19:29 +08:00
|
|
|
ErrorCode kickoffGroupMembers(String operator, boolean isAdmin, String groupId, List<String> memberList);
|
2022-11-12 14:17:15 +08:00
|
|
|
ErrorCode quitGroup(String operator, String groupId, boolean admin);
|
2019-11-30 11:16:48 +08:00
|
|
|
void clearUserGroups(String userId);
|
2019-05-25 07:55:30 +08:00
|
|
|
ErrorCode dismissGroup(String operator, String groupId, boolean isAdmin);
|
2019-07-08 23:08:04 +08:00
|
|
|
ErrorCode modifyGroupInfo(String operator, String groupId, int modifyType, String value, boolean isAdmin);
|
2021-06-19 11:34:49 +08:00
|
|
|
ErrorCode modifyGroupMemberAlias(String operator, String groupId, String alias, String memberId, boolean isAdmin);
|
|
|
|
|
ErrorCode modifyGroupMemberExtra(String operator, String groupId, String extra, String memberId, boolean isAdmin);
|
2023-02-20 19:27:30 +08:00
|
|
|
List<WFCMessage.GroupInfo> getGroupInfos(List<WFCMessage.UserRequest> requests, String fromUser, boolean isAdmin);
|
2019-03-16 17:04:23 +08:00
|
|
|
WFCMessage.GroupInfo getGroupInfo(String groupId);
|
2019-11-30 11:16:48 +08:00
|
|
|
Set<String> getUserGroupIds(String userId);
|
2023-10-10 12:51:40 +08:00
|
|
|
Set<String> getUserGroupIds(String userId, List<Integer> types);
|
2022-10-28 21:56:20 +08:00
|
|
|
Set<String> getCommonGroupIds(String userId1, String userId2);
|
2020-08-12 14:58:28 +08:00
|
|
|
ErrorCode getGroupMembers(String fromUser, String groupId, long maxDt, List<WFCMessage.GroupMember> members);
|
2019-07-08 23:08:04 +08:00
|
|
|
WFCMessage.GroupMember getGroupMember(String groupId, String memberId);
|
2019-05-24 21:08:31 +08:00
|
|
|
ErrorCode transferGroup(String operator, String groupId, String newOwner, boolean isAdmin);
|
2019-06-29 11:26:33 +08:00
|
|
|
ErrorCode setGroupManager(String operator, String groupId, int type, List<String> userList, boolean isAdmin);
|
2019-03-16 17:04:23 +08:00
|
|
|
boolean isMemberInGroup(String member, String groupId);
|
2019-06-29 08:27:04 +08:00
|
|
|
ErrorCode canSendMessageInGroup(String member, String groupId);
|
2020-12-10 18:03:41 +08:00
|
|
|
Set<String> getGroupManagers(String groupId, boolean includeOwner);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2023-08-05 10:58:22 +08:00
|
|
|
ErrorCode recallMessage(long messageUid, String operatorId, String clientId, boolean isAdmin, ByteBuf ackPayload);
|
2020-11-11 18:23:08 +08:00
|
|
|
ErrorCode recallCastMessage(long messageUid, String operatorId);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2019-11-30 11:16:48 +08:00
|
|
|
void clearUserMessages(String userId);
|
|
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
WFCMessage.Robot getRobot(String robotId);
|
|
|
|
|
void addRobot(WFCMessage.Robot robot);
|
2021-12-01 09:16:29 +08:00
|
|
|
void destroyRobot(String robotId);
|
2021-01-11 11:56:32 +08:00
|
|
|
|
|
|
|
|
ErrorCode getUserInfo(String fromUser, List<WFCMessage.UserRequest> requestList, WFCMessage.PullUserResult.Builder builder);
|
|
|
|
|
|
2020-01-10 10:25:34 +08:00
|
|
|
ErrorCode modifyUserInfo(String userId, WFCMessage.ModifyMyInfoRequest request) throws Exception;
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2021-12-30 16:47:00 +08:00
|
|
|
void forceCleanOnlineStatus(String userId, String clientId);
|
|
|
|
|
|
2020-04-05 17:18:48 +08:00
|
|
|
void updateUserOnlineSetting(MemorySessionStore.Session session, boolean online);
|
|
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode modifyUserStatus(String userId, int status);
|
|
|
|
|
int getUserStatus(String userId);
|
|
|
|
|
List<InputOutputUserBlockStatus> getUserStatusList();
|
|
|
|
|
|
2021-02-24 15:46:38 +08:00
|
|
|
ErrorCode updateUserInfo(InputOutputUserInfo userInfo, int flag);
|
2024-03-23 11:13:09 +08:00
|
|
|
void addUserInfo(WFCMessage.User user) throws Exception;
|
2022-04-26 19:50:53 +08:00
|
|
|
void destroyUser(String userId);
|
2021-01-16 10:29:03 +08:00
|
|
|
void updateUserInfo(WFCMessage.User user) throws Exception;
|
2019-03-16 17:04:23 +08:00
|
|
|
WFCMessage.User getUserInfo(String userId);
|
|
|
|
|
WFCMessage.User getUserInfoByName(String name);
|
|
|
|
|
WFCMessage.User getUserInfoByMobile(String mobile);
|
2024-03-25 19:00:42 +08:00
|
|
|
List<WFCMessage.User> getUserInfosByEmail(String email);
|
2026-04-10 21:53:24 +08:00
|
|
|
List<WFCMessage.User> getUserInfosByMobile(String mobile, boolean includeDeleted);
|
2025-11-23 13:59:11 +08:00
|
|
|
ErrorCode searchUser(String userId, String keyword, int searchType, int userType, int page, List<WFCMessage.User> users);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2023-06-20 15:14:57 +08:00
|
|
|
List<WFCMessage.User> getUserInfoList(int count, int offset);
|
2026-04-05 11:28:46 +08:00
|
|
|
List<WFCMessage.Robot> getRobotInfoList(int count, int offset);
|
2026-02-02 13:48:04 +08:00
|
|
|
List<String> getUserRobotIds(String userId);
|
2023-06-20 15:14:57 +08:00
|
|
|
|
2019-07-30 07:54:49 +08:00
|
|
|
boolean updateSystemSetting(int id, String value, String desc);
|
|
|
|
|
SystemSettingPojo getSystemSetting(int id);
|
2019-03-16 17:04:23 +08:00
|
|
|
void createChatroom(String chatroomId, WFCMessage.ChatroomInfo chatroomInfo);
|
|
|
|
|
void destoryChatroom(String chatroomId);
|
|
|
|
|
WFCMessage.ChatroomInfo getChatroomInfo(String chatroomId);
|
|
|
|
|
WFCMessage.ChatroomMemberInfo getChatroomMemberInfo(String chatroomId, final int maxMemberCount);
|
|
|
|
|
int getChatroomMemberCount(String chatroomId);
|
|
|
|
|
Collection<String> getChatroomMemberClient(String userId);
|
|
|
|
|
boolean checkUserClientInChatroom(String user, String clientId, String chatroomId);
|
|
|
|
|
|
|
|
|
|
long insertChatroomMessages(String target, int line, long messageId);
|
|
|
|
|
Collection<UserClientEntry> getChatroomMembers(String chatroomId);
|
2023-11-17 09:06:00 +08:00
|
|
|
OutputUserChatroom getUserChatroom(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
WFCMessage.PullMessageResult fetchChatroomMessage(String fromUser, String chatroomId, String exceptClientId, long fromMessageId);
|
|
|
|
|
|
|
|
|
|
ErrorCode verifyToken(String userId, String token, List<String> serverIPs, List<Integer> ports);
|
|
|
|
|
|
2019-11-18 14:47:24 +08:00
|
|
|
List<FriendData> getFriendList(String userId, String clientId, long version);
|
2019-11-30 11:16:48 +08:00
|
|
|
void clearUserFriend(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
List<WFCMessage.FriendRequest> getFriendRequestList(String userId, long version);
|
|
|
|
|
|
2024-09-12 21:34:12 +08:00
|
|
|
ErrorCode saveAddFriendRequest(String userId, WFCMessage.AddFriendRequest request, long[] head, boolean isAdmin, boolean isRobot);
|
2019-05-20 19:51:57 +08:00
|
|
|
ErrorCode handleFriendRequest(String userId, WFCMessage.HandleFriendRequest request, WFCMessage.Message.Builder msgBuilder, long[] heads, boolean isAdmin);
|
2019-07-04 10:19:07 +08:00
|
|
|
ErrorCode deleteFriend(String userId, String friendUid, long[] head);
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode blackUserRequest(String fromUser, String targetUserId, int status, long[] head);
|
2020-02-21 11:19:52 +08:00
|
|
|
FriendData getFriendData(String fromUser, String targetUserId);
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode SyncFriendRequestUnread(String userId, long unreadDt, long[] head);
|
2024-12-06 16:06:04 +08:00
|
|
|
ErrorCode isAllowUserMessage(String fromUser, String userId, int line);
|
2024-09-14 09:53:50 +08:00
|
|
|
ErrorCode isBlacked(String fromUser, String userId);
|
2019-05-02 21:43:01 +08:00
|
|
|
ErrorCode setFriendAliasRequest(String fromUser, String targetUserId, String alias, long[] head);
|
2021-09-01 14:39:59 +08:00
|
|
|
ErrorCode setFriendExtraRequest(String fromUser, String targetUserId, String extra, long[] head);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2025-08-05 17:11:00 +08:00
|
|
|
boolean isAllowName(String name);
|
|
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode handleJoinChatroom(String userId, String clientId, String chatroomId);
|
|
|
|
|
ErrorCode handleQuitChatroom(String userId, String clientId, String chatroomId);
|
|
|
|
|
|
2020-01-05 12:32:35 +08:00
|
|
|
boolean checkChatroomParticipantIdelTime(MemorySessionStore.Session session);
|
|
|
|
|
|
2022-05-02 22:07:54 +08:00
|
|
|
|
2022-05-15 10:19:07 +08:00
|
|
|
String getApplicationAuthCode(String fromUser, String applicationId, int appType, String host);
|
|
|
|
|
String verifyApplicationAuthCode(String token, String applicationId, int type);
|
|
|
|
|
ErrorCode configApplication(String appId, int appType, long timestamp, String nonce, String signature);
|
2022-05-02 22:07:54 +08:00
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode getUserSettings(String userId, long version, WFCMessage.GetUserSettingResult.Builder builder);
|
2019-04-02 22:55:29 +08:00
|
|
|
WFCMessage.UserSettingEntry getUserSetting(String userId, int scope, String key);
|
2019-03-16 17:04:23 +08:00
|
|
|
List<WFCMessage.UserSettingEntry> getUserSetting(String userId, int scope);
|
2021-05-14 09:28:05 +08:00
|
|
|
long updateUserSettings(String userId, WFCMessage.ModifyUserSettingReq request, String clientId);
|
2019-11-30 11:16:48 +08:00
|
|
|
void clearUserSettings(String userId);
|
2026-02-24 10:37:21 +08:00
|
|
|
|
|
|
|
|
boolean isLocked(String userId, String clientId);
|
|
|
|
|
|
2020-10-28 09:51:45 +08:00
|
|
|
boolean getUserGlobalSilent(String userId);
|
2021-09-20 08:12:26 +08:00
|
|
|
boolean getUserVoipSilent(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2019-04-02 22:55:29 +08:00
|
|
|
boolean getUserPushHiddenDetail(String userId);
|
2020-10-28 09:51:45 +08:00
|
|
|
boolean getUserConversationSilent(String userId, WFCMessage.Conversation conversation);
|
2020-10-05 17:24:18 +08:00
|
|
|
boolean getSilentWhenPcOnline(String userId);
|
2020-10-28 09:51:45 +08:00
|
|
|
boolean isUserNoDisturbing(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode createChannel(String operator, WFCMessage.ChannelInfo channelInfo);
|
2019-11-30 11:16:48 +08:00
|
|
|
void clearUserChannels(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode modifyChannelInfo(String operator, String channelId, int modifyType, String value);
|
|
|
|
|
ErrorCode transferChannel(String operator, String channelId, String newOwner);
|
2022-05-02 11:05:56 +08:00
|
|
|
ErrorCode destroyChannel(String operator, String channelId, boolean isAdmin);
|
2019-03-16 17:04:23 +08:00
|
|
|
List<WFCMessage.ChannelInfo> searchChannel(String keyword, boolean buzzy, int page);
|
2023-07-20 21:07:58 +08:00
|
|
|
List<String> getListenedChannels(String userId);
|
2019-03-16 17:04:23 +08:00
|
|
|
ErrorCode listenChannel(String operator, String channelId, boolean listen);
|
|
|
|
|
WFCMessage.ChannelInfo getChannelInfo(String channelId);
|
2021-12-24 22:14:04 +08:00
|
|
|
boolean canSendMessageInChannel(String user, String channelId);
|
2019-03-16 17:04:23 +08:00
|
|
|
boolean checkUserInChannel(String user, String channelId);
|
2020-03-01 14:45:44 +08:00
|
|
|
Collection<String> getChannelSubscriber(String channelId);
|
2019-03-16 17:04:23 +08:00
|
|
|
|
2023-11-28 11:04:12 +08:00
|
|
|
int getOnlineUserCount();
|
|
|
|
|
GetOnlineUserResult getOnlineUsers(int offset, int count);
|
|
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
Set<String> handleSensitiveWord(String message);
|
|
|
|
|
boolean addSensitiveWords(List<String> words);
|
|
|
|
|
boolean removeSensitiveWords(List<String> words);
|
|
|
|
|
List<String> getAllSensitiveWords();
|
2025-08-05 15:32:20 +08:00
|
|
|
boolean isSensitiveOnlyMessage();
|
2019-03-16 17:04:23 +08:00
|
|
|
|
|
|
|
|
WFCMessage.Message getMessage(long messageId);
|
2020-12-02 15:32:46 +08:00
|
|
|
|
2025-07-29 11:51:11 +08:00
|
|
|
void increaseUnreceivedMsgCount(String user);
|
|
|
|
|
int getUnreceivedMsgCount(String user);
|
|
|
|
|
|
2020-12-02 15:32:46 +08:00
|
|
|
boolean isAllowClientCustomGroupNotification();
|
2021-12-07 13:46:14 +08:00
|
|
|
boolean isAllowRobotCustomGroupNotification();
|
2020-12-10 18:03:41 +08:00
|
|
|
int getVisibleQuitKickoffNotification();
|
|
|
|
|
|
2022-11-26 22:21:43 +08:00
|
|
|
int getGroupForbiddenClientOperation();
|
|
|
|
|
|
2022-07-27 11:36:04 +08:00
|
|
|
boolean isForwardMessageWithClientInfo();
|
2025-03-27 20:52:12 +08:00
|
|
|
boolean isForwardMessageWithSenderInfo();
|
|
|
|
|
boolean isForwardMessageWithTargetInfo();
|
|
|
|
|
|
2022-07-27 11:36:04 +08:00
|
|
|
boolean isRobotCallbackWithClientInfo();
|
2025-03-27 20:52:12 +08:00
|
|
|
boolean isRobotCallbackWithSenderInfo();
|
|
|
|
|
boolean isRobotCallbackWithTargetInfo();
|
2025-09-06 23:29:09 +08:00
|
|
|
boolean isRobotMentionExternalRobot();
|
2026-02-03 11:24:28 +08:00
|
|
|
int getRobotGetUserInfoMask();
|
2025-03-27 20:52:12 +08:00
|
|
|
|
2022-07-27 11:36:04 +08:00
|
|
|
boolean isChannelCallbackWithClientInfo();
|
2025-03-27 20:52:12 +08:00
|
|
|
boolean isChannelCallbackWithSenderInfo();
|
|
|
|
|
boolean isChannelCallbackWithTargetInfo();
|
2024-05-29 16:30:54 +08:00
|
|
|
boolean isChannelNewCallbackFeature();
|
2025-07-05 16:47:15 +08:00
|
|
|
boolean isGroupAllowPartSuccess();
|
2023-05-04 21:39:45 +08:00
|
|
|
boolean isRobotAutoAcceptFriendRequest();
|
|
|
|
|
|
2023-09-13 11:16:54 +08:00
|
|
|
long getPushExpiredTimes();
|
2024-04-03 10:49:28 +08:00
|
|
|
Set<Integer> getForcePushTypes();
|
2023-09-13 11:16:54 +08:00
|
|
|
|
2020-12-02 15:38:16 +08:00
|
|
|
List<Integer> getClientForbiddenSendTypes();
|
2021-03-19 14:33:17 +08:00
|
|
|
List<Integer> getBlackListExceptionTypes();
|
|
|
|
|
List<Integer> getGroupMuteExceptionTypes();
|
|
|
|
|
List<Integer> getGlobalMuteExceptionTypes();
|
2020-12-02 15:32:46 +08:00
|
|
|
|
2019-03-16 17:04:23 +08:00
|
|
|
long getMessageHead(String user);
|
|
|
|
|
long getFriendHead(String user);
|
|
|
|
|
long getFriendRqHead(String user);
|
|
|
|
|
long getSettingHead(String user);
|
|
|
|
|
|
|
|
|
|
//使用了数据库,会比较慢,仅能用户用户/群组等id的生成
|
|
|
|
|
String getShortUUID();
|
2022-11-18 16:01:17 +08:00
|
|
|
|
|
|
|
|
boolean checkSignature(String signature);
|
2022-11-18 22:10:53 +08:00
|
|
|
boolean existSignatures();
|
2019-03-16 17:04:23 +08:00
|
|
|
/**
|
|
|
|
|
* Used to initialize all persistent store structures
|
|
|
|
|
*/
|
|
|
|
|
void initStore();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a list of retained messages that satisfy the condition.
|
|
|
|
|
*
|
|
|
|
|
* @param condition
|
|
|
|
|
* the condition to match during the search.
|
|
|
|
|
* @return the collection of matching messages.
|
|
|
|
|
*/
|
|
|
|
|
Collection<StoredMessage> searchMatching(IMatchingCondition condition);
|
|
|
|
|
|
|
|
|
|
void cleanRetained(Topic topic);
|
|
|
|
|
|
|
|
|
|
void storeRetained(Topic topic, StoredMessage storedMessage);
|
|
|
|
|
}
|