diff options
Diffstat (limited to 'adapters/mso-requests-db-adapter/src/main')
5 files changed, 34 insertions, 17 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java index 28c56b32cd..25df0a7c1e 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java @@ -150,9 +150,9 @@ public class ArchiveInfraRequestsScheduler { } logger.info("Creating archivedInfraRequest records: " + newArchivedReqs.size()); - archivedInfraRepo.save(newArchivedReqs); + archivedInfraRepo.saveAll(newArchivedReqs); logger.info("Deleting InfraActiveRequest records: "+ oldInfraReqs.size()); - infraActiveRepo.delete(oldInfraReqs); + infraActiveRepo.deleteAll(oldInfraReqs); } } diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 33b1028cbb..dc6abce759 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -264,7 +264,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { String resourceTemplateUUID) throws MsoRequestsDbException { return resourceOperationStatusRepository - .findOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)); + .findById(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)). + orElseThrow( () -> new MsoRequestsDbException("Operation not found:" + operationId)); + } /** diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java index bc1e17b067..99fa770974 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java @@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml index 41b72ba08f..b2b16274aa 100644 --- a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml +++ b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml @@ -17,7 +17,7 @@ mso: period: 180 spring: datasource: - url: jdbc:mariadb://localhost:3306/requestdb + jdbc-url: jdbc:mariadb://localhost:3306/requestdb username: catalog password: catalog123 driver-class-name: org.mariadb.jdbc.Driver @@ -42,9 +42,6 @@ spring: password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa' role: ACTUATOR -#Actuator -management: - context-path: /manage flyway: baseline-on-migrate: false diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml index 4f423ca870..4d200d25b8 100644 --- a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml +++ b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml @@ -4,17 +4,21 @@ server: port: 8080 tomcat: max-threads: 50 - +ssl-enable: false mso: - site-name: unknown - logPath: ./logs/reqdb/ + adapters: + requestDb: + auth: Basic YnBlbDptc28tZGItMTUwNyE= + endpoint: http://localhost:8081 + logPath: .logs/reqdb + site-name: unkwon infra-requests: archived: period: 180 # H2 spring: datasource: - url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb + jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb username: ${DB_USERNAME} password: ${DB_PASSWORD} driver-class-name: org.mariadb.jdbc.Driver @@ -30,18 +34,32 @@ spring: ddl-auto: validate naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy enable-lazy-load-no-trans: true + security: + usercredentials: + - + username: bpel + password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO' + role: BPEL-Client + - + username: mso_admin + password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa' + role: ACTUATOR flyway: baseline-on-migrate: false - url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb + jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb user: ${DB_ADMIN_USERNAME} password: ${DB_ADMIN_PASSWORD} -#Actuator -management: - context-path: /manage +management: + endpoints: + web: + base-path: /manage + server: + servlet: + context-path: /manage metrics: se-global-registry: false export: prometheus: enabled: true # Whether exporting of metrics to Prometheus is enabled. - step: 1m # Step size (i.e. reporting frequency) to use.
\ No newline at end of file + step: 1m # Step size (i.e. reporting frequency) to use. |