class InventoryUtil {

	public static Map<String,List<CloudFrontVH>> fetchCloudFrontInfo(BasicSessionCredentials temporaryCredentials,String accountId,String accountName) {

		Map<String,List<CloudFrontVH>> cloudFront = new LinkedHashMap<>();
		List<DistributionSummary> distributionSummary = new ArrayList<>();
		AmazonCloudFront amazonCloudFront;
		String bucketName = null;
		boolean accessLogEnabled = false;
		String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource \" ,\"type\": \"CloudFront\"" ;
		try{
			amazonCloudFront = AmazonCloudFrontClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-west-2").build();

			String marker = null;
			List<CloudFrontVH> cloudFrontList = new ArrayList<>();
			DistributionList distributionList ;
			do{
				distributionList = amazonCloudFront.listDistributions(new ListDistributionsRequest().withMarker(marker)).getDistributionList();
				distributionSummary = distributionList.getItems();
				marker = distributionList.getNextMarker();
				for(DistributionSummary ds : distributionSummary) {
					CloudFrontVH cf = new CloudFrontVH();
					cf.setDistSummary(ds);
					cloudFrontList.add(cf);
				}
			}while(marker!=null);

			setCloudFrontTags(temporaryCredentials,cloudFrontList);
			setConfigDetails(temporaryCredentials,cloudFrontList);

			log.debug(InventoryConstants.ACCOUNT + accountId +" Type : CloudFront "+ " >> "+cloudFrontList.size());
			cloudFront.put(accountId+delimiter+accountName,cloudFrontList);
		}catch(Exception e){
			log.error(expPrefix+ InventoryConstants.ERROR_CAUSE +e.getMessage()+"\"}");
			ErrorManageUtil.uploadError(accountId,"","cloudfront",e.getMessage());
		}
		return cloudFront;
	}

	private  InventoryUtil();

}