Source Code Cross Referenced for TaskAdminException.java in  » Portal » Open-Portal » com » sun » portal » taskadmin » 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 » Portal » Open Portal » com.sun.portal.taskadmin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.taskadmin;
002:
003:        import java.io.PrintWriter;
004:        import java.io.IOException;
005:        import java.io.BufferedReader;
006:        import java.io.FileInputStream;
007:        import java.io.PrintStream;
008:        import java.io.PrintWriter;
009:
010:        import javax.servlet.http.HttpServletResponse;
011:
012:        import com.sun.portal.util.UnicodeInputStreamReader;
013:
014:        public class TaskAdminException extends Exception {
015:
016:            public static final String UNKNOWN = "unknown";
017:
018:            public static final String[] errorKeys = {
019:            //0 - Error, Operation was unsuccessful
020:                    "generic.error.message",
021:                    //1 - Invlid channel or channel does not exist
022:                    "message.nochannel",
023:                    //2 - Invlid provider or provider does not exist
024:                    "message.noprovider",
025:                    //3 - unknown property type
026:                    "message.typeunknown",
027:                    //4 Channel Exists error
028:                    "message.channelexists",
029:                    //5 DP Store error
030:                    "message.store",
031:                    //6 channel not a container
032:                    "message.notcontainer",
033:                    //7 property doesn't exist
034:                    "message.noproperty",
035:                    //8 error in assignRole method
036:                    "message.role.assign.error",
037:                    //9 error in removeRole method
038:                    "message.role.remove.error",
039:                    //10 error in retriving user roles.
040:                    "message.user.roles.error",
041:                    //11 error in changing user status.
042:                    "message.userstatus.error",
043:                    //12 error in resetting user password.
044:                    "message.resetpassword.error",
045:                    //13 error in getting the users
046:                    "message.users.error",
047:                    //14 error in getting the assignable roles
048:                    "message.assignable.roles.error",
049:                    //15 error in getting the assignable roles
050:                    "message.DNName.error",
051:                    //16 error in retrieving baseDN
052:                    "message.invalidDN.error",
053:                    //17 invalid search string
054:                    "message.invalidpattern.error",
055:                    //18 create users error
056:                    "message.createusers.error",
057:                    //19 delete users error
058:                    "message.deleteusers.error",
059:                    //20 null password
060:                    "message.nullpassword",
061:                    //21 invalid portlet preference
062:                    "message.invalidpreference",
063:                    //22 null channel name
064:                    "message.nullchannelname",
065:                    //23 Invalid user DN.
066:                    "message.invaliduserdn",
067:                    //24 Invalid role DN.
068:                    "message.invalidroledn",
069:                    //25 error in retrieving the produers ids list.
070:                    "message.producers.id.list",
071:                    //26 error in retrieving the porlets handlers (ids) list.
072:                    "message.porlets.handler.list",
073:                    //27 Error while retrieving WSRP produer name.
074:                    "message.producer.name.error",
075:                    //28 Error while retrieving WSRP portlet name.
076:                    "message.porlet.name.error",
077:                    //29 Invalid new user information.
078:                    "message.createuser.error",
079:                    //30 Invalid role information
080:                    "message.invalidrole.error",
081:                    //31 Create role error
082:                    "message.createrole.error",
083:                    //32 Search Users Time Limit error
084:                    "message.searchtimelimit.error",
085:                    //33 Search Users Size Limit error
086:                    "message.searchsizelimit.error",
087:                    //34 dp is modified before store
088:                    "message.store.dpmodified.error",
089:                    //35 error deleting channel
090:                    "message.delete.channel.error",
091:                    // 36 empty dp document
092:                    "error.empty.dp.document" };
093:
094:            private int errorCode = 0;
095:
096:            protected Throwable wrapped = null;
097:            protected String exceptionType = UNKNOWN;
098:            protected java.lang.Object[] tokens = null;
099:
100:            private TaskAdminException() {
101:                // nothing
102:            }
103:
104:            public TaskAdminException(String msg) {
105:                super (msg);
106:            }
107:
108:            public TaskAdminException(String msg, String type) {
109:                super (msg);
110:                exceptionType = type;
111:            }
112:
113:            public TaskAdminException(String msg, Throwable e) {
114:                super (msg);
115:                wrapped = e;
116:            }
117:
118:            public TaskAdminException(int errorCode, Throwable e,
119:                    java.lang.Object[] tokens) {
120:                super (e.getMessage());
121:                wrapped = e;
122:                this .errorCode = validateErrorCode(errorCode);
123:                this .tokens = tokens;
124:
125:            }
126:
127:            public TaskAdminException(int errorCode, String msg,
128:                    java.lang.Object[] tokens) {
129:                super (msg);
130:                this .errorCode = validateErrorCode(errorCode);
131:                this .tokens = tokens;
132:            }
133:
134:            public TaskAdminException(int errorCode, java.lang.Object[] tokens) {
135:                this .errorCode = validateErrorCode(errorCode);
136:                this .tokens = tokens;
137:            }
138:
139:            public Throwable getWrapped() {
140:                return wrapped;
141:            }
142:
143:            public String getExceptionType() {
144:                return exceptionType;
145:            }
146:
147:            public String toString() {
148:                StringBuffer b = new StringBuffer();
149:
150:                b.append(super .toString());
151:                if (getWrapped() != null) {
152:                    b.append(wrapped.toString());
153:                }
154:
155:                return b.toString();
156:            }
157:
158:            public void printStackTrace() {
159:                super .printStackTrace();
160:                if (getWrapped() != null) {
161:                    wrapped.printStackTrace();
162:                }
163:            }
164:
165:            public void printStackTrace(PrintStream s) {
166:                super .printStackTrace(s);
167:                if (getWrapped() != null) {
168:                    wrapped.printStackTrace(s);
169:                }
170:            }
171:
172:            public void printStackTrace(PrintWriter s) {
173:                super .printStackTrace(s);
174:                if (getWrapped() != null) {
175:                    wrapped.printStackTrace(s);
176:                }
177:            }
178:
179:            public int getErrorCode() {
180:                return errorCode;
181:            }
182:
183:            public String getErrorKey() {
184:                return errorKeys[errorCode];
185:            }
186:
187:            public Object[] getTokens() {
188:                return tokens;
189:            }
190:
191:            public String getMessageFromRB(java.util.ResourceBundle rb,
192:                    java.lang.String key, java.lang.Object[] tokens) {
193:
194:                String msg = rb.getString(key);
195:
196:                if (tokens != null && tokens.length > 0) {
197:                    java.text.MessageFormat mf = new java.text.MessageFormat("");
198:                    mf.setLocale(rb.getLocale());
199:                    mf.applyPattern(msg);
200:                    return mf.format(tokens);
201:                } else {
202:                    return msg;
203:                }
204:            }
205:
206:            public String getLocalizedMessage(java.util.ResourceBundle rb) {
207:                return getMessageFromRB(rb, getErrorKey(), getTokens());
208:            }
209:
210:            private int validateErrorCode(int code) {
211:                if (code < errorKeys.length) {
212:                    return code;
213:                } else {
214:                    return 0;
215:                }
216:            }
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.