getgroups.java

来自「一个实用工具类」· Java 代码 · 共 57 行

JAVA
57
字号
/* * 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.GetGroupsParam;import org.butor.acl.service.bean.GroupResult;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;/** * TODO *  * @author sawanai * Jul 5, 2004 */public class GetGroups extends Service {		public GetGroups() {		super(GetGroupsParam.SERVICE_NAME);	}	public String getDescription() {		return "Get ACL groups list";	}		public IOutputResponse execute(IRequest request) throws ServiceException {		IOutputResponse response = request.createResponse();		        String[] groups = AclService.getGroupsList();        if (groups == null) {			response.addMessage(new Message(1000, Message.ERROR, "Operation failed!"));			response.endResponse(1003);			return response;        }        response.startDataSet(GroupResult.class);        for (int ii=0; ii<groups.length; ii++) {        	GroupResult record = new GroupResult();        	record.setGroup(groups[ii]);        	response.addRecord(record);        }		response.endDataSet();		response.endResponse(0);				return response;	}}

⌨️ 快捷键说明

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