class InventoryUtil {

	public static Map<String,List<EfsVH>> fetchEFSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName){
		AmazonElasticFileSystem efsClient ;
		Map<String,List<EfsVH>> efsMap =  new LinkedHashMap<>();
		String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource in specific region\" ,\"type\": \"EFS\" , \"region\":\"" ;
		for(Region region : RegionUtils.getRegions()){
			try{
				if(!skipRegions.contains(region.getName())){
					efsClient = AmazonElasticFileSystemClientBuilder.standard().
							 withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();
					List<FileSystemDescription> efsListTemp = new ArrayList<>();
					String nextToken = null;
					DescribeFileSystemsResult descRslt ;
					do{
						descRslt = efsClient.describeFileSystems(new DescribeFileSystemsRequest().withMarker(nextToken));
						 efsListTemp.addAll(descRslt.getFileSystems());
						 nextToken = descRslt.getNextMarker();
					}while(nextToken!=null);

					List<EfsVH> efsList = new ArrayList<>();
					for(FileSystemDescription efs :efsListTemp ){
						efsList.add( new EfsVH(efs,
													efsClient.describeTags(new DescribeTagsRequest().withFileSystemId(efs.getFileSystemId())).getTags()));
					}
					if(! efsList.isEmpty() ) {
						log.debug(InventoryConstants.ACCOUNT + accountId + " Type : EFS "+region.getName() + " >> "+efsList.size());
						efsMap.put(accountId+delimiter+accountName+delimiter+region.getName(), efsList);
					}
				}
			}catch(Exception e){
				if(region.isServiceSupported(AmazonElasticFileSystem.ENDPOINT_PREFIX)){
					log.warn(expPrefix+ region.getName()+InventoryConstants.ERROR_CAUSE +e.getMessage()+"\"}");
					ErrorManageUtil.uploadError(accountId,region.getName(),"efs",e.getMessage());
				}
			}
		}
		return efsMap;
	}

	private  InventoryUtil();

}