-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authority): implement bulk load authorities from external file (#…
…240) Create new endpoint for bulk load Implement infrastructure for load/upload files to S3 storage Refactor authority repositories and services Move out request validation from service layer to controller-delegate layer. Consortium service is defined to do additional validtion for shadow copies Remove duplicate fetching records by id from delegate and add callback logic for service methods. Closes: MODELINKS-173
- Loading branch information
Showing
48 changed files
with
1,497 additions
and
434 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
47 changes: 47 additions & 0 deletions
47
src/main/java/org/folio/entlinks/config/RemoteStorageConfig.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,47 @@ | ||
package org.folio.entlinks.config; | ||
|
||
import lombok.Data; | ||
import lombok.extern.log4j.Log4j2; | ||
import org.folio.s3.client.FolioS3Client; | ||
import org.folio.s3.client.S3ClientFactory; | ||
import org.folio.s3.client.S3ClientProperties; | ||
import org.folio.s3.exception.S3ClientException; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@Log4j2 | ||
@ConfigurationProperties("folio.remote-storage") | ||
@Data | ||
@ConfigurationPropertiesScan | ||
public class RemoteStorageConfig { | ||
|
||
private String endpoint; | ||
private String region; | ||
private String bucket; | ||
private String accessKey; | ||
private String secretKey; | ||
private boolean awsSdk; | ||
|
||
@Bean | ||
public FolioS3Client remoteFolioS3Client() { | ||
log.debug("remote-files-storage: endpoint {}, region {}, bucket {}, accessKey {}, secretKey {}, awsSdk {}", | ||
endpoint, region, bucket, accessKey, secretKey, awsSdk); | ||
var client = S3ClientFactory.getS3Client(S3ClientProperties.builder() | ||
.endpoint(endpoint) | ||
.secretKey(secretKey) | ||
.accessKey(accessKey) | ||
.bucket(bucket) | ||
.awsSdk(awsSdk) | ||
.region(region) | ||
.build()); | ||
try { | ||
client.createBucketIfNotExists(); | ||
} catch (S3ClientException e) { | ||
log.error("Error creating bucket: {} during RemoteStorageClient initialization", bucket); | ||
} | ||
return client; | ||
} | ||
} |
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
Oops, something went wrong.