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

📄 removerole.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.acl.service;import org.butor.acl.AclService;import org.butor.acl.service.bean.RemoveRoleParam;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;/** * TODO *  * @author sawanai * Jul 5, 2004 */public class RemoveRole extends Service {	/**	 * 	 */	public RemoveRole() {		super(RemoveRoleParam.SERVICE_NAME);	}			public String getDescription() {		return "Remove role.";	}		/**	 * ParamBean class	 * @see org.butor.bls.IService#getParamBeanClass()	 */	public Class getServiceParamBeanClass() {		return RemoveRoleParam.class;	}	public IOutputResponse execute(IRequest request) throws ServiceException {		IOutputResponse response = request.createResponse();		RemoveRoleParam params = (RemoveRoleParam) getServiceParamBean(request);		String resource = params.getResource();		if (resource != null) {			resource = resource.trim();		}		if (resource == null || resource.length() == 0) {			response.addMessage(new Message(1000, Message.ERROR, "Missing param resource!"));			response.endResponse(1001);			return response;		}		String principal = params.getPrincipal();		if (principal != null) {			principal = principal.trim();		}		if (principal == null || principal.length() == 0) {			response.addMessage(new Message(1000, Message.ERROR, "Missing principal!"));			response.endResponse(1002);			return response;		}		String role = params.getRole();		if (role != null) {			role = role.trim();		}		if (role == null || role.length() == 0) {			response.addMessage(new Message(1000, Message.ERROR, "Missing role!"));			response.endResponse(1003);			return response;		}		if (!AclService.removeRole(resource, principal, role)) {			response.addMessage(new Message(1000, Message.ERROR, "Operation failed!"));			response.endResponse(1004);			return response;		}		response.endResponse(0);				Log.logStr(this, Log.INFO, "execute()", "emoved role: resource='" +resource+"' principal='" +principal +"' role='" +role +"'");		return response;	}}

⌨️ 快捷键说明

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