Coverage Report - org.kuali.rice.kew.rule.service.impl.RuleDelegationCacheProcessorImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleDelegationCacheProcessorImpl
0%
0/12
0%
0/4
1.667
 
 1  
 /*
 2  
  * Copyright 2010 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.rice.kew.rule.service.impl;
 17  
 
 18  
 import org.kuali.rice.kew.rule.service.RuleDelegationCacheProcessor;
 19  
 import org.kuali.rice.kew.util.PerformanceLogger;
 20  
 import org.kuali.rice.ksb.api.KsbApiServiceLocator;
 21  
 
 22  0
 public class RuleDelegationCacheProcessorImpl implements RuleDelegationCacheProcessor {
 23  
 
 24  0
         private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(RuleDelegationCacheProcessorImpl.class);
 25  
         
 26  
         public void clearRuleDelegationFromCache(String responsibilityId) {
 27  0
                 PerformanceLogger logger = new PerformanceLogger();
 28  0
                 if (responsibilityId != null) {
 29  0
                         flushListFromCache(responsibilityId);
 30  
                 }
 31  0
                 logger.log("Time to notify cache of rule delegation change for responsibility id=" + responsibilityId);
 32  0
         }
 33  
         
 34  
         protected void flushListFromCache(String responsibilityId) {
 35  0
                 if (LOG.isInfoEnabled())
 36  0
                         LOG.info("Flushing delegation rules from Cache for responsibilityId='" + responsibilityId );
 37  0
         KsbApiServiceLocator.getCacheAdministrator().flushEntry(getRuleDlgnCacheKey(responsibilityId));
 38  0
     }
 39  
         
 40  
         protected String getRuleDlgnCacheKey(String responsibilityId) {
 41  0
         return "RuleDlgnCache:" + responsibilityId;
 42  
     }
 43  
         
 44  
 }