Source Code Cross Referenced for PacketInterceptor.java in  » Net » openfire » org » jivesoftware » openfire » interceptor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » openfire » org.jivesoftware.openfire.interceptor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /**
02:         * $RCSfile: PacketInterceptor.java,v $
03:         * $Revision: 3010 $
04:         * $Date: 2005-10-31 20:28:11 -0300 (Mon, 31 Oct 2005) $
05:         *
06:         * Copyright (C) 2007 Jive Software. All rights reserved.
07:         *
08:         * This software is published under the terms of the GNU Public License (GPL),
09:         * a copy of which is included in this distribution.
10:         */package org.jivesoftware.openfire.interceptor;
11:
12:        import org.jivesoftware.openfire.session.Session;
13:        import org.xmpp.packet.Packet;
14:
15:        /**
16:         * A packet interceptor encapsulates an action that is invoked on a packet immediately
17:         * before or after it was received by a SocketReader and also when the packet is about to
18:         * be sent in SocketConnection. These types of actions fall into two broad categories:<ul>
19:         *      <li> Interceptors that reject the packet by throwing an exception (only when the packet
20:         *            has not been processed yet).
21:         *      <li> Interceptors that dynamically transform the packet content.
22:         * </ul>
23:         *
24:         * Any number of interceptors can be installed and removed at run-time. They can be installed
25:         * globally or per-user. Global interceptors are run first, followed by any that are installed
26:         * for the username.<p>
27:         *
28:         * @see InterceptorManager
29:         * @author Gaston Dombiak
30:         */
31:        public interface PacketInterceptor {
32:
33:            /**
34:             * Invokes the interceptor on the specified packet. The interceptor can either modify
35:             * the packet, or throw a PacketRejectedException to block it from being sent or processed
36:             * (when read).<p>
37:             *
38:             * An exception can only be thrown when <tt>processed</tt> is false which means that the read
39:             * packet has not been processed yet or the packet was not sent yet. If the exception is thrown
40:             * with a "read" packet then the sender of the packet will receive an answer with an error. But
41:             * if the exception is thrown with a "sent" packet then nothing will happen.<p>
42:             *
43:             * Note that for each packet, every interceptor will be called twice: once before processing
44:             * is complete (<tt>processing==true</tt>) and once after processing is complete. Typically,
45:             * an interceptor will want to ignore one or the other case.
46:             *
47:             * @param packet the packet to take action on.
48:             * @param session the session that received or is sending the packet.
49:             * @param incoming flag that indicates if the packet was read by the server or sent from
50:             *      the server.
51:             * @param processed flag that indicates if the action (read/send) was performed. (PRE vs. POST).
52:             * @throws PacketRejectedException if the packet should be prevented from being processed.
53:             */
54:            void interceptPacket(Packet packet, Session session,
55:                    boolean incoming, boolean processed)
56:                    throws PacketRejectedException;
57:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.