Class PresenceEnhancer
java.lang.Object
org.jivesoftware.openfire.vcard.xep0398.PresenceEnhancer
- All Implemented Interfaces:
PacketInterceptor
Packet Interceptor that augments presence stanzas sent by uses, as defined in section 4 of XEP-0398.
- Author:
- Guus der Kinderen, guus@goodbytes.nl
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinterceptPacket(org.xmpp.packet.Packet packet, Session session, boolean incoming, boolean processed) Invokes the interceptor on the specified packet.
-
Constructor Details
-
PresenceEnhancer
public PresenceEnhancer()
-
-
Method Details
-
interceptPacket
public void interceptPacket(org.xmpp.packet.Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException Description copied from interface:PacketInterceptorInvokes the interceptor on the specified packet. The interceptor can either modify the packet, or throw a PacketRejectedException to block it from being sent or processed (when read).An exception can only be thrown when
processedis false which means that the read packet has not been processed yet or the packet was not sent yet. If the exception is thrown with a "read" packet then the sender of the packet will receive an answer with an error. But if the exception is thrown with a "sent" packet then nothing will happen.Note that for each packet, every interceptor will be called twice: once before processing is complete (
processing==true) and once after processing is complete. Typically, an interceptor will want to ignore one or the other case.- Specified by:
interceptPacketin interfacePacketInterceptor- Parameters:
packet- the packet to take action on.session- the session that received or is sending the packet.incoming- flag that indicates if the packet was read by the server or sent from the server.processed- flag that indicates if the action (read/send) was performed. (PRE vs. POST).- Throws:
PacketRejectedException- if the packet should be prevented from being processed.
-