Source Code Cross Referenced for HttpWarning.java in  » Web-Server » Jigsaw » org » w3c » www » 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 » Jigsaw » org.w3c.www.http 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // HttpWarning.java
002:        // $Id: HttpWarning.java,v 1.10 1998/08/13 16:28:38 bmahe Exp $
003:        // (c) COPYRIGHT MIT and INRIA, 1996.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.www.http;
007:
008:        public class HttpWarning extends BasicValue {
009:            /**
010:             * Warning status - Response is stale.
011:             */
012:            public static final int STALE = 110;
013:            /**
014:             * Warning status - Revalidation failed.
015:             */
016:            public static final int REVALIDATION_FAILED = 111;
017:            /**
018:             * Warning status - Disconnected opertaion.
019:             */
020:            public static final int DISCONNECTED_OPERATION = 112;
021:            /**
022:             * Warning status - Heuristic expiration.
023:             */
024:            public static final int HEURISTIC_EXPIRATION = 113;
025:            /**
026:             * Warning status - Miscellaneous warning
027:             */
028:            public static final int MISCELLANEOUS = 199;
029:            /**
030:             * Warning status - Transformation applied.
031:             */
032:            public static final int TRANSFORMATION_APPLIED = 214;
033:            /**
034:             * Warning status - Miscellaneous warning
035:             */
036:            public static final int PERSISTENT_MISCELLANEOUS = 199;
037:
038:            protected HttpWarningList list = null;
039:
040:            protected int status = -1;
041:            protected String agent = null;
042:            protected String text = null;
043:
044:            /**
045:             * parse.
046:             * @exception HttpParserException if parsing failed.
047:             */
048:            protected void parse() throws HttpParserException {
049:                ParseState ps = new ParseState(roff, rlen);
050:                ParseState it = new ParseState();
051:                // Get the status code:
052:                if (HttpParser.nextItem(raw, ps) < 0)
053:                    error("Invalid warning, no status code.");
054:                it.ioff = ps.start;
055:                it.bufend = ps.end;
056:                this .status = HttpParser.parseInt(raw, it);
057:                // Get the agent emiting the warning
058:                ps.prepare();
059:                if (HttpParser.nextItem(raw, ps) < 0)
060:                    error("Invalid warning, no agent field.");
061:                this .agent = new String(raw, 0, ps.start, ps.end - ps.start);
062:                // Get the quoted message
063:                ps.prepare();
064:                if (HttpParser.nextItem(raw, ps) < 0)
065:                    error("Invalid warning, no text message.");
066:                it.ioff = ps.start;
067:                it.bufend = ps.end;
068:                HttpParser.unquote(raw, it);
069:                this .text = new String(raw, 0, it.start, it.end - it.start);
070:            }
071:
072:            protected void updateByteValue() {
073:                HttpBuffer buf = new HttpBuffer();
074:                buf.appendInt(status);
075:                buf.append(' ');
076:                buf.append(agent);
077:                buf.append(' ');
078:                buf.appendQuoted(text);
079:                raw = buf.getByteCopy();
080:                roff = 0;
081:                rlen = raw.length;
082:            }
083:
084:            protected void invalidateByteValue() {
085:                super .invalidateByteValue();
086:                if (list != null)
087:                    list.invalidateByteValue();
088:            }
089:
090:            public Object getValue() {
091:                validate();
092:                return this ;
093:            }
094:
095:            /**
096:             * Get this warning status code.
097:             * @return An integer giving the warning status code.
098:             */
099:
100:            public int getStatus() {
101:                validate();
102:                return status;
103:            }
104:
105:            /**
106:             * Set this warning status code.
107:             * @param status The status code for this warning.
108:             */
109:
110:            public void setStatus(int status) {
111:                if (this .status != status)
112:                    invalidateByteValue();
113:                this .status = status;
114:            }
115:
116:            /**
117:             * Get this warning agent.
118:             * @return A String encoding the agent that generated the warning.
119:             */
120:
121:            public String getAgent() {
122:                validate();
123:                return agent;
124:            }
125:
126:            /**
127:             * Set the agent that is generating the warning.
128:             * @param agent The String describing the agent emitting the warning.
129:             */
130:
131:            public void setAgent(String agent) {
132:                if ((agent != null) && !agent.equals(this .agent))
133:                    invalidateByteValue();
134:                this .agent = agent;
135:            }
136:
137:            /**
138:             * Get the warning text message.
139:             * @return A String encoding the text message.
140:             */
141:
142:            public String getText() {
143:                validate();
144:                return text;
145:            }
146:
147:            /**
148:             * Set the text warning message.
149:             * @param text The new text of the warning message.
150:             */
151:
152:            public void setText(String text) {
153:                if ((text != null) && !text.equals(this .text))
154:                    invalidateByteValue();
155:                this .text = text;
156:            }
157:
158:            HttpWarning(HttpWarningList list, byte raw[], int roff, int rlen) {
159:                this .list = list;
160:                this .raw = raw;
161:                this .roff = roff;
162:                this .rlen = rlen;
163:                this .isValid = false;
164:            }
165:
166:            HttpWarning(boolean isValid, int status, String agent, String text) {
167:                this .isValid = isValid;
168:                setStatus(status);
169:                setAgent(agent);
170:                setText(text);
171:            }
172:
173:            public HttpWarning() {
174:                this .isValid = false;
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.