]> source.dussan.org Git - archiva.git/blob
c131aef61181b42af9d4c8520b4e13bd4278f0ab
[archiva.git] /
1 package org.apache.archiva.redback.rbac.cached;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import org.apache.archiva.redback.components.cache.Cache;
23 import org.apache.archiva.redback.rbac.Operation;
24 import org.apache.archiva.redback.rbac.Permission;
25 import org.apache.archiva.redback.rbac.RBACManager;
26 import org.apache.archiva.redback.rbac.RBACManagerListener;
27 import org.apache.archiva.redback.rbac.RbacManagerException;
28 import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
29 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
30 import org.apache.archiva.redback.rbac.Resource;
31 import org.apache.archiva.redback.rbac.Role;
32 import org.apache.archiva.redback.rbac.UserAssignment;
33 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory;
35 import org.springframework.stereotype.Service;
36
37 import javax.inject.Inject;
38 import javax.inject.Named;
39 import java.util.Collection;
40 import java.util.List;
41 import java.util.Map;
42 import java.util.Set;
43
44 /**
45  * CachedRbacManager is a wrapped RBACManager with caching.
46  *
47  * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
48  */
49 @Service("rbacManager#cached")
50 public class CachedRbacManager
51     implements RBACManager, RBACManagerListener
52 {
53
54     private Logger log = LoggerFactory.getLogger( getClass() );
55
56     @Inject
57     @Named(value = "rbacManager#jdo")
58     private RBACManager rbacImpl;
59
60     @Inject
61     @Named(value = "cache#operations")
62     private Cache operationsCache;
63
64     @Inject
65     @Named(value = "cache#permissions")
66     private Cache permissionsCache;
67
68     @Inject
69     @Named(value = "cache#resources")
70     private Cache resourcesCache;
71
72     @Inject
73     @Named(value = "cache#roles")
74     private Cache rolesCache;
75
76     @Inject
77     @Named(value = "cache#userAssignments")
78     private Cache userAssignmentsCache;
79
80     @Inject
81     @Named(value = "cache#userPermissions")
82     private Cache userPermissionsCache;
83
84     @Inject
85     @Named(value = "cache#effectiveRoleSet")
86     private Cache effectiveRoleSetCache;
87
88     public void addChildRole( Role role, Role childRole )
89         throws RbacObjectInvalidException, RbacManagerException
90     {
91         try
92         {
93             this.rbacImpl.addChildRole( role, childRole );
94         }
95         finally
96         {
97             invalidateCachedRole( role );
98             invalidateCachedRole( childRole );
99         }
100     }
101
102     public void addListener( RBACManagerListener listener )
103     {
104         this.rbacImpl.addListener( listener );
105     }
106
107     public Operation createOperation( String name )
108         throws RbacManagerException
109     {
110         operationsCache.remove( name );
111         return this.rbacImpl.createOperation( name );
112     }
113
114     public Permission createPermission( String name )
115         throws RbacManagerException
116     {
117         permissionsCache.remove( name );
118         return this.rbacImpl.createPermission( name );
119     }
120
121     public Permission createPermission( String name, String operationName, String resourceIdentifier )
122         throws RbacManagerException
123     {
124         permissionsCache.remove( name );
125         return this.rbacImpl.createPermission( name, operationName, resourceIdentifier );
126     }
127
128     public Resource createResource( String identifier )
129         throws RbacManagerException
130     {
131         resourcesCache.remove( identifier );
132         return this.rbacImpl.createResource( identifier );
133     }
134
135     public Role createRole( String name )
136     {
137         rolesCache.remove( name );
138         return this.rbacImpl.createRole( name );
139     }
140
141     public UserAssignment createUserAssignment( String principal )
142         throws RbacManagerException
143     {
144         invalidateCachedUserAssignment( principal );
145         return this.rbacImpl.createUserAssignment( principal );
146     }
147
148     public void eraseDatabase()
149     {
150         try
151         {
152             this.rbacImpl.eraseDatabase();
153         }
154         finally
155         {
156             // FIXME cleanup
157             //EhcacheUtils.clearAllCaches( log() );
158         }
159     }
160
161     /**
162      * @see org.apache.archiva.redback.rbac.RBACManager#getAllAssignableRoles()
163      */
164     public List<Role> getAllAssignableRoles()
165         throws RbacManagerException, RbacObjectNotFoundException
166     {
167         log.debug( "NOT CACHED - .getAllAssignableRoles()" );
168         return this.rbacImpl.getAllAssignableRoles();
169     }
170
171     public List<Operation> getAllOperations()
172         throws RbacManagerException
173     {
174         log.debug( "NOT CACHED - .getAllOperations()" );
175         return this.rbacImpl.getAllOperations();
176     }
177
178     public List<Permission> getAllPermissions()
179         throws RbacManagerException
180     {
181         log.debug( "NOT CACHED - .getAllPermissions()" );
182         return this.rbacImpl.getAllPermissions();
183     }
184
185     public List<Resource> getAllResources()
186         throws RbacManagerException
187     {
188         log.debug( "NOT CACHED - .getAllResources()" );
189         return this.rbacImpl.getAllResources();
190     }
191
192     public List<Role> getAllRoles()
193         throws RbacManagerException
194     {
195         log.debug( "NOT CACHED - .getAllRoles()" );
196         return this.rbacImpl.getAllRoles();
197     }
198
199     public List<UserAssignment> getAllUserAssignments()
200         throws RbacManagerException
201     {
202         log.debug( "NOT CACHED - .getAllUserAssignments()" );
203         return this.rbacImpl.getAllUserAssignments();
204     }
205
206     /**
207      * @see org.apache.archiva.redback.rbac.RBACManager#getAssignedPermissionMap(java.lang.String)
208      */
209     @SuppressWarnings("unchecked")
210     public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
211         throws RbacObjectNotFoundException, RbacManagerException
212     {
213         Map<String, List<Permission>> el = (Map<String, List<Permission>>) userPermissionsCache.get( principal );
214
215         if ( el != null )
216         {
217             log.debug( "using cached user permission map" );
218             return el;
219         }
220
221         log.debug( "building user permission map" );
222         Map<String, List<Permission>> userPermMap = this.rbacImpl.getAssignedPermissionMap( principal );
223         userPermissionsCache.put( principal, userPermMap );
224         return userPermMap;
225
226     }
227
228     public Set<Permission> getAssignedPermissions( String principal )
229         throws RbacObjectNotFoundException, RbacManagerException
230     {
231         log.debug( "NOT CACHED - .getAssignedPermissions(String)" );
232         return this.rbacImpl.getAssignedPermissions( principal );
233     }
234
235     public Collection<Role> getAssignedRoles( String principal )
236         throws RbacObjectNotFoundException, RbacManagerException
237     {
238         log.debug( "NOT CACHED - .getAssignedRoles(String)" );
239         return this.rbacImpl.getAssignedRoles( principal );
240     }
241
242     public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
243         throws RbacObjectNotFoundException, RbacManagerException
244     {
245         log.debug( "NOT CACHED - .getAssignedRoles(UserAssignment)" );
246         return this.rbacImpl.getAssignedRoles( userAssignment );
247     }
248
249     public Map<String, Role> getChildRoles( Role role )
250         throws RbacManagerException
251     {
252         log.debug( "NOT CACHED - .getChildRoles(Role)" );
253         return this.rbacImpl.getChildRoles( role );
254     }
255
256     public Map<String, Role> getParentRoles( Role role )
257         throws RbacManagerException
258     {
259         log.debug( "NOT CACHED - .getParentRoles(Role)" );
260         return this.rbacImpl.getParentRoles( role );
261     }
262
263     public Collection<Role> getEffectivelyAssignedRoles( String principal )
264         throws RbacObjectNotFoundException, RbacManagerException
265     {
266         log.debug( "NOT CACHED - .getEffectivelyAssignedRoles(String)" );
267         return this.rbacImpl.getEffectivelyAssignedRoles( principal );
268     }
269
270     public Collection<Role> getEffectivelyUnassignedRoles( String principal )
271         throws RbacManagerException, RbacObjectNotFoundException
272     {
273         log.debug( "NOT CACHED - .getEffectivelyUnassignedRoles(String)" );
274         return this.rbacImpl.getEffectivelyUnassignedRoles( principal );
275     }
276
277     @SuppressWarnings("unchecked")
278     public Set<Role> getEffectiveRoles( Role role )
279         throws RbacObjectNotFoundException, RbacManagerException
280     {
281         Set<Role> el = (Set<Role>) effectiveRoleSetCache.get( role.getName() );
282
283         if ( el != null )
284         {
285             log.debug( "using cached effective role set" );
286             return el;
287         }
288         else
289         {
290             log.debug( "building effective role set" );
291             Set<Role> effectiveRoleSet = this.rbacImpl.getEffectiveRoles( role );
292             effectiveRoleSetCache.put( role.getName(), effectiveRoleSet );
293             return effectiveRoleSet;
294         }
295     }
296
297     public Resource getGlobalResource()
298         throws RbacManagerException
299     {
300         /* this is very light */
301         log.debug( "NOT CACHED - .getGlobalResource()" );
302         return this.rbacImpl.getGlobalResource();
303     }
304
305     public Operation getOperation( String operationName )
306         throws RbacObjectNotFoundException, RbacManagerException
307     {
308         Object el = operationsCache.get( operationName );
309         if ( el != null )
310         {
311             return (Operation) el;
312         }
313         else
314         {
315             Operation operation = this.rbacImpl.getOperation( operationName );
316             operationsCache.put( operationName, operation );
317             return operation;
318         }
319     }
320
321     public Permission getPermission( String permissionName )
322         throws RbacObjectNotFoundException, RbacManagerException
323     {
324         Object el = permissionsCache.get( permissionName );
325         if ( el != null )
326         {
327             return (Permission) el;
328         }
329         else
330         {
331             Permission permission = this.rbacImpl.getPermission( permissionName );
332             permissionsCache.put( permissionName, permission );
333             return permission;
334         }
335     }
336
337     public Resource getResource( String resourceIdentifier )
338         throws RbacObjectNotFoundException, RbacManagerException
339     {
340         Object el = resourcesCache.get( resourceIdentifier );
341         if ( el != null )
342         {
343             return (Resource) el;
344         }
345         else
346         {
347             Resource resource = this.rbacImpl.getResource( resourceIdentifier );
348             resourcesCache.put( resourceIdentifier, resource );
349             return resource;
350         }
351     }
352
353     public Role getRole( String roleName )
354         throws RbacObjectNotFoundException, RbacManagerException
355     {
356         Object el = rolesCache.get( roleName );
357         if ( el != null )
358         {
359             return (Role) el;
360         }
361         else
362         {
363             Role role = this.rbacImpl.getRole( roleName );
364             rolesCache.put( roleName, role );
365             return role;
366         }
367     }
368
369     public Map<String, Role> getRoles( Collection<String> roleNames )
370         throws RbacObjectNotFoundException, RbacManagerException
371     {
372         log.debug( "NOT CACHED - .getRoles(Collection)" );
373         return this.rbacImpl.getRoles( roleNames );
374     }
375
376     public Collection<Role> getUnassignedRoles( String principal )
377         throws RbacManagerException, RbacObjectNotFoundException
378     {
379         log.debug( "NOT CACHED - .getUnassignedRoles(String)" );
380         return this.rbacImpl.getUnassignedRoles( principal );
381     }
382
383     public UserAssignment getUserAssignment( String principal )
384         throws RbacObjectNotFoundException, RbacManagerException
385     {
386         Object el = userAssignmentsCache.get( principal );
387         if ( el != null )
388         {
389             return (UserAssignment) el;
390         }
391         else
392         {
393             UserAssignment userAssignment = this.rbacImpl.getUserAssignment( principal );
394             userAssignmentsCache.put( principal, userAssignment );
395             return userAssignment;
396         }
397     }
398
399     public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
400         throws RbacManagerException
401     {
402         log.debug( "NOT CACHED - .getUserAssignmentsForRoles(Collection)" );
403         return this.rbacImpl.getUserAssignmentsForRoles( roleNames );
404     }
405
406     public boolean operationExists( Operation operation )
407     {
408         if ( operation == null )
409         {
410             return false;
411         }
412
413         if ( operationsCache.hasKey( operation.getName() ) )
414         {
415             return true;
416         }
417
418         return this.rbacImpl.operationExists( operation );
419     }
420
421     public boolean operationExists( String name )
422     {
423         if ( operationsCache.hasKey( name ) )
424         {
425             return true;
426         }
427
428         return this.rbacImpl.operationExists( name );
429     }
430
431     public boolean permissionExists( Permission permission )
432     {
433         if ( permission == null )
434         {
435             return false;
436         }
437
438         if ( permissionsCache.hasKey( permission.getName() ) )
439         {
440             return true;
441         }
442
443         return this.rbacImpl.permissionExists( permission );
444     }
445
446     public boolean permissionExists( String name )
447     {
448         if ( permissionsCache.hasKey( name ) )
449         {
450             return true;
451         }
452
453         return this.rbacImpl.permissionExists( name );
454     }
455
456     public void rbacInit( boolean freshdb )
457     {
458         if ( rbacImpl instanceof RBACManagerListener )
459         {
460             ( (RBACManagerListener) this.rbacImpl ).rbacInit( freshdb );
461         }
462         // lookup all Cache and clear all ?
463         this.resourcesCache.clear();
464         this.operationsCache.clear();
465         this.permissionsCache.clear();
466         this.rolesCache.clear();
467         this.userAssignmentsCache.clear();
468         this.userPermissionsCache.clear();
469     }
470
471     public void rbacPermissionRemoved( Permission permission )
472     {
473         if ( rbacImpl instanceof RBACManagerListener )
474         {
475             ( (RBACManagerListener) this.rbacImpl ).rbacPermissionRemoved( permission );
476         }
477
478         invalidateCachedPermission( permission );
479     }
480
481     public void rbacPermissionSaved( Permission permission )
482     {
483         if ( rbacImpl instanceof RBACManagerListener )
484         {
485             ( (RBACManagerListener) this.rbacImpl ).rbacPermissionSaved( permission );
486         }
487
488         invalidateCachedPermission( permission );
489     }
490
491     public void rbacRoleRemoved( Role role )
492     {
493         if ( rbacImpl instanceof RBACManagerListener )
494         {
495             ( (RBACManagerListener) this.rbacImpl ).rbacRoleRemoved( role );
496         }
497
498         invalidateCachedRole( role );
499     }
500
501     public void rbacRoleSaved( Role role )
502     {
503         if ( rbacImpl instanceof RBACManagerListener )
504         {
505             ( (RBACManagerListener) this.rbacImpl ).rbacRoleSaved( role );
506         }
507
508         invalidateCachedRole( role );
509     }
510
511     public void rbacUserAssignmentRemoved( UserAssignment userAssignment )
512     {
513         if ( rbacImpl instanceof RBACManagerListener )
514         {
515             ( (RBACManagerListener) this.rbacImpl ).rbacUserAssignmentRemoved( userAssignment );
516         }
517
518         invalidateCachedUserAssignment( userAssignment );
519     }
520
521     public void rbacUserAssignmentSaved( UserAssignment userAssignment )
522     {
523         if ( rbacImpl instanceof RBACManagerListener )
524         {
525             ( (RBACManagerListener) this.rbacImpl ).rbacUserAssignmentSaved( userAssignment );
526         }
527
528         invalidateCachedUserAssignment( userAssignment );
529     }
530
531     public void removeListener( RBACManagerListener listener )
532     {
533         this.rbacImpl.removeListener( listener );
534     }
535
536     public void removeOperation( Operation operation )
537         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
538     {
539         invalidateCachedOperation( operation );
540         this.rbacImpl.removeOperation( operation );
541     }
542
543     public void removeOperation( String operationName )
544         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
545     {
546         operationsCache.remove( operationName );
547         this.rbacImpl.removeOperation( operationName );
548     }
549
550     public void removePermission( Permission permission )
551         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
552     {
553         invalidateCachedPermission( permission );
554         this.rbacImpl.removePermission( permission );
555     }
556
557     public void removePermission( String permissionName )
558         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
559     {
560         permissionsCache.remove( permissionName );
561         this.rbacImpl.removePermission( permissionName );
562     }
563
564     public void removeResource( Resource resource )
565         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
566     {
567         invalidateCachedResource( resource );
568         this.rbacImpl.removeResource( resource );
569     }
570
571     public void removeResource( String resourceIdentifier )
572         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
573     {
574         resourcesCache.remove( resourceIdentifier );
575         this.rbacImpl.removeResource( resourceIdentifier );
576     }
577
578     public void removeRole( Role role )
579         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
580     {
581         invalidateCachedRole( role );
582         this.rbacImpl.removeRole( role );
583     }
584
585     public void removeRole( String roleName )
586         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
587     {
588         rolesCache.remove( roleName );
589         this.rbacImpl.removeRole( roleName );
590     }
591
592     public void removeUserAssignment( String principal )
593         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
594     {
595         invalidateCachedUserAssignment( principal );
596         this.rbacImpl.removeUserAssignment( principal );
597     }
598
599     public void removeUserAssignment( UserAssignment userAssignment )
600         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
601     {
602         invalidateCachedUserAssignment( userAssignment );
603         this.rbacImpl.removeUserAssignment( userAssignment );
604     }
605
606     public boolean resourceExists( Resource resource )
607     {
608         if ( resourcesCache.hasKey( resource.getIdentifier() ) )
609         {
610             return true;
611         }
612
613         return this.rbacImpl.resourceExists( resource );
614     }
615
616     public boolean resourceExists( String identifier )
617     {
618         if ( resourcesCache.hasKey( identifier ) )
619         {
620             return true;
621         }
622
623         return this.rbacImpl.resourceExists( identifier );
624     }
625
626     public boolean roleExists( Role role )
627     {
628         if ( rolesCache.hasKey( role.getName() ) )
629         {
630             return true;
631         }
632
633         return this.rbacImpl.roleExists( role );
634     }
635
636     public boolean roleExists( String name )
637     {
638         if ( rolesCache.hasKey( name ) )
639         {
640             return true;
641         }
642
643         return this.rbacImpl.roleExists( name );
644     }
645
646     public Operation saveOperation( Operation operation )
647         throws RbacObjectInvalidException, RbacManagerException
648     {
649         invalidateCachedOperation( operation );
650         return this.rbacImpl.saveOperation( operation );
651     }
652
653     public Permission savePermission( Permission permission )
654         throws RbacObjectInvalidException, RbacManagerException
655     {
656         invalidateCachedPermission( permission );
657         return this.rbacImpl.savePermission( permission );
658     }
659
660     public Resource saveResource( Resource resource )
661         throws RbacObjectInvalidException, RbacManagerException
662     {
663         invalidateCachedResource( resource );
664         return this.rbacImpl.saveResource( resource );
665     }
666
667     public synchronized Role saveRole( Role role )
668         throws RbacObjectInvalidException, RbacManagerException
669     {
670         /*
671         List assignments = this.rbacImpl.getUserAssignmentsForRoles( Collections.singletonList( role.getName() ) );
672
673         for ( Iterator i = assignments.iterator(); i.hasNext();  )
674         {
675             log.debug( "invalidating user assignment with role " + role.getName() );
676             invalidateCachedUserAssignment( (UserAssignment)i.next() );
677         }
678         */
679
680         /*
681         the above commented out section would try and invalidate just that user caches that are effected by
682         changes in the users permissions map due to role changes.
683
684         however the implementations of those do not take into account child role hierarchies so wipe all
685         user caches on role saving...which is a heavy handed way to solve the problem, but not going to
686         happen frequently for current applications so not a huge deal.
687          */
688         invalidateAllCachedUserAssignments();
689         invalidateCachedRole( role );
690         return this.rbacImpl.saveRole( role );
691     }
692
693     public synchronized void saveRoles( Collection<Role> roles )
694         throws RbacObjectInvalidException, RbacManagerException
695     {
696
697         for ( Role role : roles )
698         {
699             invalidateCachedRole( role );
700         }
701
702         /*
703         List assignments = this.rbacImpl.getUserAssignmentsForRoles( roles );
704
705         for ( Iterator i = assignments.iterator(); i.hasNext();  )
706         {
707             log.debug( "invalidating user assignment with roles" );
708             invalidateCachedUserAssignment( (UserAssignment)i.next() );
709         }
710         */
711         invalidateAllCachedUserAssignments();
712         this.rbacImpl.saveRoles( roles );
713     }
714
715     public UserAssignment saveUserAssignment( UserAssignment userAssignment )
716         throws RbacObjectInvalidException, RbacManagerException
717     {
718         invalidateCachedUserAssignment( userAssignment );
719         return this.rbacImpl.saveUserAssignment( userAssignment );
720     }
721
722     public boolean userAssignmentExists( String principal )
723     {
724         if ( userAssignmentsCache.hasKey( principal ) )
725         {
726             return true;
727         }
728
729         return this.rbacImpl.userAssignmentExists( principal );
730     }
731
732     public boolean userAssignmentExists( UserAssignment assignment )
733     {
734         if ( userAssignmentsCache.hasKey( assignment.getPrincipal() ) )
735         {
736             return true;
737         }
738
739         return this.rbacImpl.userAssignmentExists( assignment );
740     }
741
742     private void invalidateCachedRole( Role role )
743     {
744         if ( role != null )
745         {
746             rolesCache.remove( role.getName() );
747             // if a role changes we need to invalidate the entire effective role set cache
748             // since we have no concept of the heirarchy involved in the role sets
749             effectiveRoleSetCache.clear();
750         }
751
752     }
753
754     private void invalidateCachedOperation( Operation operation )
755     {
756         if ( operation != null )
757         {
758             operationsCache.remove( operation.getName() );
759         }
760     }
761
762     private void invalidateCachedPermission( Permission permission )
763     {
764         if ( permission != null )
765         {
766             permissionsCache.remove( permission.getName() );
767         }
768     }
769
770     private void invalidateCachedResource( Resource resource )
771     {
772         if ( resource != null )
773         {
774             resourcesCache.remove( resource.getIdentifier() );
775         }
776     }
777
778     private void invalidateCachedUserAssignment( UserAssignment userAssignment )
779     {
780         if ( userAssignment != null )
781         {
782             userAssignmentsCache.remove( userAssignment.getPrincipal() );
783             userPermissionsCache.remove( userAssignment.getPrincipal() );
784         }
785     }
786
787     private void invalidateCachedUserAssignment( String principal )
788     {
789         userAssignmentsCache.remove( principal );
790         userPermissionsCache.remove( principal );
791     }
792
793     private void invalidateAllCachedUserAssignments()
794     {
795         userAssignmentsCache.clear();
796         userPermissionsCache.clear();
797     }
798
799     public Cache getOperationsCache()
800     {
801         return operationsCache;
802     }
803
804     public void setOperationsCache( Cache operationsCache )
805     {
806         this.operationsCache = operationsCache;
807     }
808
809     public Cache getPermissionsCache()
810     {
811         return permissionsCache;
812     }
813
814     public void setPermissionsCache( Cache permissionsCache )
815     {
816         this.permissionsCache = permissionsCache;
817     }
818
819     public Cache getResourcesCache()
820     {
821         return resourcesCache;
822     }
823
824     public void setResourcesCache( Cache resourcesCache )
825     {
826         this.resourcesCache = resourcesCache;
827     }
828
829     public Cache getRolesCache()
830     {
831         return rolesCache;
832     }
833
834     public void setRolesCache( Cache rolesCache )
835     {
836         this.rolesCache = rolesCache;
837     }
838
839     public Cache getUserAssignmentsCache()
840     {
841         return userAssignmentsCache;
842     }
843
844     public void setUserAssignmentsCache( Cache userAssignmentsCache )
845     {
846         this.userAssignmentsCache = userAssignmentsCache;
847     }
848
849     public Cache getUserPermissionsCache()
850     {
851         return userPermissionsCache;
852     }
853
854     public void setUserPermissionsCache( Cache userPermissionsCache )
855     {
856         this.userPermissionsCache = userPermissionsCache;
857     }
858
859     public Cache getEffectiveRoleSetCache()
860     {
861         return effectiveRoleSetCache;
862     }
863
864     public void setEffectiveRoleSetCache( Cache effectiveRoleSetCache )
865     {
866         this.effectiveRoleSetCache = effectiveRoleSetCache;
867     }
868
869     public RBACManager getRbacImpl()
870     {
871         return rbacImpl;
872     }
873
874     public void setRbacImpl( RBACManager rbacImpl )
875     {
876         this.rbacImpl = rbacImpl;
877     }
878 }