src/main/java/org/vivoweb/harvester/ingest/AcademicFetchFromED.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<PeopleBean> people) throws IOException {
		StopWatch stopWatch = new StopWatch("People fetch performance");
		stopWatch.start("Person updates");
		int count = 0;
		Iterator<PeopleBean>  it = people.iterator();
		while(it.hasNext()) {
			PeopleBean pb = it.next();
			log.info("################################ " + pb.getCwid() + " - " + pb.getDisplayName() + " - Insert/Update Operation #####################");
			if(!checkPeopleInVivo(pb)) {
				log.info("Person: "+pb.getCwid() + " does not exist in VIVO");
				insertPeopleInVivo(pb);
				count = count + 1;
			}
			else {
				log.info("Person: "+pb.getCwid() + " already exist in VIVO");
				checkForUpdates(pb);
				syncCOIData(pb);
			}
			log.info("################################ End of " + pb.getCwid() + " - " + pb.getDisplayName() + " -  Insert/Update Operation ###################");
		}
		log.info("Number of new people inserted in VIVO: " + count);
		log.info("Number of people updated in VIVO: " + this.updateCount);
		stopWatch.stop();
		log.info("People fetch Time taken: " + stopWatch.getTotalTimeSeconds() + "s");
		return "People fetch completed successfully for cwids: " + people.toString();
	}
public String execute ( List < PeopleBean > people ) throws IOException { StopWatch stopWatch = new StopWatch ( "People fetch performance" ) ; stopWatch . start ( "Person updates" ) ; int count = 0 ; Iterator < PeopleBean > it = people . iterator ( ) ; while ( it . hasNext ( ) ) { PeopleBean pb = it . next ( ) ; log . info ( "################################ " + pb . getCwid ( ) + " - " + pb . getDisplayName ( ) + " - Insert/Update Operation #####################" ) ; if ( ! checkPeopleInVivo ( pb ) ) { log . info ( "Person: " + pb . getCwid ( ) + " does not exist in VIVO" ) ; insertPeopleInVivo ( pb ) ; count = count + 1 ; } else { log . info ( "Person: " + pb . getCwid ( ) + " already exist in VIVO" ) ; checkForUpdates ( pb ) ; syncCOIData ( pb ) ; } log . info ( "################################ End of " + pb . getCwid ( ) + " - " + pb . getDisplayName ( ) + " -  Insert/Update Operation ###################" ) ; } log . info ( "Number of new people inserted in VIVO: " + count ) ; log . info ( "Number of people updated in VIVO: " + this . updateCount ) ; stopWatch . stop ( ) ; log . info ( "People fetch Time taken: " + stopWatch . getTotalTimeSeconds ( ) + "s" ) ; return "People 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
//syncPersonTypes(pb);