Java Doc for httpResponse.java in  » Web-Server » Rimfaxe-Web-Server » seda » sandStorm » lib » http » 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 » Web Server » Rimfaxe Web Server » seda.sandStorm.lib.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   seda.sandStorm.lib.http.httpResponse

All known Subclasses:   seda.sandStorm.lib.http.httpServiceUnavailableResponse,  seda.sandStorm.lib.http.httpOKResponse,  seda.sandStorm.lib.http.httpNotFoundResponse,  seda.sandStorm.lib.http.httpInternalServerErrorResponse,  seda.sandStorm.lib.http.httpBadRequestResponse,  seda.sandStorm.lib.http.httpRedirectResponse,  com.rimfaxe.webserver.seda.SedaHttpResponse,
httpResponse
abstract public class httpResponse implements httpConst,QueueElementIF(Code)
This is an abstract class corresponding to an HTTP response. Use one of the subclasses (such as httpOKResponse or httpNotFoundResponse) to push responses back to the client.
author:
   Matt Welsh
See Also:   httpOKResponse
See Also:   httpNotFoundResponse


Field Summary
final public static  StringDEFAULT_MIME_TYPE
     The default MIME type for responses, which is "text/html".
final public static  intRESPONSE_ACCEPTED
     Code corresponding to '202 ACCEPTED'.
final public static  intRESPONSE_BAD_GATEWAY
     Code corresponding to '502 Bad Gateway'.
final public static  intRESPONSE_BAD_REQUEST
     Code corresponding to '400 Bad Request'.
final public static  intRESPONSE_CONFLICT
     Code corresponding to '409 Conflict'.
final public static  intRESPONSE_CONTINUE
     Code corresponding to '100 Continue'.
final public static  intRESPONSE_CREATED
     Code corresponding to '201 Created'.
final public static  intRESPONSE_EXPECTATION_FAILED
     Code corresponding to '417 Expectation Failed'.
final public static  intRESPONSE_FORBIDDEN
     Code corresponding to '403 Forbidden'.
final public static  intRESPONSE_FOUND
     Code corresponding to '302 Found'.
final public static  intRESPONSE_GATEWAY_TIMEOUT
     Code corresponding to '504 Gateway Timeout'.
final public static  intRESPONSE_GONE
     Code corresponding to '410 Gone'.
final public static  intRESPONSE_HTTP_VERSION_NOT_SUPPORTED
     Code corresponding to '505 HTTP Version Not Supported'.
final public static  intRESPONSE_INTERNAL_SERVER_ERROR
     Code corresponding to '500 Internal Server Error'.
final public static  intRESPONSE_LENGTH_REQUIRED
     Code corresponding to '411 Length Required'.
final public static  intRESPONSE_METHOD_NOT_ALLOWED
     Code corresponding to '405 Method Not Allowed'.
final public static  intRESPONSE_MULTIPLE_CHOICES
     Code corresponding to '300 Multiple Choices'.
final public static  intRESPONSE_NON_AUTHORITATIVE_INFORMATION
     Code corresponding to '203 Non-Authoritative Information'.
final public static  intRESPONSE_NOT_ACCEPTABLE
     Code corresponding to '406 Not Acceptable'.
final public static  intRESPONSE_NOT_FOUND
     Code corresponding to '404 Not Found'.
final public static  intRESPONSE_NOT_IMPLEMENTED
     Code corresponding to '501 Not Implemented'.
final public static  intRESPONSE_NOT_MODIFIED
     Code corresponding to '304 Not Modified'.
final public static  intRESPONSE_NO_CONTENT
     Code corresponding to '204 No Content'.
final public static  intRESPONSE_OK
     Code corresponding to '200 OK'.
final public static  intRESPONSE_PARTIAL_CONTENT
     Code corresponding to '206 Partial Content'.
final public static  intRESPONSE_PAYMENT_REQUIRED
     Code corresponding to '402 Payment Required'.
final public static  intRESPONSE_PRECONDITION_FAILED
     Code corresponding to '412 Precondition Failed'.
final public static  intRESPONSE_PROXY_AUTHENTICATION_REQUIRED
     Code corresponding to '407 Proxy Authentication Required'.
final public static  intRESPONSE_REDIRECT
     Code corresponding to '301 Moved Permanently'.
final public static  intRESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE
     Code corresponding to '416 Requested Range Not Satisfiable'.
final public static  intRESPONSE_REQUEST_ENTITY_TOO_LARGE
     Code corresponding to '413 Request Entity Too Large'.
final public static  intRESPONSE_REQUEST_TIMEOUT
     Code corresponding to '408 Request Timeout'.
final public static  intRESPONSE_REQUEST_URI_TOO_LONG
     Code corresponding to '414 Request-URI Too Long'.
