-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GRAD2-2724: task is completed.
- Loading branch information
Showing
13 changed files
with
118 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/BaseStudentReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package ca.bc.gov.educ.api.batchgraduation.reader; | ||
|
||
import ca.bc.gov.educ.api.batchgraduation.model.AlgorithmSummaryDTO; | ||
import ca.bc.gov.educ.api.batchgraduation.model.ResponseObj; | ||
import ca.bc.gov.educ.api.batchgraduation.rest.RestUtils; | ||
import org.springframework.batch.core.JobExecution; | ||
import org.springframework.batch.item.ItemReader; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
public abstract class BaseStudentReader implements ItemReader<UUID> { | ||
|
||
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") | ||
@Autowired | ||
RestUtils restUtils; | ||
|
||
@Value("#{stepExecutionContext['index']}") | ||
protected Integer nxtStudentForProcessing; | ||
|
||
@Value("#{stepExecutionContext['data']}") | ||
protected List<UUID> studentList; | ||
|
||
@Value("#{stepExecutionContext['summary']}") | ||
AlgorithmSummaryDTO summaryDTO; | ||
|
||
@Value("#{stepExecution.jobExecution}") | ||
JobExecution jobExecution; | ||
|
||
protected void fetchAccessToken() { | ||
ResponseObj res = restUtils.getTokenResponseObject(); | ||
if (res != null) { | ||
summaryDTO.setAccessToken(res.getAccess_token()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters