|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PacketInterceptor
A packet interceptor encapsulates an action that is invoked on a packet immediately before or after it was received by a SocketReader and also when the packet is about to be sent in SocketConnection. These types of actions fall into two broad categories:
InterceptorManager
Method Summary | |
---|---|
void |
interceptPacket(Packet packet,
Session session,
boolean read,
boolean processed)
Invokes the interceptor on the specified packet. |
Method Detail |
---|
void interceptPacket(Packet packet, Session session, boolean read, boolean processed) throws PacketRejectedException
The exception can only be thrown when processed is 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.
packet
- the packet to take action on.session
- the session that received or is sending the packet.read
- flag that indicates if the packet was read or sent.processed
- flag that indicates if the action (read/send) was performed. (PRE vs. POST).
PacketRejectedException
- if the packet should be prevented from being processed.
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |