-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #912 from folio-org/CIRC-1178-back-port-to-2021-R2
Back port CIRC-1178 to 2021 R2
- Loading branch information
Showing
16 changed files
with
279 additions
and
242 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.folio; | ||
|
||
import static java.lang.Integer.parseInt; | ||
import static org.apache.commons.lang.StringUtils.isBlank; | ||
|
||
import java.lang.invoke.MethodHandles; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
public class Environment { | ||
private static final Logger log = LogManager.getLogger(MethodHandles.lookup().lookupClass()); | ||
|
||
private Environment() { } | ||
|
||
public static int getScheduledAnonymizationNumberOfLoansToCheck() { | ||
return getVariable("SCHEDULED_ANONYMIZATION_NUMBER_OF_LOANS_TO_CHECK", 50000); | ||
} | ||
|
||
private static int getVariable(String key, int defaultValue) { | ||
final var variable = System.getenv().get(key); | ||
|
||
if (isBlank(variable)) { | ||
return defaultValue; | ||
} | ||
|
||
try { | ||
return parseInt(variable); | ||
} | ||
catch(Exception e) { | ||
log.warn("Invalid value for '{}': '{}' ", key, variable); | ||
|
||
return defaultValue; | ||
} | ||
} | ||
} |
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
71 changes: 0 additions & 71 deletions
71
src/main/java/org/folio/circulation/domain/anonymization/LoanAnonymization.java
This file was deleted.
Oops, something went wrong.
6 changes: 5 additions & 1 deletion
6
src/main/java/org/folio/circulation/domain/anonymization/LoanAnonymizationService.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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package org.folio.circulation.domain.anonymization; | ||
|
||
import java.util.Collection; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Supplier; | ||
|
||
import org.folio.circulation.domain.Loan; | ||
import org.folio.circulation.support.results.Result; | ||
|
||
public interface LoanAnonymizationService { | ||
CompletableFuture<Result<LoanAnonymizationRecords>> anonymizeLoans(); | ||
CompletableFuture<Result<LoanAnonymizationRecords>> anonymizeLoans( | ||
Supplier<CompletableFuture<Result<Collection<Loan>>>> loansToCheck); | ||
} |
14 changes: 0 additions & 14 deletions
14
src/main/java/org/folio/circulation/domain/anonymization/NeverLoanAnonymizationService.java
This file was deleted.
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
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
11 changes: 0 additions & 11 deletions
11
...va/org/folio/circulation/domain/anonymization/service/LoanAnonymizationFinderService.java
This file was deleted.
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
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.