final public static  intRESPONSE_RESERVED_306
     Code corresponding to '306 (Unused)'.
final public static  intRESPONSE_RESET_CONTENT
     Code corresponding to '205 Reset Content'.
final public static  intRESPONSE_SEE_OTHER
     Code corresponding to '303 See Other'.
final public static  intRESPONSE_SERVICE_UNAVAILABLE
     Code corresponding to '503 Service Unavailable'.
final public static  intRESPONSE_SWITCHING_PROTOCOLS
     Code corresponding to '101 Switching Protocols'.
final public static  intRESPONSE_TEMPORARY_REDIRECT
     Code corresponding to '307 Temporary Redirect'.
final public static  intRESPONSE_UNAUTHORIZED
     Code corresponding to '401 Unauthorized'.
final public static  intRESPONSE_UNSUPPORTED_MEDIA_TYPE
     Code corresponding to '415 Unsupported Media Type'.
final public static  intRESPONSE_USE_PROXY
     Code corresponding to '305 Use Proxy'.
protected  intcode
     The code corresponding to the response.
protected  BufferElementcombinedData
     The actual data of the response.
protected  intcontentLength
     The content-length header.
protected  StringcontentType
     The MIME type of the response.
protected static  StringdefaultHeader
     The default response header.
protected  BufferElementheader
     The header for the response.
protected  Hashtableheaders
    
protected  BufferElementpayload
     The payload for the response.

Constructor Summary
protected  httpResponse(int code, String contentType, BufferElement payload, Hashtable headertable)
     Create an httpResponse with the given response code with the given payload.
protected  httpResponse(int code, String contentType, Hashtable headertable)
     Create an httpResponse with the given response code with no payload. A payload can be assigned later using setPayload().
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content.
protected  httpResponse(int code, String contentType, BufferElement payload)
     Create an httpResponse with the given response code with the given payload.
protected  httpResponse(int code, String contentType, BufferElement payload, int contentLength)
     Create an httpResponse with the given response code with the given payload.
protected  httpResponse(int code, String contentType)
     Create an httpResponse with the given response code with no payload. A payload can be assigned later using setPayload().
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content.
protected  httpResponse(int code, String contentType, int payloadSize, SinkIF compQ)
     Create an httpResponse with the the given response code, with an empty payload of the given size.
protected  httpResponse(int code, String contentType, int payloadSize)
     Create an httpResponse with the the given response code, with an empty payload of the given size.
protected  httpResponse(int code, String contentType, int payloadSize, Hashtable headertable, boolean withheaders)
     Create an httpResponse with the the given response code, with an empty payload of the given size.

Method Summary
public  BufferElement[]getBuffers(boolean sendHeader)
     Get an array of BufferElements corresponding to this response.
public static  StringgetDefaultHeader()
     Return the default header string sent in all responses.
abstract protected  StringgetEntityHeader()
     Return the entity header as a String.
public  BufferElementgetHeader()
     Returns the header for this response.
public  BufferElementgetPayload()
     Returns the payload for this response.
public  intgetServerPort()
    
public static  voidsetDefaultHeader(String defhdr)
     Set the default header string sent in all responses.
public  voidsetPayload(BufferElement payload)
     Used to set the payload after creating the response with an empty payload.
public  voidsetServerPort(int val)
    

Field Detail
DEFAULT_MIME_TYPE
final public static String DEFAULT_MIME_TYPE(Code)
The default MIME type for responses, which is "text/html".



RESPONSE_ACCEPTED
final public static int RESPONSE_ACCEPTED(Code)
Code corresponding to '202 ACCEPTED'.



RESPONSE_BAD_GATEWAY
final public static int RESPONSE_BAD_GATEWAY(Code)
Code corresponding to '502 Bad Gateway'.



RESPONSE_BAD_REQUEST
final public static int RESPONSE_BAD_REQUEST(Code)
Code corresponding to '400 Bad Request'.



RESPONSE_CONFLICT
final public static int RESPONSE_CONFLICT(Code)
Code corresponding to '409 Conflict'.



RESPONSE_CONTINUE
final public static int RESPONSE_CONTINUE(Code)
Code corresponding to '100 Continue'.



RESPONSE_CREATED
final public static int RESPONSE_CREATED(Code)
Code corresponding to '201 Created'.



RESPONSE_EXPECTATION_FAILED
final public static int RESPONSE_EXPECTATION_FAILED(Code)
Code corresponding to '417 Expectation Failed'.



RESPONSE_FORBIDDEN
final public static int RESPONSE_FORBIDDEN(Code)
Code corresponding to '403 Forbidden'.



