Source Code Cross Referenced for ConsoleSettingImpl.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » console » server » 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 » ESB » cbesb 1.2 » com.bostechcorp.cbesb.console.server 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.bostechcorp.cbesb.console.server;
002:
003:        import java.util.ArrayList;
004:        import java.util.List;
005:
006:        import com.bostechcorp.cbesb.common.i18n.CoreMessageConstants;
007:        import com.bostechcorp.cbesb.common.i18n.Messages;
008:        import com.bostechcorp.cbesb.common.util.runtimedb.ConsoleSettingDB;
009:        import com.bostechcorp.cbesb.common.util.runtimedb.vo.ConsoleSettingVO;
010:        import com.bostechcorp.cbesb.console.common.ConsoleSettingResult;
011:        import com.bostechcorp.cbesb.console.common.ConsoleSystemSettingInfo;
012:        import com.bostechcorp.cbesb.console.common.ConsoleUserSettingInfo;
013:        import com.bostechcorp.cbesb.console.common.ServerSideException;
014:        import com.bostechcorp.cbesb.console.rpc.ConsoleSetting;
015:
016:        public class ConsoleSettingImpl extends ConsoleRemoteServiceServlet
017:                implements  ConsoleSetting {
018:
019:            /**
020:             * 
021:             */
022:            private static final long serialVersionUID = -152372207764043698L;
023:
024:            public ConsoleUserSettingInfo getConsoleUserSetting(String userId) {
025:
026:                return ConsoleSettingUtil.getConsoleUserSetting(userId);
027:            }
028:
029:            public void restoreConsoleUserSetting(String userId)
030:                    throws ServerSideException {
031:                try {
032:                    ConsoleSettingDB.delete(userId);
033:                } catch (Exception e) {
034:                    throw new ServerSideException(
035:                            Messages
036:                                    .get(CoreMessageConstants.FAILED_RESTORE_USER_SETTING),
037:                            e);
038:                }
039:
040:            }
041:
042:            public ConsoleSettingResult saveConsoleUserSetting(String userId,
043:                    ConsoleUserSettingInfo consoleSettingInfo) {
044:                List<ConsoleSettingVO> settingList = new ArrayList<ConsoleSettingVO>();
045:                long id = Long.parseLong(userId);
046:                setUserSettingList(id, settingList, consoleSettingInfo);
047:                ConsoleUserSettingInfo originalSetting = this 
048:                        .getConsoleUserSetting(userId);
049:                ConsoleSettingResult result = new ConsoleSettingResult();
050:
051:                try {
052:                    ConsoleSettingDB.saveConsoleSetting(userId, settingList);
053:                } catch (Exception e) {
054:                    result
055:                            .setException(
056:                                    Messages
057:                                            .get(CoreMessageConstants.FAILD_SAVE_PREFERENCE),
058:                                    e);
059:                    return result;
060:                }
061:
062:                if (!originalSetting.getSaInEndpointView().equals(
063:                        consoleSettingInfo.getSaInEndpointView())) {
064:                    result.setSaInEndpointViewChanged(true);
065:                } else
066:                    result.setSaInEndpointViewChanged(false);
067:                result.setSaInEndpointView(consoleSettingInfo
068:                        .getSaInEndpointView());
069:                return result;
070:            }
071:
072:            public ConsoleSystemSettingInfo getConsoleSystemSetting() {
073:                return ConsoleSettingUtil.getConsoleSystemSettingInfo();
074:            }
075:
076:            public void saveConsoleSystemSetting(String userId,
077:                    ConsoleSystemSettingInfo consoleSystemSettingInfo) {
078:                List<ConsoleSettingVO> settingList = new ArrayList<ConsoleSettingVO>();
079:                long id = Long.parseLong(userId);
080:                setUserSettingList(id, settingList, consoleSystemSettingInfo);
081:
082:                ConsoleSettingVO vo20 = new ConsoleSettingVO();
083:                vo20.setUserId(id);
084:                vo20
085:                        .setSetting(ConsoleSystemSettingInfo.ERROR_COUNT_PING_INTERVAL);
086:                vo20.setValue(consoleSystemSettingInfo
087:                        .getErrorCountPingInterval());
088:                settingList.add(vo20);
089:
090:                ConsoleSettingVO vo19 = new ConsoleSettingVO();
091:                vo19.setUserId(id);
092:                vo19.setSetting(ConsoleSystemSettingInfo.MEMORY_PING_INTERVAL);
093:                vo19.setValue(consoleSystemSettingInfo.getMemoryPingInterval());
094:                settingList.add(vo19);
095:
096:                ConsoleSettingVO vo11 = new ConsoleSettingVO();
097:                vo11.setUserId(id);
098:                vo11.setSetting(ConsoleSystemSettingInfo.CPU_PING_INTERVAL);
099:                vo11.setValue(consoleSystemSettingInfo.getCpuPingInterval());
100:                settingList.add(vo11);
101:
102:                ConsoleSettingVO vo12 = new ConsoleSettingVO();
103:                vo12.setUserId(id);
104:                vo12.setSetting(ConsoleSystemSettingInfo.LICENSE_PING_INTERVAL);
105:                vo12
106:                        .setValue(consoleSystemSettingInfo
107:                                .getLicensePingInterval());
108:                settingList.add(vo12);
109:
110:                ConsoleSettingVO vo13 = new ConsoleSettingVO();
111:                vo13.setUserId(id);
112:                vo13.setSetting(ConsoleSystemSettingInfo.DISK_PING_INTERVAL);
113:                vo13.setValue(consoleSystemSettingInfo.getDiskPingInterval());
114:                settingList.add(vo13);
115:
116:                ConsoleSettingVO vo14 = new ConsoleSettingVO();
117:                vo14.setUserId(id);
118:                vo14.setSetting(ConsoleSystemSettingInfo.SERVER_PING_INTERVAL);
119:                vo14.setValue(consoleSystemSettingInfo.getServerPingInterval());
120:                settingList.add(vo14);
121:
122:                ConsoleSettingVO vo15 = new ConsoleSettingVO();
123:                vo15.setUserId(id);
124:                vo15.setSetting(ConsoleSystemSettingInfo.SA_PING_INTERVAL);
125:                vo15.setValue(consoleSystemSettingInfo.getSAPingInterval());
126:                settingList.add(vo15);
127:
128:                ConsoleSettingVO vo16 = new ConsoleSettingVO();
129:                vo16.setUserId(id);
130:                vo16
131:                        .setSetting(ConsoleSystemSettingInfo.COMPONENT_PING_INTERVAL);
132:                vo16.setValue(consoleSystemSettingInfo
133:                        .getComponentPingInterval());
134:                settingList.add(vo16);
135:
136:                ConsoleSettingVO vo17 = new ConsoleSettingVO();
137:                vo17.setUserId(id);
138:                vo17
139:                        .setSetting(ConsoleSystemSettingInfo.FILE_STATUS_PING_INTERVAL);
140:                vo17.setValue(consoleSystemSettingInfo
141:                        .getFileStatusPingInterval());
142:                settingList.add(vo17);
143:
144:                ConsoleSettingVO vo18 = new ConsoleSettingVO();
145:                vo18.setUserId(id);
146:                vo18.setSetting(ConsoleSystemSettingInfo.CUSTOM_STATUS_VALUES);
147:                vo18.setValue(consoleSystemSettingInfo.getCustomStatusValues());
148:                settingList.add(vo18);
149:
150:                ConsoleSystemSettingInfo originalSetting = this 
151:                        .getConsoleSystemSetting();
152:                try {
153:                    ConsoleSettingDB.saveConsoleSetting(userId, settingList);
154:                } catch (Exception e) {
155:                    e.printStackTrace();
156:                }
157:
158:                if (!consoleSystemSettingInfo.getCustomStatusValues().trim()
159:                        .equals(originalSetting.getCustomStatusValues().trim())) {
160:                    ConsoleSettingUtil.setCustomStatusSettingChanged(true);
161:                }
162:
163:            }
164:
165:            private void setUserSettingList(long id,
166:                    List<ConsoleSettingVO> settingList,
167:                    ConsoleUserSettingInfo consoleSettingInfo) {
168:                ConsoleSettingVO vo1 = new ConsoleSettingVO();
169:                vo1.setUserId(id);
170:                vo1.setSetting(ConsoleUserSettingInfo.ALERTVIEW_PAGE_SIZE);
171:                vo1.setValue(consoleSettingInfo.getAlertViewPageSize());
172:                settingList.add(vo1);
173:
174:                ConsoleSettingVO vo2 = new ConsoleSettingVO();
175:                vo2.setUserId(id);
176:                vo2.setSetting(ConsoleUserSettingInfo.ALERTVIEW_REFRESH_RATE);
177:                vo2.setValue(consoleSettingInfo.getAlertViewRefreshRate());
178:                settingList.add(vo2);
179:
180:                ConsoleSettingVO vo3 = new ConsoleSettingVO();
181:                vo3.setUserId(id);
182:                vo3.setSetting(ConsoleUserSettingInfo.COMPONENT_REFRESH_RATE);
183:                vo3.setValue(consoleSettingInfo.getComponentRefreshRate());
184:                settingList.add(vo3);
185:
186:                ConsoleSettingVO vo4 = new ConsoleSettingVO();
187:                vo4.setUserId(id);
188:                vo4
189:                        .setSetting(ConsoleUserSettingInfo.ENDPOINT_STATUS_REFRESH_RATE);
190:                vo4.setValue(consoleSettingInfo.getEndpointStatusRefreshRate());
191:                settingList.add(vo4);
192:
193:                ConsoleSettingVO vo5 = new ConsoleSettingVO();
194:                vo5.setUserId(id);
195:                vo5.setSetting(ConsoleUserSettingInfo.ERRORDB_PAGE_SIZE);
196:                vo5.setValue(consoleSettingInfo.getErrorDbPageSize());
197:                settingList.add(vo5);
198:
199:                ConsoleSettingVO vo6 = new ConsoleSettingVO();
200:                vo6.setUserId(id);
201:                vo6.setSetting(ConsoleUserSettingInfo.LOGVIEW_LINE_BUFFER_SIZE);
202:                vo6.setValue(consoleSettingInfo.getLogViewerLineBufferSize());
203:                settingList.add(vo6);
204:
205:                ConsoleSettingVO vo7 = new ConsoleSettingVO();
206:                vo7.setUserId(id);
207:                vo7.setSetting(ConsoleUserSettingInfo.LOGVIEW_NUMOF_LINE);
208:                vo7.setValue(consoleSettingInfo.getLogViewerNumOfLine());
209:                settingList.add(vo7);
210:
211:                ConsoleSettingVO vo8 = new ConsoleSettingVO();
212:                vo8.setUserId(id);
213:                vo8.setSetting(ConsoleUserSettingInfo.SA_REFRESH_RATE);
214:                vo8.setValue(consoleSettingInfo.getSaRefreshRate());
215:                settingList.add(vo8);
216:
217:                ConsoleSettingVO vo9 = new ConsoleSettingVO();
218:                vo9.setUserId(id);
219:                vo9.setSetting(ConsoleUserSettingInfo.STATISTICS_REFRESH_RATE);
220:                vo9.setValue(consoleSettingInfo.getStatisticsRefreshRate());
221:                settingList.add(vo9);
222:
223:                ConsoleSettingVO vo10 = new ConsoleSettingVO();
224:                vo10.setUserId(id);
225:                vo10.setSetting(ConsoleUserSettingInfo.SA_IN_ENDPOINTVIEW);
226:                vo10.setValue(consoleSettingInfo.getSaInEndpointView());
227:                settingList.add(vo10);
228:
229:                ConsoleSettingVO vo11 = new ConsoleSettingVO();
230:                vo11.setUserId(id);
231:                vo11.setSetting(ConsoleUserSettingInfo.LOG_REFRESH_RATE);
232:                vo11.setValue(consoleSettingInfo.getLogRefreshRate());
233:                settingList.add(vo11);
234:
235:            }
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.