Processing mechanism of OpenFire offline messages

Source: Internet
Author: User
Tags call back event listener

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.