PageRenderTime 74ms CodeModel.GetById 35ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/quickserver-1.4.7/docs/org/quickserver/net/server/ClientExtendedEventHandler.html

https://gitlab.com/essere.lab.public/qualitas.class-corpus
HTML | 326 lines | 255 code | 46 blank | 25 comment | 0 complexity | beda326d8106a0d9bce85234f9780b55 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.4.2_09) on Wed Mar 01 21:02:08 GMT+05:30 2006 -->
  6. <TITLE>
  7. ClientExtendedEventHandler (QuickServer v1.4.7 API Specification)
  8. </TITLE>
  9. <META NAME="keywords" CONTENT="org.quickserver.net.server.ClientExtendedEventHandler interface">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. parent.document.title="ClientExtendedEventHandler (QuickServer v1.4.7 API Specification)";
  15. }
  16. </SCRIPT>
  17. </HEAD>
  18. <BODY BGCOLOR="white" onload="windowTitle();">
  19. <!-- ========= START OF TOP NAVBAR ======= -->
  20. <A NAME="navbar_top"><!-- --></A>
  21. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  22. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  23. <TR>
  24. <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  25. <A NAME="navbar_top_firstrow"><!-- --></A>
  26. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  27. <TR ALIGN="center" VALIGN="top">
  28. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  29. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  30. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  31. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClientExtendedEventHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  32. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  35. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  36. </TR>
  37. </TABLE>
  38. </TD>
  39. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  40. <b>QuickServer</b><br><font size="-1">v1.4.7</font></EM>
  41. </TD>
  42. </TR>
  43. <TR>
  44. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  45. &nbsp;<A HREF="../../../../org/quickserver/net/server/ClientEventHandler.html" title="interface in org.quickserver.net.server"><B>PREV CLASS</B></A>&nbsp;
  46. &nbsp;<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server"><B>NEXT CLASS</B></A></FONT></TD>
  47. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  48. <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
  49. &nbsp;<A HREF="ClientExtendedEventHandler.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  50. &nbsp;<SCRIPT type="text/javascript">
  51. <!--
  52. if(window==top) {
  53. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  54. }
  55. //-->
  56. </SCRIPT>
  57. <NOSCRIPT>
  58. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  59. </NOSCRIPT>
  60. </FONT></TD>
  61. </TR>
  62. <TR>
  63. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  64. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  65. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  66. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  67. </TR>
  68. </TABLE>
  69. <A NAME="skip-navbar_top"></A>
  70. <!-- ========= END OF TOP NAVBAR ========= -->
  71. <HR>
  72. <!-- ======== START OF CLASS DATA ======== -->
  73. <H2>
  74. <FONT SIZE="-1">
  75. org.quickserver.net.server</FONT>
  76. <BR>
  77. Interface ClientExtendedEventHandler</H2>
  78. <HR>
  79. <DL>
  80. <DT>public interface <B>ClientExtendedEventHandler</B></DL>
  81. <P>
  82. This interface defines the methods that should be implemented by any
  83. class that wants to handle extended client events.
  84. <p>
  85. Recommendations to be followed when implementing ClientExtendedEventHandler
  86. <ul>
  87. <li>Should have a default constructor.
  88. <li>Should be thread safe.
  89. <li>It should not store any data that may is associated with a particular client.
  90. <li>If any client data is need to be saved from the client session,
  91. it should be saved to a <A HREF="../../../../org/quickserver/net/server/ClientData.html" title="interface in org.quickserver.net.server"><CODE>ClientData</CODE></A> class, which can be retrieved
  92. using handler.getClientData() method.
  93. </ul>
  94. </p>
  95. <p>
  96. Ex:
  97. <code><BLOCKQUOTE><pre>
  98. package echoserver;
  99. import java.net.*;
  100. import java.io.*;
  101. import org.quickserver.net.server.ClientExtendedEventHandler;
  102. import org.quickserver.net.server.ClientHandler;
  103. public class EchoExtendedEventHandler implements ClientExtendedEventHandler {
  104. public void handleTimeout(ClientHandler handler)
  105. throws SocketException, IOException {
  106. handler.sendClientMsg("-ERR Timeout");
  107. if(true) throw new SocketException();
  108. }
  109. public void handleMaxAuthTry(ClientHandler handler) throws IOException {
  110. handler.sendClientMsg("-ERR Max Auth Try Reached");
  111. }
  112. public boolean handleMaxConnection(ClientHandler handler) throws IOException {
  113. //for now lets reject all excess clients
  114. if(true) {
  115. handler.sendClientMsg("Server Busy - Max Connection Reached");
  116. return false;
  117. }
  118. }
  119. }
  120. </pre></BLOCKQUOTE></code></p>
  121. <P>
  122. <P>
  123. <DL>
  124. <DT><B>Since:</B></DT>
  125. <DD>1.4.6</DD>
  126. <DT><B>Author:</B></DT>
  127. <DD>Akshathkumar Shetty</DD>
  128. </DL>
  129. <HR>
  130. <P>
  131. <!-- ======== NESTED CLASS SUMMARY ======== -->
  132. <!-- =========== FIELD SUMMARY =========== -->
  133. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  134. <!-- ========== METHOD SUMMARY =========== -->
  135. <A NAME="method_summary"><!-- --></A>
  136. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  137. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  138. <TD COLSPAN=2><FONT SIZE="+2">
  139. <B>Method Summary</B></FONT></TD>
  140. </TR>
  141. <TR BGCOLOR="white" CLASS="TableRowColor">
  142. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  143. <CODE>&nbsp;void</CODE></FONT></TD>
  144. <TD><CODE><B><A HREF="../../../../org/quickserver/net/server/ClientExtendedEventHandler.html#handleMaxAuthTry(org.quickserver.net.server.ClientHandler)">handleMaxAuthTry</A></B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)</CODE>
  145. <BR>
  146. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when client has reached maximum auth tries.</TD>
  147. </TR>
  148. <TR BGCOLOR="white" CLASS="TableRowColor">
  149. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  150. <CODE>&nbsp;boolean</CODE></FONT></TD>
  151. <TD><CODE><B><A HREF="../../../../org/quickserver/net/server/ClientExtendedEventHandler.html#handleMaxConnection(org.quickserver.net.server.ClientHandler)">handleMaxConnection</A></B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)</CODE>
  152. <BR>
  153. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when maximum number of clients has been reached and
  154. a new client connects.</TD>
  155. </TR>
  156. <TR BGCOLOR="white" CLASS="TableRowColor">
  157. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  158. <CODE>&nbsp;void</CODE></FONT></TD>
  159. <TD><CODE><B><A HREF="../../../../org/quickserver/net/server/ClientExtendedEventHandler.html#handleTimeout(org.quickserver.net.server.ClientHandler)">handleTimeout</A></B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)</CODE>
  160. <BR>
  161. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when client timeouts.</TD>
  162. </TR>
  163. </TABLE>
  164. &nbsp;
  165. <P>
  166. <!-- ============ FIELD DETAIL =========== -->
  167. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  168. <!-- ============ METHOD DETAIL ========== -->
  169. <A NAME="method_detail"><!-- --></A>
  170. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  171. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  172. <TD COLSPAN=1><FONT SIZE="+2">
  173. <B>Method Detail</B></FONT></TD>
  174. </TR>
  175. </TABLE>
  176. <A NAME="handleTimeout(org.quickserver.net.server.ClientHandler)"><!-- --></A><H3>
  177. handleTimeout</H3>
  178. <PRE>
  179. public void <B>handleTimeout</B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)
  180. throws java.net.SocketException,
  181. java.io.IOException</PRE>
  182. <DL>
  183. <DD>Method called when client timeouts.
  184. <P>
  185. <DD><DL>
  186. <DT><B>Throws:</B>
  187. <DD><CODE>java.net.SocketException</CODE> - if client socket needs to be closed.
  188. <DD><CODE>java.io.IOException</CODE> - if io error in socket</DL>
  189. </DD>
  190. </DL>
  191. <HR>
  192. <A NAME="handleMaxAuthTry(org.quickserver.net.server.ClientHandler)"><!-- --></A><H3>
  193. handleMaxAuthTry</H3>
  194. <PRE>
  195. public void <B>handleMaxAuthTry</B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)
  196. throws java.io.IOException</PRE>
  197. <DL>
  198. <DD>Method called when client has reached maximum auth tries.
  199. After this method call QuickServer will close the clients socket.
  200. Should be used to give error information to the client.
  201. <P>
  202. <DD><DL>
  203. <DT><B>Throws:</B>
  204. <DD><CODE>java.io.IOException</CODE> - if io error in socket</DL>
  205. </DD>
  206. </DL>
  207. <HR>
  208. <A NAME="handleMaxConnection(org.quickserver.net.server.ClientHandler)"><!-- --></A><H3>
  209. handleMaxConnection</H3>
  210. <PRE>
  211. public boolean <B>handleMaxConnection</B>(<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server">ClientHandler</A>&nbsp;handler)
  212. throws java.io.IOException</PRE>
  213. <DL>
  214. <DD>Method called when maximum number of clients has been reached and
  215. a new client connects. If this method return <code>true</code> the
  216. client is accepted else client connection is closed.
  217. <P>
  218. <DD><DL>
  219. <DT><B>Throws:</B>
  220. <DD><CODE>java.io.IOException</CODE> - if io error in socket</DL>
  221. </DD>
  222. </DL>
  223. <!-- ========= END OF CLASS DATA ========= -->
  224. <HR>
  225. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  226. <A NAME="navbar_bottom"><!-- --></A>
  227. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  228. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  229. <TR>
  230. <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  231. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  232. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  233. <TR ALIGN="center" VALIGN="top">
  234. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  235. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  236. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  237. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClientExtendedEventHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  238. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  239. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  240. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  241. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  242. </TR>
  243. </TABLE>
  244. </TD>
  245. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  246. <b>QuickServer</b><br><font size="-1">v1.4.7</font></EM>
  247. </TD>
  248. </TR>
  249. <TR>
  250. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  251. &nbsp;<A HREF="../../../../org/quickserver/net/server/ClientEventHandler.html" title="interface in org.quickserver.net.server"><B>PREV CLASS</B></A>&nbsp;
  252. &nbsp;<A HREF="../../../../org/quickserver/net/server/ClientHandler.html" title="interface in org.quickserver.net.server"><B>NEXT CLASS</B></A></FONT></TD>
  253. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  254. <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
  255. &nbsp;<A HREF="ClientExtendedEventHandler.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  256. &nbsp;<SCRIPT type="text/javascript">
  257. <!--
  258. if(window==top) {
  259. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  260. }
  261. //-->
  262. </SCRIPT>
  263. <NOSCRIPT>
  264. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  265. </NOSCRIPT>
  266. </FONT></TD>
  267. </TR>
  268. <TR>
  269. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  270. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  271. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  272. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  273. </TR>
  274. </TABLE>
  275. <A NAME="skip-navbar_bottom"></A>
  276. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  277. <HR>
  278. Copyright &copy; 2003-2006 QuickServer.org
  279. </BODY>
  280. </HTML>