[CCSDK-1008]Generalize offsite backup 59/76359/1
authorHaddox, Anthony <ah0647@att.com>
Fri, 25 Jan 2019 16:57:39 +0000 (08:57 -0800)
committerHaddox, Anthony <ah0647@att.com>
Fri, 25 Jan 2019 16:57:39 +0000 (08:57 -0800)
Revised the provider to use file names designated in
the properties file. This is for those who use vendor
provided distributions of OpenDaylight

Change-Id: Ib120452fa989fff371a832416a34d95745fead1b
Issue-ID: CCSDK-1008
Signed-off-by: Haddox, Anthony <ah0647@att.com>
daexim-offsite-backup/README.md
daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java
daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties
daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties

index 26d8a7e..e3f13ae 100755 (executable)
@@ -78,5 +78,10 @@ Before each RPC execution this module pulls information from a user supplied pro
 - credentials
 - nexusUrl
 - podName
+- file.operational
+- file.models
+- file.config
+
+> Refer to the example properties file
 
 If the module cannot find the properties file it will default to generic values and attempt to move forward.
index cc16bf7..09c8f92 100755 (executable)
@@ -75,11 +75,11 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
     private static String CREDENTIALS;
     private static String NEXUS_URL;
     private static String POD_NAME;
+    private static String OPERATIONAL_JSON;
+    private static String MODELS_JSON;
+    private static String CONFIG_JSON;
     private static String PROPERTIES_FILE = System.getenv("SDNC_CONFIG_DIR") + "/daexim-offsite-backup.properties";
 
-    private static final String OPERATIONAL_JSON = "odl_backup_operational.json";
-    private static final String MODELS_JSON = "odl_backup_models.json";
-    private static final String CONFIG_JSON = "odl_backup_config.json";
     private static final String BACKUP_ARCHIVE = "odl_backup.zip";
     private static final String appName = "daexim-offsite-backup";
 
@@ -122,6 +122,9 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
             properties.put("credentials", "admin:enc:YWRtaW4xMjM=");
             properties.put("nexusUrl", "http://localhost:8081/nexus/content/repositories/");
             properties.put("podName", "UNKNOWN_ODL");
+            properties.put("file.operational", "odl_backup_operational.json");
+            properties.put("file.models", "odl_backup_models.json");
+            properties.put("file.config", "odl_backup_config.json");
             return;
         }
         FileInputStream fileInputStream;
@@ -133,6 +136,9 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
             LOG.info("daeximDirectory: " + properties.getProperty("daeximDirectory"));
             LOG.info("nexusUrl: " + properties.getProperty("nexusUrl"));
             LOG.info("podName: " + properties.getProperty("podName"));
+            LOG.info("file.operational: " + properties.getProperty("file.operational"));
+            LOG.info("file.models: " + properties.getProperty("file.models"));
+            LOG.info("file.config: " + properties.getProperty("file.config"));
         } catch(IOException e) {
             LOG.error("Error loading properties.", e);
         }
@@ -147,6 +153,10 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
         DAEXIM_DIR =  properties.getProperty("daeximDirectory");
         NEXUS_URL = properties.getProperty("nexusUrl");
 
+        OPERATIONAL_JSON = properties.getProperty("file.operational");
+        MODELS_JSON = properties.getProperty("file.models");
+        CONFIG_JSON = properties.getProperty("file.config");
+
         if(!properties.getProperty("credentials").contains(":")) { //Entire thing is encoded
             CREDENTIALS = new String(Base64.getDecoder().decode(properties.getProperty("credentials")));
         }
index bdfa815..51efc1f 100755 (executable)
@@ -1,6 +1,28 @@
+# ============LICENSE_START=======================================================
+# openECOMP : SDN-C
+# ================================================================================
+# Copyright (C) 2019 AT&T Intellectual Property. All rights
+#                      reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+
 # Example properties file
 
 daeximDirectory=/opt/opendaylight/current/daexim/
 credentials=admin:enc:YWRtaW4xMjM=
 nexusUrl=http://localhost:8081/nexus/content/repositories/
-podName=UNKNOWN_ODL
\ No newline at end of file
+podName=UNKNOWN_ODL
+file.operational=odl_backup_operational.json
+file.models=odl_backup_models.json
+file.config=odl_backup_config.json
\ No newline at end of file
index 49dd133..b690279 100755 (executable)
@@ -1,4 +1,26 @@
+# ============LICENSE_START=======================================================
+# openECOMP : SDN-C
+# ================================================================================
+# Copyright (C) 2019 AT&T Intellectual Property. All rights
+#                      reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+
 daeximDirectory=/opt/opendaylight/current/daexim/
 credentials=admin:admin123
 nexusUrl=http://localhost:8081/nexus/content/repositories/
-podName=UNKNOWN_ODL
\ No newline at end of file
+podName=UNKNOWN_ODL
+file.operational=odl_backup_operational.json
+file.models=odl_backup_models.json
+file.config=odl_backup_config.json
\ No newline at end of file