src/main/java/org/vivoweb/harvester/ingest/AppointmentsFetchFromED.java
/**
		 * This is the main execution method of the class
		 * @throws IOException when connecting to ED
		 */
This is the main execution method of the class
@throws IOException when connecting to ED
This is the main execution method of the class @throws IOException when connecting to ED
public String execute(List<String> people) throws IOException {
		StopWatch stopWatch = new StopWatch("Appointments fetch performance");
		stopWatch.start("Appointments updates");
		int insertCount = 0;
		int updateCount = 0;
		List<OfaBean> ofaData = new ArrayList<>();
		Iterator<String> it = people.iterator();
		while(it.hasNext()) {
			String cwid = it.next();
			OfaBean ob = getRolesFromED(cwid); 
			ArrayList<EducationBean> edu = getEducationAndTraining(ob.getCwid()); 
			ob.setEdu(edu);
			ofaData.add(ob);
		}
		Iterator<OfaBean>  it1 = ofaData.iterator();
		while(it1.hasNext()) {
			OfaBean ob1 = it1.next();
			log.info("#########################################################");
			if(!checkOfaDataInVivo(ob1)) {
				log.info("Person: "+ob1.getCwid() + " does not has appointments in VIVO");
				insertOfaDataInVivo(ob1);
				insertCount = 	insertCount + 1;
			}
			else {
				log.info("Checking for any updates for "+ob1.getCwid());
				if(ingestType.equals(IngestType.VIVO_API.toString())) {
					updateCount = checkForUpdatesUsingTDB(ob1, ob1.getCwid());
				} else {
					updateCount = checkForUpdates(ob1, ob1.getCwid());
				}
			}
			log.info("#########################################################");
		}
		log.info("New appointments fetched for " + insertCount + " people");
		log.info("Appointments updated for " + updateCount + " people");
		log.info("Appointments fetch completed successfully...");
		stopWatch.stop();
		log.info("Appointment fetch Time taken: " + stopWatch.getTotalTimeSeconds() + "s");
		return "Appointment fetch completed successfully for cwids: " + people.toString();
	}
public String execute ( List < String > people ) throws IOException { StopWatch stopWatch = new StopWatch ( "Appointments fetch performance" ) ; stopWatch . start ( "Appointments updates" ) ; int insertCount = 0 ; int updateCount = 0 ; List < OfaBean > ofaData = new ArrayList < > ( ) ; Iterator < String > it = people . iterator ( ) ; while ( it . hasNext ( ) ) { String cwid = it . next ( ) ; OfaBean ob = getRolesFromED ( cwid ) ; ArrayList < EducationBean > edu = getEducationAndTraining ( ob . getCwid ( ) ) ; ob . setEdu ( edu ) ; ofaData . add ( ob ) ; } Iterator < OfaBean > it1 = ofaData . iterator ( ) ; while ( it1 . hasNext ( ) ) { OfaBean ob1 = it1 . next ( ) ; log . info ( "#########################################################" ) ; if ( ! checkOfaDataInVivo ( ob1 ) ) { log . info ( "Person: " + ob1 . getCwid ( ) + " does not has appointments in VIVO" ) ; insertOfaDataInVivo ( ob1 ) ; insertCount = insertCount + 1 ; } else { log . info ( "Checking for any updates for " + ob1 . getCwid ( ) ) ; if ( ingestType . equals ( IngestType . VIVO_API . toString ( ) ) ) { updateCount = checkForUpdatesUsingTDB ( ob1 , ob1 . getCwid ( ) ) ; } else { updateCount = checkForUpdates ( ob1 , ob1 . getCwid ( ) ) ; } } log . info ( "#########################################################" ) ; } log . info ( "New appointments fetched for " + insertCount + " people" ) ; log . info ( "Appointments updated for " + updateCount + " people" ) ; log . info ( "Appointments fetch completed successfully..." ) ; stopWatch . stop ( ) ; log . info ( "Appointment fetch Time taken: " + stopWatch . getTotalTimeSeconds ( ) + "s" ) ; return "Appointment fetch completed successfully for cwids: " + people . toString ( ) ; }
This is the main execution method of the class
 @throws IOException when connecting to ED
This is the main execution method of the class @throws IOException when connecting to ED
//Initialize connection pool and fill it with connection //Get all the appointments in ED //Get all the education and training data from OFA