Im developing an plugin for openfire and i need to send a presence to all resource of a JID

im developing an plugin for openfire and i need to send a presence to all resource (local or remote in cluster) of a JID.

how can i do this?

Can I even add something small:
If I want to synchronize all of the presence’s resources for a JID, how can I update a resource which is in state “offline”.

(for other situations it’s not complicated)