src/main/java/org/vivoweb/harvester/ingest/GrantsFetchFromED.java
/**
		 * This is the main execution method of the class
		 */
This is the main execution method of the class
This is the main execution method of the class
public String execute(List<String> people) {
			StopWatch stopWatch = new StopWatch("Grants fetch performance");
			stopWatch.start("Grants updates");
			List<GrantBean> grant = null;
			Iterator<String> it = people.iterator();
			while(it.hasNext()) {
				String cwid = it.next().trim();
				log.info("#########################################################");
				log.info("Trying to fetch grants for cwid - " + cwid);
				grant = getGrantsFromCoeus(cwid, people);
				if(grant.isEmpty())
					log.info("There is no grants for cwid - " + cwid + " in Coeus");
				checkGrantExistInVivo(grant,cwid);
				if(ingestType.equals(IngestType.VIVO_API.toString())) {
					deleteConfidentialGrantsUsingTDB(grant, cwid);
				} else {
					deleteConfidentialGrants(grant, cwid);
				}
				log.info("#########################################################");
			}
		/*log.info("#########################################################");
		log.info("Trying to fetch grants for cwid - arj2005");
		grant = getGrantsFromCoeus("arj2005");
		if(grant.isEmpty())
			log.info("There is no grants for cwid - arj2005 in Coeus");
		checkGrantExistInVivo(grant,"arj2005");
		deleteConfidentialGrants(grant, "arj2005");
		log.info("#########################################################");*/
			log.info("Total new grants inserted into VIVO: " + this.insertCount);
			log.info("Total existing grants that were updated: " + this.updateCount);
			stopWatch.stop();
			log.info("Grants fetch Time taken: " + stopWatch.getTotalTimeSeconds() + "s");
			return "Grants fetch completed successfully for cwids: " + people.toString();
		}
public String execute ( List < String > people ) { StopWatch stopWatch = new StopWatch ( "Grants fetch performance" ) ; stopWatch . start ( "Grants updates" ) ; List < GrantBean > grant = null ; Iterator < String > it = people . iterator ( ) ; while ( it . hasNext ( ) ) { String cwid = it . next ( ) . trim ( ) ; log . info ( "#########################################################" ) ; log . info ( "Trying to fetch grants for cwid - " + cwid ) ; grant = getGrantsFromCoeus ( cwid , people ) ; if ( grant . isEmpty ( ) ) log . info ( "There is no grants for cwid - " + cwid + " in Coeus" ) ; checkGrantExistInVivo ( grant , cwid ) ; if ( ingestType . equals ( IngestType . VIVO_API . toString ( ) ) ) { deleteConfidentialGrantsUsingTDB ( grant , cwid ) ; } else { deleteConfidentialGrants ( grant , cwid ) ; } log . info ( "#########################################################" ) ; } /*log.info("#########################################################");
		log.info("Trying to fetch grants for cwid - arj2005");
		grant = getGrantsFromCoeus("arj2005");
		if(grant.isEmpty())
			log.info("There is no grants for cwid - arj2005 in Coeus");
		checkGrantExistInVivo(grant,"arj2005");
		deleteConfidentialGrants(grant, "arj2005");
		log.info("#########################################################");*/ log . info ( "Total new grants inserted into VIVO: " + this . insertCount ) ; log . info ( "Total existing grants that were updated: " + this . updateCount ) ; stopWatch . stop ( ) ; log . info ( "Grants fetch Time taken: " + stopWatch . getTotalTimeSeconds ( ) + "s" ) ; return "Grants fetch completed successfully for cwids: " + people . toString ( ) ; }
This is the main execution method of the class
This is the main execution method of the class