📄 interceptormanager.html
字号:
<!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="InterceptorManager()"><!-- --></A><H3>InterceptorManager</H3><PRE>public <B>InterceptorManager</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getInstance()"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../../org/jivesoftware/openfire/interceptor/InterceptorManager.html" title="class in org.jivesoftware.openfire.interceptor">InterceptorManager</A> <B>getInstance</B>()</PRE><DL><DD>Returns a singleton instance of InterceptorManager.<P><DD><DL><DT><B>Returns:</B><DD>an instance of InterceptorManager.</DL></DD></DL><HR><A NAME="getInterceptors()"><!-- --></A><H3>getInterceptors</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A>> <B>getInterceptors</B>()</PRE><DL><DD>Returns an unmodifiable list of global packet interceptors. Global interceptors are applied to all packets read and sent by the server.<P><DD><DL><DT><B>Returns:</B><DD>an unmodifiable list of the global packet interceptors.</DL></DD></DL><HR><A NAME="addInterceptor(org.jivesoftware.openfire.interceptor.PacketInterceptor)"><!-- --></A><H3>addInterceptor</H3><PRE>public void <B>addInterceptor</B>(<A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A> interceptor)</PRE><DL><DD>Inserts a new interceptor at the end of the list of currently configured interceptors. This interceptor will be used for all the sent and received packets.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>interceptor</CODE> - the interceptor to add.</DL></DD></DL><HR><A NAME="addInterceptor(int, org.jivesoftware.openfire.interceptor.PacketInterceptor)"><!-- --></A><H3>addInterceptor</H3><PRE>public void <B>addInterceptor</B>(int index, <A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A> interceptor)</PRE><DL><DD>Inserts a new interceptor at specified index in the list of currently configured interceptors. This interceptor will be used for all the sent and received packets.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index in the list to insert the new interceptor at.<DD><CODE>interceptor</CODE> - the interceptor to add.</DL></DD></DL><HR><A NAME="removeInterceptor(org.jivesoftware.openfire.interceptor.PacketInterceptor)"><!-- --></A><H3>removeInterceptor</H3><PRE>public boolean <B>removeInterceptor</B>(<A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A> interceptor)</PRE><DL><DD>Removes the global interceptor from the list.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>interceptor</CODE> - the interceptor to remove.<DT><B>Returns:</B><DD>true if the item was present in the list</DL></DD></DL><HR><A NAME="getUserInterceptors(java.lang.String)"><!-- --></A><H3>getUserInterceptors</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A>> <B>getUserInterceptors</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> username)</PRE><DL><DD>Returns an unmodifable list of packet interceptors that are related to the specified username.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the name of the user.<DT><B>Returns:</B><DD>an unmodifiable list of packet interceptors that are related to the specified username.</DL></DD></DL><HR><A NAME="addUserInterceptor(java.lang.String, int, org.jivesoftware.openfire.interceptor.PacketInterceptor)"><!-- --></A><H3>addUserInterceptor</H3><PRE>public void <B>addUserInterceptor</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> username, int index, <A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A> interceptor)</PRE><DL><DD>Inserts a new interceptor at specified index in the list of currently configured interceptors for a specific username. This interceptor will be used only when a packet was sent or received by the specified username.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the name of the user.<DD><CODE>index</CODE> - the index in the list to insert the new interceptor at.<DD><CODE>interceptor</CODE> - the interceptor to add.</DL></DD></DL><HR><A NAME="removeUserInterceptor(java.lang.String, org.jivesoftware.openfire.interceptor.PacketInterceptor)"><!-- --></A><H3>removeUserInterceptor</H3><PRE>public boolean <B>removeUserInterceptor</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> username, <A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketInterceptor.html" title="interface in org.jivesoftware.openfire.interceptor">PacketInterceptor</A> interceptor)</PRE><DL><DD>Removes the interceptor from the list of interceptors that are related to a specific username.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the name of the user.<DD><CODE>interceptor</CODE> - the interceptor to remove.<DT><B>Returns:</B><DD>true if the item was present in the list</DL></DD></DL><HR><A NAME="invokeInterceptors(org.xmpp.packet.Packet, org.jivesoftware.openfire.session.Session, boolean, boolean)"><!-- --></A><H3>invokeInterceptors</H3><PRE>public void <B>invokeInterceptors</B>(<A HREF="../../../../org/xmpp/packet/Packet.html" title="class in org.xmpp.packet">Packet</A> packet, <A HREF="../../../../org/jivesoftware/openfire/session/Session.html" title="interface in org.jivesoftware.openfire.session">Session</A> session, boolean read, boolean processed) throws <A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketRejectedException.html" title="class in org.jivesoftware.openfire.interceptor">PacketRejectedException</A></PRE><DL><DD>Invokes all currently-installed interceptors on the specified packet. All global interceptors will be invoked as well as interceptors that are related to the address of the session that received or is sending the packet.<p> Interceptors are executed before and after processing an incoming packet and sending a packet to a user. This means that interceptors are able to alter or reject packets before they are processed further. If possible, interceptors should perform their work in a short time so that overall performance is not compromised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packet</CODE> - the packet that has been read or is about to be sent.<DD><CODE>session</CODE> - the session that received the packet or that the packet will be sent to.<DD><CODE>read</CODE> - true indicates that the packet was read. When false, the packet is being sent to a user.<DD><CODE>processed</CODE> - true if the packet has already processed (incoming or outgoing). If the packet hasn't already been processed, this flag will be false.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketRejectedException.html" title="class in org.jivesoftware.openfire.interceptor">PacketRejectedException</A></CODE> - if the packet should be prevented from being processed.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../org/jivesoftware/openfire/interceptor/PacketCopier.html" title="class in org.jivesoftware.openfire.interceptor"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/jivesoftware/openfire/interceptor/InterceptorManager.html" target="_top"><B>FRAMES</B></A> <A HREF="InterceptorManager.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2008 Jive Software.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -