private Map<URI,Integer> validateBlockObjectsAndGetMap(List<VolumeParam> volumes,ExportGroup exportGroup,Map<URI,Map<URI,Integer>> storageMap){
  if (volumes != null) {
    validateVolumeLunIdParam(volumes);
    Map<URI,String> systemURIToSystemTypeMap=new HashMap<>();
    for (    VolumeParam volumeParam : volumes) {
      BlockObject block=getAndValidateVolume(exportGroup,volumeParam.getId());
      Integer lun=volumeParam.getLun();
      if (block != null) {
        if (block instanceof BlockSnapshot) {
          BlockSnapshot snapshot=(BlockSnapshot)block;
          checkIfOpenStackSnapshot(snapshot);
          checkForActiveBlockSnapshot(snapshot);
        }
 else         if (block instanceof Volume) {
          if (lun != ExportGroup.LUN_UNASSIGNED && isCinderVolume((Volume)block,systemURIToSystemTypeMap)) {
            _log.info("User specified HLU ({}) is ignored for cinder type volume" + " since Cinder API does not take HLU while exporting.",lun);
            lun=ExportGroup.LUN_UNASSIGNED;
          }
        }
      }
      exportGroup.addVolume(volumeParam.getId(),lun);
    }
  }
  storageMap.putAll(ExportUtils.getStorageToVolumeMap(exportGroup,false,_dbClient));
  Map<URI,Integer> volumeMap=new HashMap<URI,Integer>();
  for (  URI storage : storageMap.keySet()) {
    volumeMap.putAll(storageMap.get(storage));
  }
  return volumeMap;
}

private Map < URI , Integer > validateBlockObjectsAndGetMap ( List < VolumeParam > volumes , ExportGroup exportGroup , Map < URI , Map < URI , Integer > > storageMap ) { if ( volumes != null ) { validateVolumeLunIdParam ( volumes ) ; Map < URI , String > systemURIToSystemTypeMap = new HashMap < > ( ) ; for ( VolumeParam volumeParam : volumes ) { BlockObject block = getAndValidateVolume ( exportGroup , volumeParam . getId ( ) ) ; Integer lun = volumeParam . getLun ( ) ; if ( block != null ) { if ( block instanceof BlockSnapshot ) { BlockSnapshot snapshot = ( BlockSnapshot ) block ; checkIfOpenStackSnapshot ( snapshot ) ; checkForActiveBlockSnapshot ( snapshot ) ; } else if ( block instanceof Volume ) { if ( lun != ExportGroup . LUN_UNASSIGNED && isCinderVolume ( ( Volume ) block , systemURIToSystemTypeMap ) ) { _log . info ( "User specified HLU ({}) is ignored for cinder type volume" + " since Cinder API does not take HLU while exporting." , lun ) ; lun = ExportGroup . LUN_UNASSIGNED ; } } } exportGroup . addVolume ( volumeParam . getId ( ) , lun ) ; } } storageMap . putAll ( ExportUtils . getStorageToVolumeMap ( exportGroup , false , _dbClient ) ) ; Map < URI , Integer > volumeMap = new HashMap < URI , Integer > ( ) ; for ( URI storage : storageMap . keySet ( ) ) { volumeMap . putAll ( storageMap . get ( storage ) ) ; } return volumeMap ; }
this is a helper function to perform the input validation for an export group volumes and snapshots and return the map to be sent to the controller .
