Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AC839E91 for ; Thu, 5 Apr 2012 23:59:28 +0000 (UTC) Received: (qmail 38545 invoked by uid 500); 5 Apr 2012 23:59:27 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 38477 invoked by uid 500); 5 Apr 2012 23:59:27 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 38468 invoked by uid 99); 5 Apr 2012 23:59:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2012 23:59:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2012 23:59:22 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6F47B23889E3 for ; Thu, 5 Apr 2012 23:59:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1310133 [3/12] - in /tomcat/site/trunk/docs/tomcat-7.0-doc: ./ api/org/apache/catalina/realm/ api/org/apache/catalina/util/ api/org/apache/catalina/websocket/ api/org/apache/coyote/http11/upgrade/ api/org/apache/tomcat/jdbc/pool/ api/org/a... Date: Thu, 05 Apr 2012 23:58:59 -0000 To: dev@tomcat.apache.org From: kkolinko@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120405235902.6F47B23889E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WebSocketServlet.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WebSocketServlet.html?rev=1310133&view=auto ============================================================================== --- tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WebSocketServlet.html (added) +++ tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WebSocketServlet.html Thu Apr 5 23:58:58 2012 @@ -0,0 +1,462 @@ + + + + + + +WebSocketServlet (Apache Tomcat 7.0.27 API Documentation) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+ +

+ +org.apache.catalina.websocket +
+Class WebSocketServlet

+
+java.lang.Object
+  extended by javax.servlet.GenericServlet
+      extended by javax.servlet.http.HttpServlet
+          extended by org.apache.catalina.websocket.WebSocketServlet
+
+
+
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
+
+
+
+
public abstract class WebSocketServlet
extends HttpServlet
+ + +

+Provides the base implementation of a Servlet for processing WebSocket + connections as per RFC6455. It is expected that applications will extend this + implementation and provide application specific functionality. +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
WebSocketServlet() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+protected abstract  StreamInboundcreateWebSocketInbound(String subProtocol) + +
+          Create the instance that will process this inbound connection.
+protected  voiddoGet(HttpServletRequest req, + HttpServletResponse resp) + +
+          Called by the server (via the service method) to + allow a servlet to handle a GET request.
+ voidinit() + +
+          A convenience method which can be overridden so that there's no need to + call super.init(config).
+protected  StringselectSubProtocol(List<String> subProtocols) + +
+          Intended to be overridden by sub-classes that wish to select a + sub-protocol if the client provides a list of supported protocols.
+protected  booleanverifyOrigin(String origin) + +
+          Intended to be overridden by sub-classes that wish to verify the origin + of a WebSocket request before processing it.
+ + + + + + + +
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
+ + + + + + + +
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+WebSocketServlet

+
+public WebSocketServlet()
+
+
+ + + + + + + + +
+Method Detail
+ +

+init

+
+public void init()
+          throws ServletException
+
+
Description copied from class: javax.servlet.GenericServlet
+
A convenience method which can be overridden so that there's no need to + call super.init(config). +

+ Instead of overriding GenericServlet.init(ServletConfig), simply override this + method and it will be called by + GenericServlet.init(ServletConfig config). The + ServletConfig object can still be retrieved via + GenericServlet.getServletConfig(). +

+

+
Overrides:
init in class GenericServlet
+
+
+ +
Throws: +
ServletException - if an exception occurs that interrupts the servlet's + normal operation
+
+
+
+ +

+doGet

+
+protected void doGet(HttpServletRequest req,
+                     HttpServletResponse resp)
+              throws ServletException,
+                     IOException
+
+
Description copied from class: javax.servlet.http.HttpServlet
+
Called by the server (via the service method) to + allow a servlet to handle a GET request. + +

Overriding this method to support a GET request also + automatically supports an HTTP HEAD request. A HEAD + request is a GET request that returns no body in the + response, only the request header fields. + +

When overriding this method, read the request data, + write the response headers, get the response's writer or + output stream object, and finally, write the response data. + It's best to include content type and encoding. When using + a PrintWriter object to return the response, + set the content type before accessing the + PrintWriter object. + +

The servlet container must write the headers before + committing the response, because in HTTP the headers must be sent + before the response body. + +

Where possible, set the Content-Length header (with the + ServletResponse.setContentLength(int) method), + to allow the servlet container to use a persistent connection + to return its response to the client, improving performance. + The content length is automatically set if the entire response fits + inside the response buffer. + +

When using HTTP 1.1 chunked encoding (which means that the response + has a Transfer-Encoding header), do not set the Content-Length header. + +

The GET method should be safe, that is, without + any side effects for which users are held responsible. + For example, most form queries have no side effects. + If a client request is intended to change stored data, + the request should use some other HTTP method. + +

The GET method should also be idempotent, meaning + that it can be safely repeated. Sometimes making a + method safe also makes it idempotent. For example, + repeating queries is both safe and idempotent, but + buying a product online or modifying data is neither + safe nor idempotent. + +

If the request is incorrectly formatted, doGet + returns an HTTP "Bad Request" message. +

+

+
Overrides:
doGet in class HttpServlet
+
+
+
Parameters:
req - an HttpServletRequest object that + contains the request the client has made + of the servlet
resp - an HttpServletResponse object that + contains the response the servlet sends + to the client +
Throws: +
ServletException - if the request for the GET + could not be handled +
IOException - if an input or output error is + detected when the servlet handles + the GET request
See Also:
ServletResponse.setContentType(java.lang.String)
+
+
+
+ +

+verifyOrigin

+
+protected boolean verifyOrigin(String origin)
+
+
Intended to be overridden by sub-classes that wish to verify the origin + of a WebSocket request before processing it. +

