Source Code Cross Referenced for SipException.java in  » 6.0-JDK-Modules » j2me » javax » microedition » sip » 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 » 6.0 JDK Modules » j2me » javax.microedition.sip 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Portions Copyright  2000-2007 Sun Microsystems, Inc. All Rights
003:         * Reserved.  Use is subject to license terms.
004:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005:         * 
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License version
008:         * 2 only, as published by the Free Software Foundation.
009:         * 
010:         * This program is distributed in the hope that it will be useful, but
011:         * WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013:         * General Public License version 2 for more details (a copy is
014:         * included at /legal/license.txt).
015:         * 
016:         * You should have received a copy of the GNU General Public License
017:         * version 2 along with this work; if not, write to the Free Software
018:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA
020:         * 
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022:         * Clara, CA 95054 or visit www.sun.com if you need additional
023:         * information or have any questions.
024:         */
025:
026:        package javax.microedition.sip;
027:
028:        import java.io.IOException;
029:
030:        /**
031:         * This is an exception class for SIP specific errors. 
032:         * @see JSR180 spec, v 1.0.1, p 63-66
033:         *
034:         */
035:        public class SipException extends IOException {
036:            /**
037:             * Other SIP error
038:             */
039:            public static final byte GENERAL_ERROR = 0;
040:
041:            /**
042:             * The requested transport is not supported
043:             */
044:            public static final byte TRANSPORT_NOT_SUPPORTED = 1;
045:
046:            /**
047:             * Thrown for example when SIP connection does not belong to any Dialog.
048:             */
049:            public static final byte DIALOG_UNAVAILABLE = 2;
050:
051:            /**
052:             * Used when for example Content-Type is not set before filling
053:             * the message body.
054:             */
055:            public static final byte UNKNOWN_TYPE = 3;
056:
057:            /**
058:             * Used when for example Content-Length is not set before filling
059:             * the message body
060:             */
061:            public static final byte UNKNOWN_LENGTH = 4;
062:
063:            /**
064:             * Method call not allowed, because of wrong state in SIP connection.
065:             */
066:            public static final byte INVALID_STATE = 5;
067:
068:            /**
069:             * The system does not allow particular operation. NOTICE! This error does
070:             * not handle security exceptions.
071:             */
072:            public static final byte INVALID_OPERATION = 6;
073:
074:            /**
075:             * System can not open any new transactions.
076:             */
077:            public static final byte TRANSACTION_UNAVAILABLE = 7;
078:
079:            /**
080:             * The message to be sent has invalid format.
081:             */
082:            public static final byte INVALID_MESSAGE = 8;
083:
084:            /**
085:             * Current error code for this sip exception
086:             */
087:            private byte error_code;
088:
089:            /**
090:             * Construct SipException with error code.
091:             * @param errorCode - error code. If the error code is none of
092:             *  the specified
093:             * codes the Exception is initialized with default GENERAL_ERROR.
094:             */
095:            public SipException(byte errorCode) {
096:                super ();
097:
098:                if (errorCode > INVALID_MESSAGE || errorCode < GENERAL_ERROR) {
099:                    // If the error code is none of the specified codes
100:                    // the Exception is initialized with default GENERAL_ERROR.
101:                    errorCode = GENERAL_ERROR;
102:                } else {
103:                    error_code = errorCode;
104:                }
105:            }
106:
107:            /**
108:             * Construct SipException with textual message and error code.
109:             * @param message - error message.
110:             * @param errorCode - error code. If the error code is none of
111:             *  the specified
112:             * codes the Exception is initialized with default GENERAL_ERROR.
113:             */
114:            public SipException(java.lang.String message, byte errorCode) {
115:                super (message);
116:
117:                if (errorCode > INVALID_MESSAGE || errorCode < GENERAL_ERROR) {
118:                    // If the error code is none of the specified codes
119:                    // the Exception is initialized with default GENERAL_ERROR.
120:                    errorCode = GENERAL_ERROR;
121:                } else {
122:                    error_code = errorCode;
123:                }
124:            }
125:
126:            /**
127:             * Gets the error code
128:             * @return error code
129:             */
130:            public byte getErrorCode() {
131:                return error_code;
132:            }
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.