View Javadoc

1   /**
2    * Copyright 2004-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 org.kuali.hr.time.roles.service;
17  
18  import org.kuali.hr.time.roles.TkRole;
19  import org.kuali.hr.time.roles.TkRoleGroup;
20  import org.springframework.cache.annotation.CacheEvict;
21  import org.springframework.cache.annotation.Cacheable;
22  
23  import java.util.List;
24  
25  public interface TkRoleGroupService {
26      @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
27  	public void saveOrUpdate(TkRoleGroup roleGroup);
28  	/**
29  	 * Save or Update a List of TkRole objects
30  	 * @param roleGroups
31  	 */
32      @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
33  	public void saveOrUpdate(List<TkRoleGroup> roleGroups);
34  
35      
36      /**
37       * Fetches Role by principal id
38       */
39      @Cacheable(value= TkRoleGroup.CACHE_NAME, key="'principalId=' + #p0")
40      public TkRoleGroup getRoleGroup(String principalId);
41      
42      public void populateRoles(TkRoleGroup tkRoleGroup);
43  
44      @Cacheable(value= TkRoleGroup.CACHE_NAME,
45              key="'principalId=' + #p0" +
46                      "+ '|' + 'principalName=' + #p1" +
47                      "+ '|' + 'workArea=' + #p2" +
48                      "+ '|' + 'dept=' + #p3" +
49                      "+ '|' + 'roleName=' + #p4")
50      List<TkRoleGroup> getRoleGroups(String principalId, String principalName, String workArea, String dept, String roleName);
51  }