Class DirectedPresence
- java.lang.Object
-
- org.jivesoftware.openfire.handler.DirectedPresence
-
- All Implemented Interfaces:
Externalizable,Serializable,Cacheable
public class DirectedPresence extends Object implements Externalizable, Cacheable
Represents a directed presence sent from a session hosted in a cluster node to another entity (e.g. user or MUC service) hosted in some other cluster node.This information needs to be shared by all cluster nodes so that if a cluster node goes down then directed presences can be correctly cleaned up.
Note that an instance of this class will be created and kept in the clustered cache only when entities hosted by different cluster nodes are involved.
- Author:
- Gaston Dombiak
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectedPresence()DirectedPresence(org.xmpp.packet.JID handlerJID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReceiver(String receiver)intgetCachedSize()Returns the approximate size of the Object in bytes.org.xmpp.packet.JIDgetHandler()byte[]getNodeID()Set<String>getReceivers()booleanisEmpty()voidreadExternal(ObjectInput in)voidremoveReceiver(String receiver)StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Method Detail
-
getNodeID
public byte[] getNodeID()
-
getHandler
public org.xmpp.packet.JID getHandler()
-
addReceiver
public void addReceiver(String receiver)
-
removeReceiver
public void removeReceiver(String receiver)
-
isEmpty
public boolean isEmpty()
-
getCachedSize
public int getCachedSize() throws CannotCalculateSizeExceptionDescription copied from interface:CacheableReturns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.- Specified by:
getCachedSizein interfaceCacheable- Returns:
- the size of the Object in bytes.
- Throws:
CannotCalculateSizeException- if the size cannot be calculated
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-