+

+
Parameters:
origin - The value of the origin header from the request which + may be null +
Returns:
true to accept the request. false to + reject it. This default implementation always returns + true.
+
+
+
+ +

+selectSubProtocol

+
+protected String selectSubProtocol(List<String> subProtocols)
+
+
Intended to be overridden by sub-classes that wish to select a + sub-protocol if the client provides a list of supported protocols. +

+

+
Parameters:
subProtocols - The list of sub-protocols supported by the client + in client preference order. The server is under no + obligation to respect the declared preference +
Returns:
null if no sub-protocol is selected or the name of + the protocol which must be one of the protocols listed by + the client. This default implementation always returns + null.
+
+
+
+ +

+createWebSocketInbound

+
+protected abstract StreamInbound createWebSocketInbound(String subProtocol)
+
+
Create the instance that will process this inbound connection. + Applications must provide a new instance for each connection. +

+

+
Parameters:
subProtocol - The sub-protocol agreed between the client and + server or null if none was agreed
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved. + + Propchange: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WebSocketServlet.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsFrame.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsFrame.html?rev=1310133&view=auto ============================================================================== --- tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsFrame.html (added) +++ tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsFrame.html Thu Apr 5 23:58:58 2012 @@ -0,0 +1,371 @@ + + + + + + +WsFrame (Apache Tomcat 7.0.27 API Documentation) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+ +

+ +org.apache.catalina.websocket +
+Class WsFrame

+
+java.lang.Object
+  extended by org.apache.catalina.websocket.WsFrame
+
+
+
+
public class WsFrame
extends Object
+ + +

+Represents a complete WebSocket frame with the exception of the payload for + non-control frames. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleangetFin() + +
+           
+ byte[]getMask() + +
+           
+ bytegetOpCode() + +
+           
+ ByteBuffergetPayLoad() + +
+           
+ longgetPayLoadLength() + +
+           
+ intgetRsv() + +
+           
+ booleanisControl() + +
+           
+static WsFramenextFrame(UpgradeProcessor<?> processor, + boolean block) + +
+          Read the next WebSocket frame, reading data from the processor as + necessary.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+getFin

+
+public boolean getFin()
+
+
+
+
+
+
+ +

+getRsv

+
+public int getRsv()
+
+
+
+
+
+
+ +

+getOpCode

+
+public byte getOpCode()
+
+
+
+
+
+
+ +

+isControl

+
+public boolean isControl()
+
+
+
+
+
+
+ +

+getMask

+
+public byte[] getMask()
+
+
+
+
+
+
+ +

+getPayLoadLength

+
+public long getPayLoadLength()
+
+
+
+
+
+
+ +

+getPayLoad

+
+public ByteBuffer getPayLoad()
+
+
+
+
+
+
+ +

+nextFrame

+
+public static WsFrame nextFrame(UpgradeProcessor<?> processor,
+                                boolean block)
+                         throws IOException
+
+
Read the next WebSocket frame, reading data from the processor as + necessary. +

+

+
Parameters:
processor - Processor associated with the WebSocket connection on + which the frame has been sent
block - Should this method block until a frame is presented if no + data is currently available to process. Note that is a + single byte is available, this method will block until the + complete frame (excluding payload for non-control frames) is + available. +
Throws: +
IOException - If a problem occurs processing the frame. Any + exception will trigger the closing of the WebSocket + connection.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved. + + Propchange: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsFrame.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsInputStream.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsInputStream.html?rev=1310133&view=auto ============================================================================== --- tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsInputStream.html (added) +++ tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsInputStream.html Thu Apr 5 23:58:58 2012 @@ -0,0 +1,337 @@ + + + + + + +WsInputStream (Apache Tomcat 7.0.27 API Documentation) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+ +

+ +org.apache.catalina.websocket +
+Class WsInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by org.apache.catalina.websocket.WsInputStream
+
+
+
All Implemented Interfaces:
Closeable
+
+
+
+
public class WsInputStream
extends InputStream
+ + +

+This class is used to read WebSocket frames from the underlying socket and + makes the payload available for reading as an InputStream. It only + makes the number of bytes declared in the payload length available for + reading even if more bytes are available from the socket. +

+ +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
WsInputStream(UpgradeProcessor<?> processor, + WsOutbound outbound) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ WsFramenextFrame(boolean block) + +
+          Process the next WebSocket frame.
+ intread() + +
+           
+ intread(byte[] b, + int off, + int len) + +
+           
+ + + + + + + +
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+WsInputStream

+
+public WsInputStream(UpgradeProcessor<?> processor,
+                     WsOutbound outbound)
+
+
+ + + + + + + + +
+Method Detail
+ +

+nextFrame

+
+public WsFrame nextFrame(boolean block)
+                  throws IOException
+
+
Process the next WebSocket frame. +

+

+
Parameters:
block - Should this method block until a frame is presented if no + data is currently available to process. Note that is a + single byte is available, this method will block until the + complete frame (excluding payload for non-control frames) is + available. +
Returns:
The next frame to be processed or null if block is + false and there is no data to be processed. +
Throws: +
IOException - If a problem occurs reading the data for the frame.
+
+
+
+ +

+read

+
+public int read()
+         throws IOException
+
+
+
Specified by:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b,
+                int off,
+                int len)
+         throws IOException
+
+
+
Overrides:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+Apache Tomcat 7.0.27 +
+ + + +
+Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved. + + Propchange: tomcat/site/trunk/docs/tomcat-7.0-doc/api/org/apache/catalina/websocket/WsInputStream.html ------------------------------------------------------------------------------ svn:mime-type = text/html --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org