/**
   * Delete Channels with the specified refId.
   *
   * @param refId The ReferenceId of the ChannelInfo and related profiles.
   */
  private void deleteChannel(String refId) throws Throwable {
    DataFilterImpl filter = new DataFilterImpl();
    filter.addSingleFilter(null, ChannelInfo.REF_ID, filter.getEqualOperator(), refId, false);
    // filter.addSingleFilter(filter.getAndConnector(), ChannelInfo.IS_MASTER,
    //  filter.getEqualOperator(), Boolean.TRUE, false);

    /** @todo to verify whether can just delete like that or don't delete */
    IChannelManagerObj mgr = ServiceLookupHelper.getChannelManager();
    Collection results = mgr.getChannelInfo(filter);
    for (Iterator i = results.iterator(); i.hasNext(); ) {
      ChannelInfo channel = (ChannelInfo) i.next();
      mgr.deleteChannelInfo((Long) channel.getKey());
      mgr.deleteCommInfo((Long) channel.getTptCommInfo().getKey());
      mgr.deletePackigingInfo((Long) channel.getPackagingProfile().getKey());
      mgr.deleteSecurityInfo((Long) channel.getSecurityProfile().getKey());
    }
  }