diff --git a/CONFIGURATION.md b/CONFIGURATION.md index fd31a790a7d08e1715eb0db52d2ebe20de2cbcd9..47c45f5b7e5d4329465d7723643804470d4928c8 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -4,16 +4,17 @@ Configuration may be set using SpringBoot's configuration file (`application.pro ##### Environment variables -| Variable | Default | Description | -|----------------------------|---------------------------------------------|-------------------------------------------------------| -| NAMING_BACKEND_SWAGGER_URL | http://localhost:8080/swagger-ui.html | default url for Swagger UI | -| NAMING_DATABASE_URL | jdbc:postgresql://postgres:5432/discs_names | JDBC URL for the database connection | -| NAMING_DATABASE_USERNAME | discs_names | user name for the database connection | -| NAMING_DATABASE_PASSWORD | discs_names | password for the database connection | -| NAMING_LOGGING_LEVEL | INFO | log level for application | -| NAMING_MAIL_ADMINISTRATOR | | comma-separated list of administrator email addresses | -| NAMING_MAIL_NOTIFICATION | false | true/false if mail notications are to be sent | -| NAMING_SMTP_HOST | mail.esss.lu.se | DNS name of server that accepts connections for SMTP | -| NAMING_SMTP_PORT | 587 | port to use for SMTP, 587 for SMTP Secure | -| NAMING_SMTP_USERNAME | | username for SMTP server | -| NAMING_SMTP_PASSWORD | | password for SMTP server | +| Variable | Default | Description | +|----------------------------|---------------------------------------------|------------------------------------------------------------------------------------------------------------------------| +| NAMING_BACKEND_SWAGGER_URL | http://localhost:8080/swagger-ui.html | default url for Swagger UI | +| NAMING_DATABASE_URL | jdbc:postgresql://postgres:5432/discs_names | JDBC URL for the database connection | +| NAMING_DATABASE_USERNAME | discs_names | user name for the database connection | +| NAMING_DATABASE_PASSWORD | discs_names | password for the database connection | +| NAMING_LOGGING_LEVEL | INFO | log level for application | +| NAMING_MAIL_ADMINISTRATOR | | comma-separated list of administrator email addresses | +| NAMING_MAIL_NOTIFICATION | false | true/false if mail notications are to be sent | +| NAMING_NOTIFY_SCHEDULE | 0 0 5 * * * | schedule for notification job, cron expression with six or seven fields to describe individual details of the schedule | +| NAMING_SMTP_HOST | mail.esss.lu.se | DNS name of server that accepts connections for SMTP | +| NAMING_SMTP_PORT | 587 | port to use for SMTP, 587 for SMTP Secure | +| NAMING_SMTP_USERNAME | | username for SMTP server | +| NAMING_SMTP_PASSWORD | | password for SMTP server | diff --git a/src/main/java/org/openepics/names/util/notification/NotificationScheduler.java b/src/main/java/org/openepics/names/util/notification/NotificationScheduler.java index 3258e727badfb143cc52aeaf3938a1059ae857f9..2124ae3c4f6aec1a8970ec8c88416e68d7d11a9a 100644 --- a/src/main/java/org/openepics/names/util/notification/NotificationScheduler.java +++ b/src/main/java/org/openepics/names/util/notification/NotificationScheduler.java @@ -68,7 +68,7 @@ public class NotificationScheduler { * <br/><br/> * Scheduling is handled with cron expression. */ - @Scheduled(cron = "0 0 5 * * *") + @Scheduled(cron = "${naming.notify.schedule}") public void notifyAdministrators() { notifyAdministratorsForNames(); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index aabb0d7ac08cf5ca62b44cfb82fb96cb25320ccf..2a346043b2753a0f242a0c883ab94002ac8dac7c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -12,8 +12,10 @@ logging.level.org.springframework.web=INFO logging.level.org.hibernate.SQL=INFO spring.http.log-request-details=true -# mail +# mail, notification # administrator mail is comma-separated list of email addresses +# notification job scheduled at 5 am every day by default +naming.notify.schedule=${NAMING_NOTIFY_SCHEDULE:0 0 5 * * *} naming.mail.administrator=${NAMING_MAIL_ADMINISTRATOR:} naming.mail.notification=${NAMING_MAIL_NOTIFICATION:false} naming.mail.from=${NAMING_MAIL_FROM:jboss@ess.eu} diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index cd149334ff4ea34f75a49619b02472dae6b28589..fc88cf5c9cc7b64b3582faaefa17e9e25a376990 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -12,8 +12,10 @@ logging.level.org.springframework.web=INFO logging.level.org.hibernate.SQL=INFO spring.http.log-request-details=true -# mail +# mail, notification # administrator mail is comma-separated list of email addresses +# notification job scheduled at 5 am every day by default +naming.notify.schedule=${NAMING_NOTIFY_SCHEDULE:0 0 5 * * *} naming.mail.administrator=${NAMING_MAIL_ADMINISTRATOR:} naming.mail.notification=${NAMING_MAIL_NOTIFICATION:false} naming.mail.from=${NAMING_MAIL_FROM:jboss@ess.eu}