public static boolean checkVirtualPoolProtocols(VirtualPool cos,HashSet<String> protocols,boolean matchAll){
  if ((protocols != null) && !protocols.isEmpty()) {
    StringSet cosProtocols=cos.getProtocols();
    if ((matchAll) && (!cosProtocols.containsAll(protocols))) {
      _log.info("vpool does not support all requested protocol(s): {}",protocols);
      return false;
    }
 else     if (!matchAll) {
      boolean hasMatch=false;
      Iterator<String> protocolIter=protocols.iterator();
      while (protocolIter.hasNext()) {
        String protocol=protocolIter.next();
        if (cosProtocols.contains(protocol)) {
          _log.debug("vpool supports protocol {}",protocol);
          hasMatch=true;
          break;
        }
      }
      return hasMatch;
    }
  }
  return true;
}

public static boolean checkVirtualPoolProtocols ( VirtualPool cos , HashSet < String > protocols , boolean matchAll ) { if ( ( protocols != null ) && ! protocols . isEmpty ( ) ) { StringSet cosProtocols = cos . getProtocols ( ) ; if ( ( matchAll ) && ( ! cosProtocols . containsAll ( protocols ) ) ) { _log . info ( "vpool does not support all requested protocol(s): {}" , protocols ) ; return false ; } else if ( ! matchAll ) { boolean hasMatch = false ; Iterator < String > protocolIter = protocols . iterator ( ) ; while ( protocolIter . hasNext ( ) ) { String protocol = protocolIter . next ( ) ; if ( cosProtocols . contains ( protocol ) ) { _log . debug ( "vpool supports protocol {}" , protocol ) ; hasMatch = true ; break ; } } return hasMatch ; } } return true ; }
check if the virtualpool contains the passed protocols . if the matchall parameter is true , the call returns true only if the virtualpool contains all the passed protocols . otherwise , the call returns true if the virtualpool contains at least one of the passed protocols .