RESPONSE_FOUND
final public static int RESPONSE_FOUND(Code)
Code corresponding to '302 Found'.



RESPONSE_GATEWAY_TIMEOUT
final public static int RESPONSE_GATEWAY_TIMEOUT(Code)
Code corresponding to '504 Gateway Timeout'.



RESPONSE_GONE
final public static int RESPONSE_GONE(Code)
Code corresponding to '410 Gone'.



RESPONSE_HTTP_VERSION_NOT_SUPPORTED
final public static int RESPONSE_HTTP_VERSION_NOT_SUPPORTED(Code)
Code corresponding to '505 HTTP Version Not Supported'.



RESPONSE_INTERNAL_SERVER_ERROR
final public static int RESPONSE_INTERNAL_SERVER_ERROR(Code)
Code corresponding to '500 Internal Server Error'.



RESPONSE_LENGTH_REQUIRED
final public static int RESPONSE_LENGTH_REQUIRED(Code)
Code corresponding to '411 Length Required'.



RESPONSE_METHOD_NOT_ALLOWED
final public static int RESPONSE_METHOD_NOT_ALLOWED(Code)
Code corresponding to '405 Method Not Allowed'.



RESPONSE_MULTIPLE_CHOICES
final public static int RESPONSE_MULTIPLE_CHOICES(Code)
Code corresponding to '300 Multiple Choices'.



RESPONSE_NON_AUTHORITATIVE_INFORMATION
final public static int RESPONSE_NON_AUTHORITATIVE_INFORMATION(Code)
Code corresponding to '203 Non-Authoritative Information'.



RESPONSE_NOT_ACCEPTABLE
final public static int RESPONSE_NOT_ACCEPTABLE(Code)
Code corresponding to '406 Not Acceptable'.



RESPONSE_NOT_FOUND
final public static int RESPONSE_NOT_FOUND(Code)
Code corresponding to '404 Not Found'.



RESPONSE_NOT_IMPLEMENTED
final public static int RESPONSE_NOT_IMPLEMENTED(Code)
Code corresponding to '501 Not Implemented'.



RESPONSE_NOT_MODIFIED
final public static int RESPONSE_NOT_MODIFIED(Code)
Code corresponding to '304 Not Modified'.



RESPONSE_NO_CONTENT
final public static int RESPONSE_NO_CONTENT(Code)
Code corresponding to '204 No Content'.



RESPONSE_OK
final public static int RESPONSE_OK(Code)
Code corresponding to '200 OK'.



RESPONSE_PARTIAL_CONTENT
final public static int RESPONSE_PARTIAL_CONTENT(Code)
Code corresponding to '206 Partial Content'.



RESPONSE_PAYMENT_REQUIRED
final public static int RESPONSE_PAYMENT_REQUIRED(Code)
Code corresponding to '402 Payment Required'.



RESPONSE_PRECONDITION_FAILED
final public static int RESPONSE_PRECONDITION_FAILED(Code)
Code corresponding to '412 Precondition Failed'.



RESPONSE_PROXY_AUTHENTICATION_REQUIRED
final public static int RESPONSE_PROXY_AUTHENTICATION_REQUIRED(Code)
Code corresponding to '407 Proxy Authentication Required'.



RESPONSE_REDIRECT
final public static int RESPONSE_REDIRECT(Code)
Code corresponding to '301 Moved Permanently'.



RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE
final public static int RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE(Code)
Code corresponding to '416 Requested Range Not Satisfiable'.



RESPONSE_REQUEST_ENTITY_TOO_LARGE
final public static int RESPONSE_REQUEST_ENTITY_TOO_LARGE(Code)
Code corresponding to '413 Request Entity Too Large'.



RESPONSE_REQUEST_TIMEOUT
final public static int RESPONSE_REQUEST_TIMEOUT(Code)
Code corresponding to '408 Request Timeout'.



RESPONSE_REQUEST_URI_TOO_LONG
final public static int RESPONSE_REQUEST_URI_TOO_LONG(Code)
Code corresponding to '414 Request-URI Too Long'.



RESPONSE_RESERVED_306
final public static int RESPONSE_RESERVED_306(Code)
Code corresponding to '306 (Unused)'.



RESPONSE_RESET_CONTENT
final public static int RESPONSE_RESET_CONTENT(Code)
Code corresponding to '205 Reset Content'.



RESPONSE_SEE_OTHER
final public static int RESPONSE_SEE_OTHER(Code)
Code corresponding to '303 See Other'.



RESPONSE_SERVICE_UNAVAILABLE
final public static int RESPONSE_SERVICE_UNAVAILABLE(Code)
Code corresponding to '503 Service Unavailable'.



