- LDAPUtil 코드 리팩토링
[Tadpole.git] / com.hangum.tadpole.commons.sql / src / com / hangum / tadpole / engine / query / sql / TadpoleSystem_UserQuery.java
blob7d176044236df740adf9429ff81cf772601cd34e
1 /*******************************************************************************
2 * Copyright (c) 2013 hangum.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser Public License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
7 *
8 * Contributors:
9 * hangum - initial API and implementation
10 ******************************************************************************/
11 package com.hangum.tadpole.engine.query.sql;
13 import java.sql.SQLException;
14 import java.sql.Timestamp;
15 import java.text.DateFormat;
16 import java.text.SimpleDateFormat;
17 import java.util.ArrayList;
18 import java.util.Date;
19 import java.util.HashMap;
20 import java.util.List;
21 import java.util.Map;
23 import org.apache.commons.lang.math.NumberUtils;
24 import org.apache.log4j.Logger;
26 import com.hangum.tadpole.commons.exception.TadpoleAuthorityException;
27 import com.hangum.tadpole.commons.exception.TadpoleRuntimeException;
28 import com.hangum.tadpole.commons.exception.TadpoleSQLManagerException;
29 import com.hangum.tadpole.commons.libs.core.define.PublicTadpoleDefine;
30 import com.hangum.tadpole.commons.libs.core.utils.LicenseValidator;
31 import com.hangum.tadpole.commons.libs.core.utils.SHA256Utils;
32 import com.hangum.tadpole.commons.util.ApplicationArgumentUtils;
33 import com.hangum.tadpole.commons.util.DateUtil;
34 import com.hangum.tadpole.commons.util.Utils;
35 import com.hangum.tadpole.engine.Messages;
36 import com.hangum.tadpole.engine.initialize.TadpoleEngineUserDB;
37 import com.hangum.tadpole.engine.manager.TadpoleSQLManager;
38 import com.hangum.tadpole.engine.query.dao.system.UserDAO;
39 import com.hangum.tadpole.engine.query.dao.system.UserLoginHistoryDAO;
40 import com.hangum.tadpole.preference.define.GetAdminPreference;
41 import com.ibatis.sqlmap.client.SqlMapClient;
44 /**
45 * Define User query.
47 * @author hangum
50 public class TadpoleSystem_UserQuery {
51 private static final Logger logger = Logger.getLogger(TadpoleSystem_UserQuery.class);
53 /**
55 * @param userSeq
56 * @return
57 * @throws TadpoleSQLManagerException
58 * @throws SQLException
60 public static UserDAO getUser(int userSeq)throws TadpoleSQLManagerException, SQLException {
61 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
62 return (UserDAO)sqlClient.queryForObject("getUser", userSeq); //$NON-NLS-1$
65 /**
66 * 모든 유효한 유저 목록을 가져옵니다.
68 * @param strApproval
69 * @param strUserConfirm
70 * @param strDel
71 * @return
72 * @throws TadpoleSQLManagerException, SQLException
74 public static List<UserDAO> getAllUser(String strApproval, String strUserConfirm, String strDel) throws TadpoleSQLManagerException, SQLException {
75 Map<String, String> mapSearch = new HashMap<String, String>();
76 mapSearch.put("Approval", strApproval);
77 mapSearch.put("UserConfirm", strUserConfirm);
78 mapSearch.put("Del", strDel);
80 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
81 return sqlClient.queryForList("getAllUserSearch", mapSearch); //$NON-NLS-1$
84 /**
85 * 모든 유효한 유저 목록을 가져옵니다.
87 * @return
88 * @throws TadpoleSQLManagerException, SQLException
90 public static List<UserDAO> getAllUser() throws TadpoleSQLManagerException, SQLException {
91 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
92 return sqlClient.queryForList("getAllUser"); //$NON-NLS-1$
95 /**
96 * 모든 유효한 유저 수를 가져온다.
98 * @return
99 * @throws TadpoleSQLManagerException, SQLException
101 public static int getAllUserCount() throws TadpoleSQLManagerException, SQLException {
102 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
103 Integer intUserCnt = (Integer)sqlClient.queryForObject("getAllUserCount"); //$NON-NLS-1$
105 return intUserCnt;
109 * 모든 유효한 유저 목록을 가져옵니다.
111 * @param delyn
112 * @return
113 * @throws TadpoleSQLManagerException, SQLException
115 public static List<UserDAO> getLiveAllUser() throws TadpoleSQLManagerException, SQLException {
116 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
117 return sqlClient.queryForList("getLiveAllUser"); //$NON-NLS-1$
121 * add ldap user
123 * @param userName
124 * @param email
125 * @param external_id
126 * @param useOTP
128 * @return
129 * @throws TadpoleSQLManagerException
130 * @throws SQLException
132 public static UserDAO newLDAPUser(String userName, String email, String external_id, String useOPT) throws TadpoleSQLManagerException, SQLException, Exception {
133 return newUser(PublicTadpoleDefine.INPUT_TYPE.LDAP.name(), email, "LDAP", "YES", Utils.getUniqueDigit(12), PublicTadpoleDefine.USER_ROLE_TYPE.USER.name(),
134 userName, "KO", "Asia/Seoul", "YES", useOPT, "", "*", external_id, new Timestamp(System.currentTimeMillis()));
138 * 신규 유저를 등록합니다.
140 * @param inputType
141 * @param email
142 * @param email_key
143 * @param is_email_certification
144 * @param passwd
145 * @param roleType
146 * @param name
147 * @param language
148 * @param timezone
149 * @param approvalYn
150 * @param use_otp
151 * @param otp_secret
152 * @param strAllowIP
153 * @param strIsRegistDb
154 * @param strIsSharedDb
155 * @param intLimitAddDBCnt
156 * @param serviceStart
157 * @param serviceEnd
158 * @param external_id
159 * @param timeChangedPasswdTime
160 * @return
161 * @throws TadpoleSQLManagerException, SQLException
163 public static UserDAO newUser(String inputType, String email, String email_key, String is_email_certification, String passwd,
164 String roleType, String name, String language, String timezone, String approvalYn, String use_otp, String otp_secret,
165 String strAllowIP, String external_id, Timestamp timeChangedPasswdTime
166 ) throws TadpoleSQLManagerException, SQLException, Exception {
167 UserDAO loginDAO = new UserDAO();
168 loginDAO.setInput_type(inputType);
169 loginDAO.setEmail(email);
170 loginDAO.setEmail_key(email_key);
171 loginDAO.setIs_email_certification(is_email_certification);
173 loginDAO.setPasswd(SHA256Utils.getSHA256(passwd));
174 loginDAO.setChanged_passwd_time(timeChangedPasswdTime);//new Timestamp(System.currentTimeMillis()));
175 loginDAO.setRole_type(roleType);
177 loginDAO.setName(name);
178 loginDAO.setLanguage(language);
179 loginDAO.setTimezone(timezone);
180 loginDAO.setApproval_yn(approvalYn);
182 loginDAO.setUse_otp(use_otp);
183 loginDAO.setOtp_secret(otp_secret);
184 loginDAO.setAllow_ip(strAllowIP);
186 loginDAO.setIs_regist_db(GetAdminPreference.getIsAddDB());
187 loginDAO.setIs_shared_db(GetAdminPreference.getIsSharedDB());
188 loginDAO.setLimit_add_db_cnt(NumberUtils.toInt(GetAdminPreference.getDefaultAddDBCnt()));
189 loginDAO.setIs_modify_perference(GetAdminPreference.getIsPreferenceModify());
190 loginDAO.setService_start(new Timestamp(System.currentTimeMillis()));
191 loginDAO.setService_end(new Timestamp(DateUtil.afterMonthToMillis(NumberUtils.toInt(GetAdminPreference.getServiceDurationDay()))));
192 loginDAO.setExternal_id(external_id);
194 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
195 List isUser = sqlClient.queryForList("isUser", email); //$NON-NLS-1$
197 if(isUser.isEmpty()) {
198 UserDAO userdb = (UserDAO)sqlClient.insert("newUser", loginDAO); //$NON-NLS-1$
199 TadpoleSystem_UserInfoData.initializeUserPreferenceData(userdb);
201 return userdb;
202 } else {
203 throw new TadpoleRuntimeException(Messages.get().TadpoleSystem_UserQuery_3);
208 * 이메일이 중복된 사용자가 있는지 검사합니다.
210 * @param email
211 * @return
212 * @throws TadpoleSQLManagerException, SQLException
214 public static boolean isDuplication(String email) throws TadpoleSQLManagerException, SQLException {
216 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
217 List isUser = sqlClient.queryForList("isUser", email); //$NON-NLS-1$
219 if(isUser.size() == 0) {
220 return true;
223 return false;
227 * search like email
228 * @param email
229 * @return
230 * @throws TadpoleSQLManagerException, SQLException
232 public static List<UserDAO> findLikeUser(String email) throws TadpoleSQLManagerException, SQLException {
233 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
234 List<UserDAO> listUser = sqlClient.queryForList("findLikeUser", "%" + email + "%"); //$NON-NLS-1$
236 return listUser;
240 * 유저를 넘겨 받는다.
241 * @param email
242 * @return
243 * @throws TadpoleSQLManagerException
244 * @throws SQLException
246 public static List<UserDAO> findExistUser(String email) throws TadpoleSQLManagerException, SQLException {
247 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
248 List<UserDAO> listUser = sqlClient.queryForList("findEmailUser", email); //$NON-NLS-1$
249 return listUser;
253 * 연속 몇번 로그인을 실패 했을 경우
255 * @param intLastLoginCnt
256 * @param intUserSeq
257 * @param email
258 * @throws TadpoleSQLManagerException
259 * @throws SQLException
261 public static void failLoginCheck(int intLastLoginCnt, int intUserSeq, String email) throws TadpoleSQLManagerException, SQLException {
262 Map<String, Object> queryMap = new HashMap<String, Object>();
263 queryMap.put("intUserSeq", intUserSeq);
264 queryMap.put("intLastLoginCnt", intLastLoginCnt);
266 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
267 List<UserLoginHistoryDAO> listUser = sqlClient.queryForList("lastLoginCntHistory", queryMap); //$NON-NLS-1$
269 int intFailCnt = 0;
270 for (UserLoginHistoryDAO userLoginHistoryDAO : listUser) {
271 if(PublicTadpoleDefine.YES_NO.NO.name().equals(userLoginHistoryDAO.getSucces_yn())) {
272 intFailCnt++;
276 // 연속 intLastLoingCnt 틀리면 계정을 잠근다.
277 if(intFailCnt == intLastLoginCnt) {
278 final UserDAO userDAO = new UserDAO();
279 userDAO.setSeq(intUserSeq);
281 if(logger.isInfoEnabled()) logger.info(String.format("##### User account %s is lock", email));
282 updateUserApproval(userDAO, PublicTadpoleDefine.YES_NO.NO.name());
287 * 유저를 넘겨 받는다.
288 * @param email
289 * @return
290 * @throws TadpoleSQLManagerException
291 * @throws SQLException
293 public static List<UserDAO> findExistExternalUser(String external_id) throws TadpoleSQLManagerException, SQLException {
294 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
295 List<UserDAO> listUser = sqlClient.queryForList("findExternalUser", external_id); //$NON-NLS-1$
296 return listUser;
300 * 사용자 정보를 찾습니다.
302 * @param email
303 * @return
304 * @throws TadpoleSQLManagerException, SQLException
306 public static UserDAO findUser(String email) throws TadpoleSQLManagerException, SQLException {
307 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
308 List<UserDAO> listUser = new ArrayList<UserDAO>();
309 // if(ApplicationArgumentUtils.isOnlineServer()) {
310 // listUser = sqlClient.queryForList("findEmailUser", email); //$NON-NLS-1$
311 // } else {
312 listUser = sqlClient.queryForList("findLikeUser", "%" + email + "%"); //$NON-NLS-1$
313 // }
315 if(listUser.size() == 0) {
316 throw new TadpoleRuntimeException(Messages.get().TadpoleSystem_UserQuery_0);
319 return listUser.get(0);
322 public static List<UserDAO> findUserList(String email) throws TadpoleSQLManagerException, SQLException {
323 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
324 List<UserDAO> listUser = new ArrayList<UserDAO>();
326 listUser = sqlClient.queryForList("findLikeUser", "%" + email + "%"); //$NON-NLS-1$
328 if(listUser.size() == 0) {
329 throw new TadpoleRuntimeException(Messages.get().TadpoleSystem_UserQuery_0);
332 return listUser;
336 * 로그인시 email, passwd 확인
338 * @param email
339 * @param passwd
340 * @throws TadpoleSQLManagerException, SQLException
342 public static UserDAO login(String email, String passwd) throws TadpoleAuthorityException, TadpoleSQLManagerException, SQLException, Exception {
343 UserDAO login = new UserDAO();
344 login.setEmail(email);
345 login.setPasswd(SHA256Utils.getSHA256(passwd));
347 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
348 UserDAO userInfo = (UserDAO)sqlClient.queryForObject("login", login); //$NON-NLS-1$
350 if(null == userInfo) {
351 throw new TadpoleAuthorityException(Messages.get().TadpoleSystem_UserQuery_5);
352 // } else {
353 // if(!passwd.equals(CipherManager.getInstance().decryption(userInfo.getPasswd()))) {
354 // throw new TadpoleAuthorityException(Messages.get().TadpoleSystem_UserQuery_5);
355 // }
358 return userInfo;
362 * update email confirm
364 * @param email
365 * @throws TadpoleSQLManagerException, SQLException
367 public static void updateEmailConfirm(String email) throws TadpoleSQLManagerException, SQLException {
368 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
369 sqlClient.update("updateEmailConfirm", email);
373 * save login history
375 * @param userSeq
377 public static void saveLoginHistory(int userSeq, String strIP) {
378 saveLoginHistory(userSeq, strIP, "YES", "");
382 * save login history
384 * @param userSeq
385 * @param strYesNo
386 * @param strReason
388 public static void saveLoginHistory(int userSeq, String strIP, String strYesNo, String strReason) {
390 if(LicenseValidator.getLicense().isValidate()) {
391 try {
392 UserLoginHistoryDAO historyDao = new UserLoginHistoryDAO();
393 historyDao.setLogin_ip(strIP);
394 historyDao.setUser_seq(userSeq);
395 historyDao.setSucces_yn(strYesNo);
396 historyDao.setFail_reason(strReason);
398 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
399 sqlClient.insert("saveLoginHistory", historyDao);
400 } catch(Exception e) {
401 logger.error("save login history", e);
407 * get login history
409 * @param strEmail
410 * @param strYesNo
411 * @param startTime
412 * @param endTime
414 public static List<UserLoginHistoryDAO> getLoginHistory(String strEmail, String strYesNo, long startTime, long endTime) throws TadpoleSQLManagerException, SQLException {
415 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
417 Map<String, Object> queryMap = new HashMap<String, Object>();
418 queryMap.put("email", strEmail);
419 if(!"All".equals(strYesNo)) queryMap.put("succes_yn", strYesNo);
421 if(ApplicationArgumentUtils.isDBServer()) {
422 Date dateSt = new Date(startTime);
423 DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
424 queryMap.put("startTime", formatter.format(dateSt));
426 Date dateEd = new Date(endTime);
427 queryMap.put("endTime", formatter.format(dateEd));
428 } else {
429 Date dateSt = new Date(startTime);
430 DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
432 queryMap.put("startTime", formatter.format(dateSt));
434 Date dateEd = new Date(endTime);
435 queryMap.put("endTime", formatter.format(dateEd));
438 return (List<UserLoginHistoryDAO>)sqlClient.queryForList("getLoginHistory", queryMap);
442 * get admin
444 * @return
445 * @throws TadpoleSQLManagerException, SQLException
447 public static UserDAO getSystemAdmin() throws TadpoleSQLManagerException, SQLException {
448 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
449 return (UserDAO)sqlClient.queryForObject("getSystemAdmin"); //$NON-NLS-1$
453 * group의 manager 정보를 리턴합니다.
455 * @param groupSeq
456 * @return
457 * @throws TadpoleSQLManagerException, SQLException
459 public static UserDAO getGroupManager(int groupSeq) throws TadpoleSQLManagerException, SQLException {
460 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
461 return (UserDAO)sqlClient.queryForObject("groupManager", groupSeq); //$NON-NLS-1$
465 * admin user가 한명이라면 로그인 화면에서 기본 유저로 설정하기 위해...
467 * @return UserDAO
468 * @throws TadpoleSQLManagerException, SQLException
470 public static UserDAO loginUserCount() throws TadpoleSQLManagerException, SQLException {
471 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
472 Integer isUser = (Integer)sqlClient.queryForObject("loginUserCount"); //$NON-NLS-1$
474 if(isUser == 1) {
475 UserDAO userInfo = (UserDAO)sqlClient.queryForObject("onlyOnUser"); //$NON-NLS-1$
476 return userInfo;
479 return null;
483 * 개인 사용자가 그룹 사용자로 수정
485 * @param user
486 * @throws TadpoleSQLManagerException, SQLException
488 public static void updateUserPersonToGroup(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
489 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
490 user.setPasswd(SHA256Utils.getSHA256(user.getPasswd()));
491 user.setChanged_passwd_time(new Timestamp(System.currentTimeMillis()));
492 sqlClient.update("updateUserPersonToGroup", user); //$NON-NLS-1$
496 * 유저 데이터를 수정
497 * @param user
498 * @throws TadpoleSQLManagerException, SQLException
500 public static void updateUserData(UserDAO user) throws TadpoleSQLManagerException, SQLException {
501 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
502 sqlClient.update("updateUserPermission", user); //$NON-NLS-1$
506 * 유저의 name, password 를 수정한다.
507 * @param user
508 * @throws TadpoleSQLManagerException, SQLException
510 public static void updateUserNameEmail(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
511 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
512 sqlClient.update("updateUserNameEmail", user); //$NON-NLS-1$
516 * 유저의 기본정보를 수정
517 * @param user
518 * @throws TadpoleSQLManagerException, SQLException
520 public static void updateUserBasic(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
521 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
522 sqlClient.update("updateUserBasic", user); //$NON-NLS-1$
526 * 시스템 어드민이 유저의 패스워드 변경
527 * @param user
528 * @throws TadpoleSQLManagerException, SQLException
530 public static void updateSystemAdminUserPassword(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
531 user.setPasswd(SHA256Utils.getSHA256(user.getPasswd()));
533 // 10년전으로 패스워드 수정하였다고 기록한다.
534 // 그러면 강제로 패스워드 바꾸었다고 뜰거니까? ㅠㅠ --;;
535 user.setChanged_passwd_time(new Timestamp(DateUtil.beforeMonthToMillsMonth(12 * 10)));
537 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
538 sqlClient.update("updateUserPassword", user); //$NON-NLS-1$
542 * 유저의 패스워드 변경
543 * @param user
544 * @throws TadpoleSQLManagerException, SQLException
546 public static void updateUserPassword(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
547 user.setPasswd(SHA256Utils.getSHA256(user.getPasswd()));
548 user.setChanged_passwd_time(new Timestamp(System.currentTimeMillis()));
550 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
551 sqlClient.update("updateUserPassword", user); //$NON-NLS-1$
555 * 유저의 패스워드 번경
556 * @param user
557 * @throws TadpoleSQLManagerException, SQLException
559 public static void updateUserPasswordWithID(UserDAO user) throws TadpoleSQLManagerException, SQLException, Exception {
560 user.setPasswd(SHA256Utils.getSHA256(user.getPasswd()));
561 user.setChanged_passwd_time(new Timestamp(System.currentTimeMillis()));
563 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
564 sqlClient.update("updateUserPasswordWithID", user); //$NON-NLS-1$
568 * 사용자 힌트 변경
570 * @param user
571 * @throws TadpoleSQLManagerException, SQLException
573 public static void updateUserOTPCode(UserDAO user) throws TadpoleSQLManagerException, SQLException {
574 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
575 sqlClient.update("updateUserOTPCode", user); //$NON-NLS-1$
579 * 사용자 정보.
581 * @param userSeq
582 * @return
583 * @throws TadpoleSQLManagerException, SQLException
585 public static UserDAO getUserInfo(int userSeq) throws TadpoleSQLManagerException, SQLException {
586 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
587 return (UserDAO)sqlClient.queryForObject("getUserInfo", userSeq); //$NON-NLS-1$
591 * 사용자 정보 값을 수정합니다.
592 * @param userDAO
593 * @param name
595 public static void updateUserApproval(UserDAO userDAO, String yesNo) throws TadpoleSQLManagerException, SQLException {
596 UserDAO tmpUser = new UserDAO();
597 tmpUser.setSeq(userDAO.getSeq());
598 tmpUser.setApproval_yn(yesNo);
600 SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleEngineUserDB.getUserDB());
601 sqlClient.update("updateUserApproval", tmpUser); //$NON-NLS-1$