⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 realmresetpassword.java

📁 一个实用工具类
💻 JAVA
字号:
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file.  */package org.butor.realm.service;import org.butor.bls.IOutputResponse;import org.butor.bls.IRequest;import org.butor.bls.Service;import org.butor.bls.ServiceException;import org.butor.dataStruct.Message;import org.butor.log.Log;import org.butor.realm.RealmService;import org.butor.realm.service.bean.RealmResetPasswordParam;/** * TODO *  * @author sawanai * Jul 5, 2004 */public class RealmResetPassword extends Service {	/**	 * 	 */	public RealmResetPassword() {		super(RealmResetPasswordParam.SERVICE_NAME);	}		public String getDescription() {		return "Reset user password.";	}		/**	 * ParamBean class	 * @see org.butor.bls.IService#getParamBeanClass()	 */	public Class getServiceParamBeanClass() {		return RealmResetPasswordParam.class;	}	public IOutputResponse execute(IRequest request) throws ServiceException {		IOutputResponse response = request.createResponse();		RealmResetPasswordParam params = (RealmResetPasswordParam) getServiceParamBean(request);		String userid = (params.getUserid() == null ? null : params.getUserid().trim()); 												if (userid == null || userid.length() == 0) {			response.addMessage(new Message(1000, Message.ERROR, "Missing param userid!"));			response.endResponse(1000);			return response;		}		String newPassword = (params.getNewPassword() == null ? null : params.getNewPassword().trim()); 												if (newPassword == null || newPassword.length() == 0) {			response.addMessage(new Message(1000, Message.ERROR, "Missing param newPassword!"));			response.endResponse(1000);			return response;		}		int stat = 0;		String message = "";		//TODO null salt		if (RealmService.resetPassword(userid, newPassword, null)) {			stat = 0;														message = "Reset password OK";					} else {			stat = -1; //TODO retstat FAILED			message = "Reset password failed";		}				response.addMessage(new Message(stat, Message.INFO, message));					response.endResponse(stat);				Log.logStr(this, Log.LOG_TYPE_INFO, "execute()", message +" for user=[" +userid +"]");		return response;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -