Coverage Report - org.mule.example.geomail.routing.InCacheFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
InCacheFilter
0%
0/10
0%
0/2
1.333
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.example.geomail.routing;
 8  
 
 9  
 import org.mule.api.MuleMessage;
 10  
 import org.mule.api.routing.filter.Filter;
 11  
 import org.mule.example.geomail.dao.SenderDao;
 12  
 
 13  
 /**
 14  
  * TODO
 15  
  */
 16  0
 public class InCacheFilter implements Filter
 17  
 {
 18  0
     private SenderDao senderDao = null;
 19  
 
 20  
     public boolean accept(MuleMessage message)
 21  
     {
 22  0
         boolean result = false;
 23  
 
 24  0
         String ip = (String)message.getPayload();
 25  
 
 26  
         // If 'ip' is found in DAO, accept it:
 27  0
         if (getSenderDao().getSender(ip) != null)
 28  
         {
 29  0
             result = true;
 30  
         }
 31  
 
 32  0
         return result;
 33  
     }
 34  
 
 35  
     public SenderDao getSenderDao()
 36  
     {
 37  0
         return senderDao;
 38  
     }
 39  
 
 40  
     public void setSenderDao(SenderDao senderDao)
 41  
     {
 42  0
         this.senderDao = senderDao;
 43  0
     }
 44  
 }