Add back activity spec install 23/85523/3
authorElena Kuleshov <evn@att.com>
Tue, 16 Apr 2019 08:01:40 +0000 (04:01 -0400)
committerElena Kuleshov <evn@att.com>
Tue, 16 Apr 2019 09:39:37 +0000 (05:39 -0400)
Add back activity spec install

Change-Id: Idd7a85b902182424669946b568217483c3c76f79
Issue-ID: SO-1726
Signed-off-by: Kuleshov, Elena <evn@att.com>
asdc-controller/src/main/java/org/onap/so/asdc/Application.java

index 1f66291..a05eeea 100644 (file)
 
 package org.onap.so.asdc;
 
+import javax.annotation.PostConstruct;
+import org.onap.so.asdc.activity.DeployActivitySpecs;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 @SpringBootApplication(scanBasePackages = {"org.onap.so"})
 @EnableScheduling
+@EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
 public class Application {
 
     private static final String MSO_CONFIG_PATH = "mso.config.path";
     private static final String LOGS_DIR = "logs_dir";
 
+    @Autowired
+    DeployActivitySpecs deployActivitySpecs;
+
     private static void setLogsDir() {
         if (System.getProperty(LOGS_DIR) == null) {
             System.getProperties().setProperty(LOGS_DIR, "./logs/asdc/");
@@ -42,6 +50,15 @@ public class Application {
             System.getProperties().setProperty(MSO_CONFIG_PATH, ".");
     }
 
+    @PostConstruct
+    private void deployActivities() {
+        try {
+            deployActivitySpecs.deployActivities();
+        } catch (Exception e) {
+        }
+
+    }
+
     public static void main(String[] args) {
         SpringApplication.run(Application.class, args);
         System.getProperties().setProperty("mso.db", "MARIADB");