Skip to content

Commit

Permalink
Fix javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
tsande16 committed Jul 8, 2024
1 parent 53764c0 commit 9285537
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class NihmsHarvester {

/**
* Initiate harvester with required properties
*
* @param urlBuilder object to build the URL that the NihmsHarvester will use to pull data from
* @param nihmsHarvesterDownloader downloader object for downloaded the harvested data
*/
public NihmsHarvester(UrlBuilder urlBuilder,
NihmsHarvesterDownloader nihmsHarvesterDownloader) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class NihmsHarvesterConfig {
@Value("${nihmsetl.http.read-timeout-ms}")
private Long nihmsReadTimeoutMs;

/**
* The OkHttpClient that has the connection properties set from the application.properties
*
* @return OkHttpClient
*/
@Bean
public OkHttpClient okHttpClient() {
return new OkHttpClient.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public class NihmsHarvesterDownloader {

/**
* Initiate harvester with required properties
*
* @param okHttpClient The OkHttpClient that handles the data extraction from external REST sources.
* @param downloadDirectory The directory where the NihmsLoader will download the external data to.
*/
public NihmsHarvesterDownloader(OkHttpClient okHttpClient,
@Value("${nihmsetl.data.dir}") String downloadDirectory) {
Expand All @@ -69,6 +72,13 @@ public NihmsHarvesterDownloader(OkHttpClient okHttpClient,
}
}

/**
* Handles the downloads of external NIHMS data
* @param url The URL from where the data is sourced
* @param status The status of the NIHMS data. Can either be: compliant, noncompliant, or inprocess.
* @throws IOException This exception is thrown if there is an error persisting data
* @throws InterruptedException This exception is thrown If there is a network connection interruption.
*/
public void download(URL url, NihmsStatus status) throws IOException, InterruptedException {
File outputFile = newFile(status);
LOG.debug("Retrieving: {}", url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class UrlBuilder {

private final Environment environment;

/**
* Constructor for the UrlBuilder. Sets environment either profiles or properties using SpringBoot Configuration.
*
* @param environment
*/
public UrlBuilder(Environment environment) {
this.environment = environment;
}
Expand Down

0 comments on commit 9285537

Please sign in to comment.