1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.service.impl; |
17 | |
|
18 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
19 | |
import org.kuali.rice.kim.bo.role.impl.RoleMemberAttributeDataImpl; |
20 | |
import org.kuali.rice.kim.util.KimConstants; |
21 | |
import org.kuali.rice.kns.service.BusinessObjectService; |
22 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
23 | |
import org.kuali.rice.kns.service.SequenceAccessorService; |
24 | |
import org.kuali.rice.ksb.cache.RiceCacheAdministrator; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class ResponsibilityServiceBase { |
33 | |
protected static final String RESPONSIBILITY_IMPL_CACHE_PREFIX = "ResponsibilityImpl-Template-"; |
34 | |
protected static final String RESPONSIBILITY_IMPL_CACHE_GROUP = "ResponsibilityImpl"; |
35 | |
protected static final String DEFAULT_RESPONSIBILITY_TYPE_SERVICE = "defaultResponsibilityTypeService"; |
36 | 0 | protected static final Integer DEFAULT_PRIORITY_NUMBER = Integer.valueOf(1); |
37 | |
|
38 | |
private SequenceAccessorService sequenceAccessorService; |
39 | |
private RiceCacheAdministrator cacheAdministrator; |
40 | |
|
41 | |
private BusinessObjectService businessObjectService; |
42 | |
|
43 | |
protected BusinessObjectService getBusinessObjectService() { |
44 | 0 | if ( businessObjectService == null ) { |
45 | 0 | businessObjectService = KNSServiceLocator.getBusinessObjectService(); |
46 | |
} |
47 | 0 | return businessObjectService; |
48 | |
} |
49 | |
|
50 | |
public void flushResponsibilityImplCache() { |
51 | 0 | getCacheAdministrator().flushGroup(RESPONSIBILITY_IMPL_CACHE_GROUP); |
52 | 0 | } |
53 | |
|
54 | |
protected String getResponsibilityImplByTemplateNameCacheKey( String namespaceCode, String responsibilityTemplateName ) { |
55 | 0 | return RESPONSIBILITY_IMPL_CACHE_PREFIX + namespaceCode + "-" + responsibilityTemplateName; |
56 | |
} |
57 | |
|
58 | |
protected String getNewAttributeDataId(){ |
59 | 0 | SequenceAccessorService sas = getSequenceAccessorService(); |
60 | 0 | Long nextSeq = sas.getNextAvailableSequenceNumber( |
61 | |
KimConstants.SequenceNames.KRIM_ATTR_DATA_ID_S, |
62 | |
RoleMemberAttributeDataImpl.class ); |
63 | 0 | return nextSeq.toString(); |
64 | |
} |
65 | |
|
66 | |
protected SequenceAccessorService getSequenceAccessorService() { |
67 | 0 | if ( sequenceAccessorService == null ) { |
68 | 0 | sequenceAccessorService = KNSServiceLocator.getSequenceAccessorService(); |
69 | |
} |
70 | 0 | return sequenceAccessorService; |
71 | |
} |
72 | |
|
73 | |
protected RiceCacheAdministrator getCacheAdministrator() { |
74 | 0 | if ( cacheAdministrator == null ) { |
75 | 0 | cacheAdministrator = KEWServiceLocator.getCacheAdministrator(); |
76 | |
} |
77 | 0 | return cacheAdministrator; |
78 | |
} |
79 | |
|
80 | |
|
81 | |
} |