class DbusEventBufferMult {

  public DbusFilter constructFilters(Collection<DatabusSubscription> subs) throws DatabusException
  {
    HashMap<PhysicalPartition, PhysicalPartitionDbusFilter> filterMap = null;
    for (DatabusSubscription sub: subs)
    {
      PhysicalPartition ppart = sub.getPhysicalPartition();
      if (sub.getLogicalSource().isWildcard())
      {
        if (!ppart.isWildcard())
        {
          if (null == filterMap) filterMap = new HashMap<PhysicalPartition, PhysicalPartitionDbusFilter>(10);
          filterMap.put(ppart, new PhysicalPartitionDbusFilter(ppart, null));
        }
        else
        {
          LOG.warn("ignoring subscription with both physical partition and logical source wildcards");
        }
      }
      else
      {
        PhysicalPartitionDbusFilter ppartFilter = null != filterMap ? filterMap.get(ppart) : null;
        LogicalSourceAndPartitionDbusFilter logFilter = null;
        if (null == ppartFilter)
        {
          logFilter = new LogicalSourceAndPartitionDbusFilter();
          ppartFilter = new PhysicalPartitionDbusFilter(ppart, logFilter);
          if (null == filterMap) filterMap = new HashMap<PhysicalPartition, PhysicalPartitionDbusFilter>(10);
          filterMap.put(ppart, ppartFilter);
        }
        else
        {
          logFilter = (LogicalSourceAndPartitionDbusFilter)ppartFilter.getNestedFilter();
        }

        if (null != logFilter) logFilter.addSourceCondition(sub.getLogicalPartition());
        else LOG.error("unexpected null filter for logical source");
      }
    }

    if (0 == filterMap.size()) return AllowAllDbusFilter.THE_INSTANCE;
    else if (1 == filterMap.size())
    {
      DbusFilter result = filterMap.entrySet().iterator().next().getValue();
      return result;
    }
    else {
      ConjunctionDbusFilter result = new ConjunctionDbusFilter();
      for (Map.Entry<PhysicalPartition, PhysicalPartitionDbusFilter> filterEntry: filterMap.entrySet())
      {
        result.addFilter(filterEntry.getValue());
      }
      return result;
    }
  }

  public  DbusEventBufferMult();
  public  DbusEventBufferMult(PhysicalSourceStaticConfig [] pConfigs,
                             DbusEventBuffer.StaticConfig config,
                             DbusEventFactory eventFactory);

}