コード例 #1
0
 private String findVersionFromChannel(Channel channel) {
   for (DistChannelMap map : channel.getDistChannelMaps()) {
     ChannelVersion ver = ChannelVersion.getChannelVersionForDistChannelMap(map);
     if (ver != null) {
       return ver.getVersion();
     }
   }
   return null;
 }
コード例 #2
0
  private List findChannelsByVersion(User user, String version) {

    if (version == null) {
      return null;
    }
    List<Channel> channels = ChannelFactory.listRedHatBaseChannels(user);
    List toReturn = new ArrayList();
    for (Channel chan : channels) {
      for (DistChannelMap map : chan.getDistChannelMaps()) {
        if (ChannelVersion.getChannelVersionForDistChannelMap(map).getVersion().equals(version)) {
          toReturn.add(chan);
          break;
        }
      }
    }
    return toReturn;
  }