class HostConfigMappingDAO {

  @RequiresSession
  public Set<HostConfigMapping> findByType(final long clusterId, Long hostId, final String type) {
    populateCache();
    
    if (!hostConfigMappingByHost.containsKey(hostId))
      return Collections.emptySet();
      
    Set<HostConfigMapping> set = new HashSet<>(hostConfigMappingByHost.get(hostId));
     
    CollectionUtils.filter(set, new Predicate() {
        
      @Override
      public boolean evaluate(Object arg0) {
        return ((HostConfigMapping) arg0).getClusterId().equals(clusterId) 
            && ((HostConfigMapping) arg0).getType().equals(type);
      }
    });

    return set;
  }

}