RESPONSE_SWITCHING_PROTOCOLS
final public static int RESPONSE_SWITCHING_PROTOCOLS(Code)
Code corresponding to '101 Switching Protocols'.



RESPONSE_TEMPORARY_REDIRECT
final public static int RESPONSE_TEMPORARY_REDIRECT(Code)
Code corresponding to '307 Temporary Redirect'.



RESPONSE_UNAUTHORIZED
final public static int RESPONSE_UNAUTHORIZED(Code)
Code corresponding to '401 Unauthorized'.



RESPONSE_UNSUPPORTED_MEDIA_TYPE
final public static int RESPONSE_UNSUPPORTED_MEDIA_TYPE(Code)
Code corresponding to '415 Unsupported Media Type'.



RESPONSE_USE_PROXY
final public static int RESPONSE_USE_PROXY(Code)
Code corresponding to '305 Use Proxy'.



code
protected int code(Code)
The code corresponding to the response.



combinedData
protected BufferElement combinedData(Code)
The actual data of the response.



contentLength
protected int contentLength(Code)
The content-length header.



contentType
protected String contentType(Code)
The MIME type of the response.



defaultHeader
protected static String defaultHeader(Code)
The default response header.



header
protected BufferElement header(Code)
The header for the response.



headers
protected Hashtable headers(Code)



payload
protected BufferElement payload(Code)
The payload for the response.




Constructor Detail
httpResponse
protected httpResponse(int code, String contentType, BufferElement payload, Hashtable headertable)(Code)
Create an httpResponse with the given response code with the given payload.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payload - The payload of the response.



httpResponse
protected httpResponse(int code, String contentType, Hashtable headertable)(Code)
Create an httpResponse with the given response code with no payload. A payload can be assigned later using setPayload().
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payload - The payload of the response.



httpResponse
protected httpResponse(int code, String contentType, BufferElement payload)(Code)
Create an httpResponse with the given response code with the given payload.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payload - The payload of the response.



httpResponse
protected httpResponse(int code, String contentType, BufferElement payload, int contentLength)(Code)
Create an httpResponse with the given response code with the given payload.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payload - The payload of the response.
Parameters:
  contentLength - The contentLength to place in the header.



httpResponse
protected httpResponse(int code, String contentType)(Code)
Create an httpResponse with the given response code with no payload. A payload can be assigned later using setPayload().
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payload - The payload of the response.



httpResponse
protected httpResponse(int code, String contentType, int payloadSize, SinkIF compQ)(Code)
Create an httpResponse with the the given response code, with an empty payload of the given size. This can be more efficient than providing a payload separately, as the entire contents of the httpResponse can be sent as a single TCP packet. The payload can be filled in using the getPayload() method.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payloadSize - The size of the payload to allocate.
Parameters:
  compQ - The completion queue for the payload.



httpResponse
protected httpResponse(int code, String contentType, int payloadSize)(Code)
Create an httpResponse with the the given response code, with an empty payload of the given size. This can be more efficient than providing a payload separately, as the entire contents of the httpResponse can be sent as a single TCP packet. The payload can be filled in using the getPayload() method.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payloadSize - The size of the payload to allocate.



httpResponse
protected httpResponse(int code, String contentType, int payloadSize, Hashtable headertable, boolean withheaders)(Code)
Create an httpResponse with the the given response code, with an empty payload of the given size. This can be more efficient than providing a payload separately, as the entire contents of the httpResponse can be sent as a single TCP packet. The payload can be filled in using the getPayload() method.
Parameters:
  code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*.
Parameters:
  contentType - The MIME type of the response content. Shouldnot be CRLF-terminated.
Parameters:
  payloadSize - The size of the payload to allocate.




Method Detail
getBuffers
public BufferElement[] getBuffers(boolean sendHeader)(Code)
Get an array of BufferElements corresponding to this response. Used internally when sending the response to a client.
Parameters:
  sendHeader - Indicate whether the header should be included.



getDefaultHeader
public static String getDefaultHeader()(Code)
Return the default header string sent in all responses.



getEntityHeader
abstract protected String getEntityHeader()(Code)
Return the entity header as a String. Must be implemented by subclasses of httpResponse.



getHeader
public BufferElement getHeader()(Code)
Returns the header for this response.



getPayload
public BufferElement getPayload()(Code)
Returns the payload for this response.



getServerPort
public int getServerPort()(Code)



setDefaultHeader
public static void setDefaultHeader(String defhdr)(Code)
Set the default header string sent in all responses.



setPayload
public void setPayload(BufferElement payload)(Code)
Used to set the payload after creating the response with an empty payload. XXX Should not be used if the payload was allocated by this response (that is, if the payloadSize was specified in the constructor).



setServerPort
public void setServerPort(int val)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.