Offlinemessagetrategy:
The processing policy class for offline messages.
1. Static member variable type is used to set the processing type of the message, mainly including:
Call back
Discarded
Storage, call back in the case of overrun
Storage, discarded in the case of overrun
2. Static member variable quota identifies the maximum amount of message total that can be stored by default of 100k.
3. Support Offlinemessagelistener event listener, so long as this interface is implemented and added to the listener list, the message can be caught when it is called back or stored.
4. All offline messages are stored in the table Ofoffline. Offlinemessagestore:
Class that is used to specifically process offline messages.
1. Use AddMessage (Message message) to store a message.
2. Use Getmessages (String Username,boolean Delete) to provide all offline messages for the specified user. The Delete parameter specifies whether to delete from the database after the extraction.
3. Use DeleteMessages (String username) to delete all offline messages for a user.
4. This class implements the Usereventlistener interface and drops the Deletemessage () to remove all offline messages for this user when the user is deleted. storage time for offline messages:
1.routingFailed () in the event that message routing fails. For example, the destination user is not online.
2. Messages forwarded over by Connectonmanager cannot be routed or cannot be processed. time to extract offline messages:
1. The user status becomes available when the session is initialized. such as users on-line.
2. The user sends a specific IQ message that requires delivery of the offline messages that they send.
3. The user's session permission level has changed.