From 1c82088a7cc5827373c3ab7fe2f1489169e48eca Mon Sep 17 00:00:00 2001 From: Antonis Lempesis Date: Mon, 31 Jan 2022 13:49:14 +0200 Subject: [PATCH] fixed Value annotations --- .../configuration/ImpalaConnector.java | 4 ++-- .../controllers/TestController.java | 2 +- .../urls_controller/controllers/UrlController.java | 4 ++-- .../urls_controller/util/S3ObjectStore.java | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java b/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java index 6d381c8b..1f342ebc 100644 --- a/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java +++ b/src/main/java/eu/openaire/urls_controller/configuration/ImpalaConnector.java @@ -19,9 +19,9 @@ public final class ImpalaConnector { @Autowired private JdbcTemplate jdbcTemplate; - @Value("services.pdfaggregation.controller.db.oldDatabaseName:pdfaggregation_i") + @Value("${services.pdfaggregation.controller.db.oldDatabaseName}:pdfaggregation_i") public static String oldDatabaseName; - @Value("services.pdfaggregation.controller.db.databaseName:pdfAggregationDatabase") + @Value("${services.pdfaggregation.controller.db.databaseName}:pdfAggregationDatabase") public static String databaseName; public static final Lock databaseLock = new ReentrantLock(true); // This lock is locking the threads trying to execute queries in the database. diff --git a/src/main/java/eu/openaire/urls_controller/controllers/TestController.java b/src/main/java/eu/openaire/urls_controller/controllers/TestController.java index 433931e9..457f1213 100644 --- a/src/main/java/eu/openaire/urls_controller/controllers/TestController.java +++ b/src/main/java/eu/openaire/urls_controller/controllers/TestController.java @@ -28,7 +28,7 @@ public class TestController extends GeneralController { @Autowired private TestFileUtils fileUtils; - @Value("services.pdfaggregation.controller.assignmentLimit") + @Value("${services.pdfaggregation.controller.assignmentLimit}") private int assignmentLimit; private static final AtomicLong assignmentsBatchCounter = new AtomicLong(0); // Just for the "getTestUrls"-endpoint. diff --git a/src/main/java/eu/openaire/urls_controller/controllers/UrlController.java b/src/main/java/eu/openaire/urls_controller/controllers/UrlController.java index 78a894ba..af7cf07f 100644 --- a/src/main/java/eu/openaire/urls_controller/controllers/UrlController.java +++ b/src/main/java/eu/openaire/urls_controller/controllers/UrlController.java @@ -38,10 +38,10 @@ public class UrlController { private static final AtomicLong assignmentsBatchCounter = new AtomicLong(0); // Just for the "getTestUrls"-endpoint. private static final Pattern MALICIOUS_INPUT_STRING = Pattern.compile(".*[';`\"]+.*"); - @Value("services.pdfaggregation.controller.maxAttemptsPerRecord") + @Value("${services.pdfaggregation.controller.maxAttemptsPerRecord}") private int maxAttemptsPerRecord; - @Value("services.pdfaggregation.controller.assignmentLimit") + @Value("${services.pdfaggregation.controller.assignmentLimit}") private int assignmentLimit; @GetMapping("") diff --git a/src/main/java/eu/openaire/urls_controller/util/S3ObjectStore.java b/src/main/java/eu/openaire/urls_controller/util/S3ObjectStore.java index 724f944a..8ceab10e 100644 --- a/src/main/java/eu/openaire/urls_controller/util/S3ObjectStore.java +++ b/src/main/java/eu/openaire/urls_controller/util/S3ObjectStore.java @@ -19,20 +19,20 @@ public class S3ObjectStore { private static final Logger logger = LoggerFactory.getLogger(S3ObjectStore.class); private String s3Protocol = "s3://"; - @Value("services.pdfaggregation.controller.s3.endpoint") + @Value("${services.pdfaggregation.controller.s3.endpoint}") private String endpoint = null; // This is useful to be "public", to test file-locations. - @Value("services.pdfaggregation.controller.s3.accessKey") + @Value("${services.pdfaggregation.controller.s3.accessKey}") private String accessKey = null; - @Value("services.pdfaggregation.controller.s3.secretKey") + @Value("${services.pdfaggregation.controller.s3.secretKey}") private String secretKey = null; - @Value("services.pdfaggregation.controller.s3.region") + @Value("${services.pdfaggregation.controller.s3.region}") private String region = null; - @Value("services.pdfaggregation.controller.s3.bucketName") + @Value("${services.pdfaggregation.controller.s3.bucketName}") private String bucketName = null; - @Value("services.pdfaggregation.controller.s3.shouldEmptyBucket") + @Value("${services.pdfaggregation.controller.s3.shouldEmptyBucket}") private boolean shouldEmptyBucket = false; // Set true only for testing! - @Value("services.pdfaggregation.controller.s3.shouldShowAllS3Buckets") + @Value("${services.pdfaggregation.controller.s3.shouldShowAllS3Buckets}") private boolean shouldShowAllS3Buckets = false; private MinioClient minioClient;