【Java开源代码栏目提醒】:网学会员为广大网友收集整理了,AuthManagerImpl.java,希望对大家有所帮助!
package org.appfuse.service.impl;
import java.util.List;
import org.appfuse.service.*;
import org.appfuse.dao.*;
import org.appfuse.model.*;
import org.appfuse.util.exception.*;
public class AuthManagerImpl
extends BaseManager implements AuthManager{
private AuthDAO dao;
/**
* Set the DAO for communication with the data layer.
*
* @param dao
*/
public void setAuthDAO(AuthDAO dao) {
this.dao = dao;
}
/**
* @see org.appfuse.service.UserManager#getUser(java.lang.String)
*/
public Auth getAuth(int authid) throws AppSystemException,
AppBusinessException {
Auth auth = null;
try {
auth = dao.getAuth(authid);
}
catch (Exception e) {
log.error("获取模块信息失败!", e);
throw new AppBusinessException(e.getMessage(), e, ExceptionConstants.SYS_GENERAL_ERR);
}
return auth;
}
/**
* @see org.appfuse.service.UserManager#getUser(java.lang.String)
*/
public Auth getAuth(int moduleid, int functionid) throws AppSystemException,
AppBusinessException {
Auth auth = null;
try {
auth = dao.getAuth(moduleid, functionid);
}
catch (Exception e) {
log.error("获取模块信息失败!", e);
throw new AppBusinessException(e.getMessage(), e, ExceptionConstants.SYS_GENERAL_ERR);
}
return auth;
}
/**
* @see org.appfuse.service.UserManager#saveUser(org.appfuse.model.User)
*/
public void saveAuth(Auth moduleAction) throws AppSystemException,
AppBusinessException {
try {
dao.saveAuth(moduleAction);
}
catch (Exception e) {
log.error("保存失败!", e);
throw new AppBusinessException(e.getMessage(), e,
ExceptionConstants.SYS_GENERAL_ERR);
}
}
/**
* @see org.appfuse.service.UserManager#removeUser(java.lang.String)
*/
public void removeAuth(Auth moduleAction) throws AppSystemException,
AppBusinessException {
try {
dao.removeAuth(moduleAction);
}
catch (Exception e) {
log.error("删除失败!", e);
throw new AppBusinessException(e.getMessage(), e,
ExceptionConstants.SYS_GENERAL_ERR);
}
}
}
上一篇:
AuthManager.java
下一篇:
法律专业开题报告范文