private StringSet discoverVolumeSnaps(StorageSystem system,List<Snap> snaps,String parentGUID,StringSet parentMatchedVPools,VNXeApiClient apiClient,DbClient dbClient,Map<String,List<UnManagedVolume>> hostVolumesMap,VNXeLun lun,boolean isSnapInCG,String cgName) throws Exception {
  StringSet snapsets=new StringSet();
  for (  Snap snapDetail : snaps) {
    UnManagedVolume unManagedVolume=null;
    String managedSnapNativeGuid=NativeGUIDGenerator.generateNativeGuidForVolumeOrBlockSnapShot(system.getNativeGuid(),snapDetail.getId());
    BlockSnapshot viprSnap=DiscoveryUtils.checkBlockSnapshotExistsInDB(dbClient,managedSnapNativeGuid);
    if (null != viprSnap) {
      log.info("Skipping snapshot {} as it is already managed by ViPR",managedSnapNativeGuid);
      snapsets.add(managedSnapNativeGuid);
      continue;
    }
    String unManagedVolumeNatvieGuid=NativeGUIDGenerator.generateNativeGuidForPreExistingVolume(system.getNativeGuid(),snapDetail.getId());
    unManagedVolume=DiscoveryUtils.checkUnManagedVolumeExistsInDB(dbClient,unManagedVolumeNatvieGuid);
    unManagedVolume=createUnManagedVolumeForSnap(unManagedVolume,unManagedVolumeNatvieGuid,lun,system,dbClient,hostVolumesMap,snapDetail);
    populateSnapInfo(unManagedVolume,snapDetail,parentGUID,parentMatchedVPools);
    snapsets.add(unManagedVolumeNatvieGuid);
    unManagedVolumesReturnedFromProvider.add(unManagedVolume.getId());
    if (isSnapInCG) {
      addObjectToUnManagedConsistencyGroup(apiClient,unManagedVolume,cgName,system,dbClient);
    }
  }
  return snapsets;
}

private StringSet discoverVolumeSnaps ( StorageSystem system , List < Snap > snaps , String parentGUID , StringSet parentMatchedVPools , VNXeApiClient apiClient , DbClient dbClient , Map < String , List < UnManagedVolume > > hostVolumesMap , VNXeLun lun , boolean isSnapInCG , String cgName ) throws Exception { StringSet snapsets = new StringSet ( ) ; for ( Snap snapDetail : snaps ) { UnManagedVolume unManagedVolume = null ; String managedSnapNativeGuid = NativeGUIDGenerator . generateNativeGuidForVolumeOrBlockSnapShot ( system . getNativeGuid ( ) , snapDetail . getId ( ) ) ; BlockSnapshot viprSnap = DiscoveryUtils . checkBlockSnapshotExistsInDB ( dbClient , managedSnapNativeGuid ) ; if ( null != viprSnap ) { log . info ( "Skipping snapshot {} as it is already managed by ViPR" , managedSnapNativeGuid ) ; snapsets . add ( managedSnapNativeGuid ) ; continue ; } String unManagedVolumeNatvieGuid = NativeGUIDGenerator . generateNativeGuidForPreExistingVolume ( system . getNativeGuid ( ) , snapDetail . getId ( ) ) ; unManagedVolume = DiscoveryUtils . checkUnManagedVolumeExistsInDB ( dbClient , unManagedVolumeNatvieGuid ) ; unManagedVolume = createUnManagedVolumeForSnap ( unManagedVolume , unManagedVolumeNatvieGuid , lun , system , dbClient , hostVolumesMap , snapDetail ) ; populateSnapInfo ( unManagedVolume , snapDetail , parentGUID , parentMatchedVPools ) ; snapsets . add ( unManagedVolumeNatvieGuid ) ; unManagedVolumesReturnedFromProvider . add ( unManagedVolume . getId ( ) ) ; if ( isSnapInCG ) { addObjectToUnManagedConsistencyGroup ( apiClient , unManagedVolume , cgName , system , dbClient ) ; } } return snapsets ; }
discover lun snaps , and create unmanagedvolume for the snaps
