1 /* 2 * Copyright 2004 Blandware (http://www.blandware.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.blandware.atleap.service.core; 17 18 import com.blandware.atleap.common.util.PartialCollection; 19 import com.blandware.atleap.common.util.QueryInfo; 20 import com.blandware.atleap.model.core.Role; 21 import com.blandware.atleap.service.exception.BeanAlreadyExistsException; 22 import com.blandware.atleap.service.exception.BeanNotFoundException; 23 import com.blandware.atleap.persistence.core.RoleDAO; 24 25 /** 26 * <p>Business Delegate (Proxy) Interface to handle communication between web and 27 * persistence layer. 28 * </p> 29 * <p><a HREF="RoleManager.java.htm"><i>View Source</i></a> 30 * </p> 31 * 32 * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com"><sergey.zubtcovskii@blandware.com></a> 33 * @version $Revision: 1.9 $ $Date: 2005/11/04 08:10:11 $ 34 */ 35 public interface RoleManager extends BaseManager { 36 37 /** 38 * Sets DAO for operating with roles 39 * 40 * @param dao the DAO to set 41 */ 42 public void setRoleDAO(RoleDAO dao); 43 44 // ~ CRUD Methods ================================================================ 45 46 /** 47 * Creates new role 48 * 49 * @param role Value object that represents what role must be created 50 */ 51 public void createRole(Role role) throws BeanAlreadyExistsException; 52 53 /** 54 * Retrieves role with specified name 55 * 56 * @param roleName Name to search by 57 * @return Role or null if no role with specified name exists in database 58 */ 59 public Role retrieveRole(String roleName); 60 61 /** 62 * Updates role 63 * 64 * @param role Role to update 65 */ 66 public void updateRole(Role role) throws BeanAlreadyExistsException; 67 68 /** 69 * Deletes role with specified name 70 * 71 * @param roleName Name of role to delete 72 */ 73 public void deleteRole(String roleName) throws BeanNotFoundException; 74 75 // ~ Additional methods ================================================================ 76 77 /** 78 * Retrieves filtered/sorted collection of roles. 79 * 80 * @param queryInfo Object that contains information about how to filter and sort data 81 * @return Collection of roles 82 */ 83 public PartialCollection listRoles(QueryInfo queryInfo); 84 }