Swagger Update and other updates.
[music.git] / src / main / java / org / onap / music / main / PropertiesListener.java
index afd3538..0ed18be 100755 (executable)
@@ -30,26 +30,22 @@ import java.util.Arrays;
 import java.util.Properties;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
 import org.onap.music.eelf.logging.EELFLoggerDelegate;
 import org.onap.music.eelf.logging.format.AppMessages;
 import org.onap.music.eelf.logging.format.ErrorSeverity;
 import org.onap.music.eelf.logging.format.ErrorTypes;
 
-@WebListener
 public class PropertiesListener implements ServletContextListener {
     private Properties prop;
 
-    private static EELFLoggerDelegate logger =
-                    EELFLoggerDelegate.getLogger(PropertiesListener.class);
+    private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PropertiesListener.class);
 
     @Override
     public void contextInitialized(ServletContextEvent servletContextEvent) {
         prop = new Properties();
         Properties projectProp = new Properties();
         URL resource = getClass().getResource("/");
-        String musicPropertiesFilePath = resource.getPath().replace("WEB-INF/classes/",
-                        "WEB-INF/classes/project.properties");
+        String musicPropertiesFilePath = resource.getPath().replace("WEB-INF/classes/","WEB-INF/classes/project.properties");
 
         // Open the file
         try {
@@ -123,6 +119,15 @@ public class PropertiesListener implements ServletContextListener {
                         case "aaf.endpoint.url":
                             MusicUtil.setAafEndpointUrl(prop.getProperty(key));
                             break;
+                        case "cassandra.port":
+                            MusicUtil.setCassandraPort(Integer.parseInt(prop.getProperty(key)));
+                            break;
+                        case "notify.interval":
+                               MusicUtil.setNotifyInterval(Integer.parseInt(prop.getProperty(key)));
+                               break;
+                        case "notify.timeout":
+                               MusicUtil.setNotifyTimeOut(Integer.parseInt(prop.getProperty(key)));
+                               break;
                         default:
                             logger.error(EELFLoggerDelegate.errorLogger,
                                             "No case found for " + key);