Presence information, some of the most important parts are state information, such as online, Busy,away,offline, and so on. In the study of this part of the time, if the first presence information mode has some understanding, then in-depth study of this part of the content has a great help.
This model defines three roles: Presentity, Presence Server, watcher.
Presentity: Is the user agent that publishes the presence information, usually a client. It should be noted that, according to my understanding, in the same machine with the same client on the same account, or on different machines with the same client account, the two cases of two presentity.
Presence server: An agent used to receive, store, and distribute Presence information, typically a server with this function, such as OCP.
Watcher: An agent that requests an account's presence information to presence server.
Presentity Change state, a publish request with the associated presence information is sent to presence Server;presense server replaces the changed state value with the corresponding value, and according to the observer information for the account , construct a notify request with the latest presence information to receive and extract the associated presence information value for each authorized Watcher;watcher to replace the original value. So that the Presentity status is displayed correctly.
PS: Here, to emphasize that, for presence information, usually in the form of XML, each prsentity only corresponds to a tuple,tuple ID value is unique. If you log on to the same account on the same computer or on a different computer, there should be more than one tuple value in the XML of the account, and the value in the person node corresponds to the prensentity that was logged in at the latest.