Author: samindaw
Date: Wed Jan  9 18:27:04 2013
New Revision: 1431003

URL: http://svn.apache.org/viewvc?rev=1431003&view=rev
Log:
refactoring server settings + adding client settings + ability to update & 
persist settings

Added:
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java
   (contents, props changed)
      - copied, changed from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsException.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java
   (contents, props changed)
      - copied, changed from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsLoadException.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java
   (with props)
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java
   (contents, props changed)
      - copied, changed from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedServerSettingsException.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
   (with props)
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java
   (with props)
Removed:
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsException.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsLoadException.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedServerSettingsException.java
    
airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/TestMonitorListener.java
Modified:
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
    
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
    
airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
    
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
    airavata/trunk/modules/integration-tests/pom.xml
    
airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
    
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
    
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
    
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
    
airavata/trunk/modules/ws-messenger/commons/src/main/java/org/apache/airavata/wsmg/commons/config/ConfigurationManager.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
    
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java

Copied: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java
 (from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsException.java)
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java?p2=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java&p1=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsException.java&r1=1430653&r2=1431003&rev=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsException.java
 (original)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java
 Wed Jan  9 18:27:04 2013
@@ -21,15 +21,15 @@
 
 package org.apache.airavata.common.exception;
 
-public class ServerSettingsException extends AiravataException {
+public class ApplicationSettingsException extends AiravataException {
 
        private static final long serialVersionUID = -4901850535475160411L;
 
-       public ServerSettingsException(String message) {
+       public ApplicationSettingsException(String message) {
                super(message);
        }
        
-       public ServerSettingsException(String message, Throwable e) {
+       public ApplicationSettingsException(String message, Throwable e) {
                super(message, e);
        }
 }

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java
 (from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsLoadException.java)
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java?p2=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java&p1=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsLoadException.java&r1=1430653&r2=1431003&rev=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ServerSettingsLoadException.java
 (original)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java
 Wed Jan  9 18:27:04 2013
@@ -21,18 +21,18 @@
 
 package org.apache.airavata.common.exception;
 
-public class ServerSettingsLoadException extends ServerSettingsException {
+public class ApplicationSettingsLoadException extends 
ApplicationSettingsException {
 
        private static final long serialVersionUID = -5102090895499711299L;
-       public ServerSettingsLoadException(String message) {
+       public ApplicationSettingsLoadException(String message) {
                super(message);
        }
        
-       public ServerSettingsLoadException(Throwable e) {
+       public ApplicationSettingsLoadException(Throwable e) {
                this(e.getMessage(),e);
        }
        
-       public ServerSettingsLoadException(String message, Throwable e) {
+       public ApplicationSettingsLoadException(String message, Throwable e) {
                super(message,e);
        }
 }

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsLoadException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java?rev=1431003&view=auto
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java
 (added)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java
 Wed Jan  9 18:27:04 2013
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+package org.apache.airavata.common.exception;
+
+public class ApplicationSettingsStoreException extends 
ApplicationSettingsException {
+
+       private static final long serialVersionUID = -5102090895499711299L;
+       public ApplicationSettingsStoreException(String filePath) {
+               super("Error while attempting to store settings in "+filePath);
+       }
+
+       public ApplicationSettingsStoreException(String filePath, Throwable e) {
+               super(filePath,e);
+       }
+}

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/ApplicationSettingsStoreException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java
 (from r1430653, 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedServerSettingsException.java)
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java?p2=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java&p1=airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedServerSettingsException.java&r1=1430653&r2=1431003&rev=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedServerSettingsException.java
 (original)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java
 Wed Jan  9 18:27:04 2013
@@ -21,10 +21,10 @@
 
 package org.apache.airavata.common.exception;
 
-public class UnspecifiedServerSettingsException extends 
ServerSettingsException {
+public class UnspecifiedApplicationSettingsException extends 
ApplicationSettingsException {
 
        private static final long serialVersionUID = -1159027432434546003L;
-       public UnspecifiedServerSettingsException(String key) {
-               super("The '"+key+"' is not configured in Server settings!!!");
+       public UnspecifiedApplicationSettingsException(String key) {
+               super("The '"+key+"' is not configured in settings!!!");
        }
 }

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UnspecifiedApplicationSettingsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java?rev=1431003&view=auto
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
 (added)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
 Wed Jan  9 18:27:04 2013
@@ -0,0 +1,134 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+package org.apache.airavata.common.utils;
+
+import java.io.FileOutputStream;
+import java.net.URL;
+import java.util.Calendar;
+import java.util.Properties;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsLoadException;
+import org.apache.airavata.common.exception.ApplicationSettingsStoreException;
+import 
org.apache.airavata.common.exception.UnspecifiedApplicationSettingsException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class ApplicationSettings {
+    public static final String SERVER_PROPERTIES="airavata-server.properties";
+    public static final String CLIENT_PROPERTIES="airavata-client.properties";
+       private static Properties properties = new Properties();
+    private static Exception propertyLoadException;
+    private static final String DEFAULT_GATEWAY_ID="gateway.id";
+    private static final String SYSTEM_USER="system.user";
+    private static final String SYSTEM_USER_PASSWORD="system.password";
+    private static final String SYSTEM_USER_GATEWAY="system.gateway";
+    private static final String TOMCAT_PORT = "port";
+    private final static Logger logger = 
LoggerFactory.getLogger(ApplicationSettings.class);
+
+    static{
+       loadProperties();
+    }
+
+       private static void loadProperties() {
+               URL url = getPropertyFileURL();
+        try {
+            properties.load(url.openStream());
+        } catch (Exception e) {
+               propertyLoadException=e;
+        }
+       }
+
+       private static URL getPropertyFileURL() {
+               URL url;
+               if (AiravataUtils.isServer()){
+                        
url=ApplicationSettings.class.getClassLoader().getResource(SERVER_PROPERTIES);
+       }else{
+               
url=ApplicationSettings.class.getClassLoader().getResource(CLIENT_PROPERTIES);
+       }
+               return url;
+       }
+       
+       private static void saveProperties() throws 
ApplicationSettingsStoreException{
+               URL url = getPropertyFileURL();
+               if (url.getProtocol().equalsIgnoreCase("file")){
+                       try {
+                               properties.store(new 
FileOutputStream(url.getPath()), Calendar.getInstance().toString());
+                       } catch (Exception e) {
+                               throw new 
ApplicationSettingsStoreException(url.getPath(), e);
+                       }
+               }else{
+                       logger.warn("Properties cannot be updated to location 
"+url.toString());
+               }
+       }
+       
+    private static void validateSuccessfulPropertyFileLoad() throws 
ApplicationSettingsException{
+       if (propertyLoadException!=null){
+               throw new 
ApplicationSettingsLoadException(propertyLoadException);
+       }
+    }
+    
+    public static String getSetting(String key) throws 
ApplicationSettingsException{
+       validateSuccessfulPropertyFileLoad();
+       if (properties.containsKey(key)){
+               return properties.getProperty(key);
+       }
+       throw new UnspecifiedApplicationSettingsException(key);
+    }
+    
+    public static String getSetting(String key, String defaultValue){
+       try {
+                       validateSuccessfulPropertyFileLoad();
+                       if (properties.containsKey(key)){
+                               return properties.getProperty(key);
+                       }
+               } catch (ApplicationSettingsException e) {
+                       //we'll ignore this error since a default value is 
provided
+               }
+               return defaultValue;
+    }
+    
+    public static String getDefaultGatewayId()throws 
ApplicationSettingsException{
+       return getSetting(DEFAULT_GATEWAY_ID);
+    }
+    
+    public static String getSystemUser() throws ApplicationSettingsException{
+       return getSetting(SYSTEM_USER);
+    }
+    
+    public static String getSystemUserPassword() throws 
ApplicationSettingsException{
+       return getSetting(SYSTEM_USER_PASSWORD);
+    }
+    
+    public static String getSystemUserGateway() throws 
ApplicationSettingsException{
+       return getSetting(SYSTEM_USER_GATEWAY);
+    }
+
+    public static String getTomcatPort() throws ApplicationSettingsException {
+        return getSetting(TOMCAT_PORT);
+    }
+
+    public static void setSetting(String key, String value) throws 
ApplicationSettingsException{
+       properties.setProperty(key, value);
+       saveProperties();
+    }
+}

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java?rev=1431003&view=auto
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java
 (added)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java
 Wed Jan  9 18:27:04 2013
@@ -0,0 +1,26 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+package org.apache.airavata.common.utils;
+
+public class ClientSettings extends ApplicationSettings {
+
+}

Propchange: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ClientSettings.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
 (original)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
 Wed Jan  9 18:27:04 2013
@@ -21,77 +21,6 @@
 
 package org.apache.airavata.common.utils;
 
-import java.net.URL;
-import java.util.Properties;
 
-import org.apache.airavata.common.exception.ServerSettingsException;
-import org.apache.airavata.common.exception.ServerSettingsLoadException;
-import org.apache.airavata.common.exception.UnspecifiedServerSettingsException;
-
-public class ServerSettings {
-    public static final String REPOSITORY_PROPERTIES = 
"airavata-server.properties";
-    private static Properties properties = new Properties();
-    private static Exception propertyLoadException;
-    private static final String DEFAULT_GATEWAY_ID="gateway.id";
-    private static final String SYSTEM_USER="system.user";
-    private static final String SYSTEM_USER_PASSWORD="system.password";
-    private static final String SYSTEM_USER_GATEWAY="system.gateway";
-    private static final String TOMCAT_PORT = "port";
-
-
-    static{
-       URL url = ServerSettings.class.getClassLoader()
-                               .getResource(REPOSITORY_PROPERTIES);
-        try {
-            properties.load(url.openStream());
-        } catch (Exception e) {
-               propertyLoadException=e;
-        }
-    }
-    
-    private static void validateSuccessfulPropertyFileLoad() throws 
ServerSettingsException{
-       if (propertyLoadException!=null){
-               throw new ServerSettingsLoadException(propertyLoadException);
-       }
-    }
-    
-    public static String getSetting(String key) throws ServerSettingsException{
-       validateSuccessfulPropertyFileLoad();
-       if (properties.containsKey(key)){
-               return properties.getProperty(key);
-       }
-       throw new UnspecifiedServerSettingsException(key);
-    }
-    
-    public static String getSetting(String key, String defaultValue){
-       try {
-                       validateSuccessfulPropertyFileLoad();
-                       if (properties.containsKey(key)){
-                               return properties.getProperty(key);
-                       }
-               } catch (ServerSettingsException e) {
-                       //we'll ignore this error since a default value is 
provided
-               }
-               return defaultValue;
-    }
-    
-    public static String getDefaultGatewayId()throws ServerSettingsException{
-       return getSetting(DEFAULT_GATEWAY_ID);
-    }
-    
-    public static String getSystemUser() throws ServerSettingsException{
-       return getSetting(SYSTEM_USER);
-    }
-    
-    public static String getSystemUserPassword() throws 
ServerSettingsException{
-       return getSetting(SYSTEM_USER_PASSWORD);
-    }
-    
-    public static String getSystemUserGateway() throws ServerSettingsException{
-       return getSetting(SYSTEM_USER_GATEWAY);
-    }
-
-    public static String getTomcatPort() {
-        return properties.getProperty(TOMCAT_PORT);
-    }
+public class ServerSettings extends ApplicationSettings{
 }

Modified: 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
 (original)
+++ 
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
 Wed Jan  9 18:27:04 2013
@@ -24,7 +24,7 @@ package org.apache.airavata.common.utils
 import java.io.IOException;
 import java.net.SocketException;
 
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.util.Utils;
@@ -46,7 +46,7 @@ public class ServiceUtils {
 //        Properties properties = new Properties();
         try {
             localAddress = ServerSettings.getSetting(IP);
-        } catch (ServerSettingsException e) {
+        } catch (ApplicationSettingsException e) {
                        //we will ignore this exception since the properties 
file will not contain the values
                        //when it is ok to retrieve them from the axis2 context
                }
@@ -61,7 +61,7 @@ public class ServiceUtils {
         
         try {
             port = (String) ServerSettings.getSetting(PORT);
-        } catch (ServerSettingsException e) {
+        } catch (ApplicationSettingsException e) {
                        //we will ignore this exception since the properties 
file will not contain the values
                        //when it is ok to retrieve them from the axis2 context
                }

Modified: 
airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
 (original)
+++ 
airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
 Wed Jan  9 18:27:04 2013
@@ -34,7 +34,7 @@ import org.apache.airavata.client.Airava
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.AiravataAPIInvocationException;
 import org.apache.airavata.client.tools.PeriodicExecutorThread;
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ServiceUtils;
@@ -130,7 +130,7 @@ public class GFacService implements Serv
                             password = ServerSettings.getSystemUserPassword();
                         }
                         gatewayName = ServerSettings.getDefaultGatewayId();
-                    } catch (ServerSettingsException e) {
+                    } catch (ApplicationSettingsException e) {
                         log.error("Unable to read properties", e);
                     }
                     airavataAPI = 
AiravataAPIFactory.getAPI(ServerSettings.getDefaultGatewayId(), 
ServerSettings.getSystemUser());

Modified: 
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
 (original)
+++ 
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/GFacConfiguration.java
 Wed Jan  9 18:27:04 2013
@@ -24,8 +24,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.common.exception.ServerSettingsException;
-import org.apache.airavata.common.exception.UnspecifiedServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import 
org.apache.airavata.common.exception.UnspecifiedApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.core.gfac.external.GridConfigurationHandler;
 import org.slf4j.Logger;
@@ -65,9 +65,9 @@ public class GFacConfiguration {
                                        log.error("Error while loading Grid 
Configuration Handler class "+handlerClass, e);
                                }
                        }
-               } catch (UnspecifiedServerSettingsException e) {
+               } catch (UnspecifiedApplicationSettingsException e) {
                        //no handlers defined
-               } catch (ServerSettingsException e1) {
+               } catch (ApplicationSettingsException e1) {
                        log.error("Error in reading Configuration handler 
data!!!",e1);
                }
     }

Modified: airavata/trunk/modules/integration-tests/pom.xml
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/integration-tests/pom.xml?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- airavata/trunk/modules/integration-tests/pom.xml (original)
+++ airavata/trunk/modules/integration-tests/pom.xml Wed Jan  9 18:27:04 2013
@@ -39,11 +39,11 @@
                                     <available 
file="${local.tomcat.distribution}"/>
                                     <then>
                                         <echo message="Using Tomcat 
distribution in local repository ..." />
-                                        <copy 
file="${local.tomcat.distribution}" todir="." overwrite="true"/>
+                                        <copy 
file="${local.tomcat.distribution}" todir="${project.build.directory}" 
overwrite="true"/>
                                     </then>
                                     <else>
                                         <echo message="Downloading Tomcat 
distribution ..." />
-                                        <get dest=".">
+                                        <get dest="${project.build.directory}">
                                             <url 
url="http://archive.apache.org/dist/tomcat/tomcat-${major.tomcat.version}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip"/>
                                         </get>
 
@@ -51,9 +51,9 @@
                                 </if>
 
 
-                                <unzip 
src="../distribution/airavata-server/target/apache-airavata-server-${project.version}-bin.zip"
 dest="target/tests"/>
-                                <unzip 
src="../distribution/xbaya-gui/target/apache-airavata-xbaya-gui-${project.version}-bin.zip"
 dest="target/tests"/>
-                                <unzip 
src="apache-tomcat-${tomcat.version}.zip" dest="target/tests"/>
+                                <unzip 
src="../distribution/airavata-server/target/apache-airavata-server-${project.version}-bin.zip"
 dest="${project.build.directory}/tests"/>
+                                <unzip 
src="../distribution/xbaya-gui/target/apache-airavata-xbaya-gui-${project.version}-bin.zip"
 dest="${project.build.directory}/tests"/>
+                                <unzip 
src="${project.build.directory}/apache-tomcat-${tomcat.version}.zip" 
dest="${project.build.directory}/tests"/>
                                 <delete 
dir="${tomcat.work.dir}/webapps/examples"/>
                             </target>
                         </configuration>
@@ -78,7 +78,7 @@
                             <artifactId>apache-tomcat</artifactId>
                             <version>${tomcat.version}</version>
                             <packaging>zip</packaging>
-                            <file>apache-tomcat-${tomcat.version}.zip</file>
+                            
<file>${project.build.directory}/apache-tomcat-${tomcat.version}.zip</file>
                         </configuration>
                     </execution>
                 </executions>

Modified: 
airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
 (original)
+++ 
airavata/trunk/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
 Wed Jan  9 18:27:04 2013
@@ -24,19 +24,20 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.registry.api.PasswordCallback;
 import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl;
 import org.apache.airavata.registry.api.workflow.ExperimentData;
+import org.apache.airavata.registry.api.workflow.InputData;
 import org.apache.airavata.registry.api.workflow.NodeExecutionData;
+import org.apache.airavata.registry.api.workflow.OutputData;
 import org.apache.airavata.schemas.gfac.DataType;
 import org.apache.airavata.schemas.gfac.HostDescriptionType;
 import org.apache.airavata.schemas.gfac.InputParameterType;
 import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.graph.GraphException;
 import org.apache.airavata.workflow.model.wf.Workflow;
 import org.apache.airavata.workflow.model.wf.WorkflowInput;
 import org.apache.airavata.ws.monitor.EventData;
 import org.apache.airavata.ws.monitor.EventDataListenerAdapter;
 import org.apache.airavata.ws.monitor.EventDataRepository;
 import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeTest;
@@ -433,10 +434,12 @@ public class BaseCaseIT {
 
                 Assert.assertFalse("Node execution data list cannot be empty 
!", nodeDataList.isEmpty());
 
-               System.out.print("******************************");
-               System.out.println(nodeData.getOutputData().get(0).getValue());
-                Assert.assertEquals("Airavata_Test", 
nodeData.getOutputData().get(0).getValue());
-                Assert.assertEquals(outputVerifyingString, 
nodeData.getInputData().get(0).getValue());
+               for (OutputData outputData : nodeData.getOutputData()) {
+                    Assert.assertEquals("Airavata_Test", 
outputData.getValue());
+                               }
+               for (InputData inputData : nodeData.getInputData()) {
+                    Assert.assertEquals(outputVerifyingString, 
inputData.getValue());
+                               }
             }
         }
     }
@@ -476,12 +479,28 @@ public class BaseCaseIT {
         return buffer.toString();
     }
 
-    public void monitor(String experimentId) throws Exception {
+    public void monitor(final String experimentId) throws Exception {
         AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new 
URI(getRegistryURL()), getGatewayName(),
                 getUserName(), new PasswordCallbackImpl() );
-        TestMonitorListener monitorListener = new 
TestMonitorListener(this.airavataAPI, experimentId);
-               Monitor experimentMonitor = 
airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,     // 
TODO what is experiment name ?
-                monitorListener);
+               final Monitor experimentMonitor = 
airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,new 
EventDataListenerAdapter() {
+                       
+                       @Override
+                       public void notify(EventDataRepository eventDataRepo, 
EventData eventData) {
+                               Assert.assertNotNull(eventDataRepo);
+                       Assert.assertNotNull(eventData);
+                       if 
(MonitorUtil.EventType.WORKFLOW_TERMINATED.equals(eventData.getType())) {
+                           try {
+                               
BaseCaseIT.this.verifyOutput(experimentId,"echo_output=Airavata_Test");
+                           } catch (Exception e) {
+                               log.error("Error verifying output", e);
+                               Assert.fail("Error occurred while verifying 
output.");
+                           }finally{
+                               getMonitor().stopMonitoring();
+                           }
+                       }
+                       log.info(eventDataRepo.getEvents().toString());         
                
+                       }
+               });
         experimentMonitor.startMonitoring();
         experimentMonitor.waitForCompletion();
     }

Modified: 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
 (original)
+++ 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
 Wed Jan  9 18:27:04 2013
@@ -25,15 +25,12 @@ import java.net.URL;
 import java.util.Properties;
 
 import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.ApplicationSettings;
 import org.apache.airavata.registry.api.exception.RegistrySettingsException;
 import 
org.apache.airavata.registry.api.exception.RegistrySettingsLoadException;
-import 
org.apache.airavata.registry.api.exception.UnspecifiedRegistrySettingsException;
 
 public class RegistrySettings {
     private static final String REPOSITORY_PROPERTIES = "registry.properties";
-    private static final String SERVER_REPOSITORY_PROPERTIES = 
ServerSettings.REPOSITORY_PROPERTIES;
-    private static final String CLIENT_REPOSITORY_PROPERTIES = 
"airavata-client.properties";
     private static Properties properties = new Properties();
     private static Exception propertyLoadException;
     private static final String REGISTRY_ACCESSOR_CLASS = 
"class.registry.accessor";
@@ -43,9 +40,9 @@ public class RegistrySettings {
                                .getResource(REPOSITORY_PROPERTIES);
                if (url == null) {
                if (AiravataUtils.isServer()){
-                        
url=RegistrySettings.class.getClassLoader().getResource(SERVER_REPOSITORY_PROPERTIES);
+                        
url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.SERVER_PROPERTIES);
                }else{
-                       
url=RegistrySettings.class.getClassLoader().getResource(CLIENT_REPOSITORY_PROPERTIES);
+                       
url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.CLIENT_PROPERTIES);
                }
                }
         try {

Modified: 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java
 (original)
+++ 
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java
 Wed Jan  9 18:27:04 2013
@@ -26,7 +26,7 @@ import java.net.URL;
 import java.net.URLConnection;
 
 import org.apache.airavata.common.exception.AiravataConfigurationException;
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.AiravataRegistryFactory;
@@ -121,7 +121,7 @@ public class RegistryUtils {
             log.error("Error initializing AiravataRegistry2");
         } catch (RegistryAccessorUndefinedException e) {
             log.error("Error initializing AiravataRegistry2");
-        } catch (ServerSettingsException e) {
+        } catch (ApplicationSettingsException e) {
                log.error("Error initializing AiravataRegistry2",e);
                } catch (RegistryException e) {
             log.error("Error initializing AiravataRegistry2",e);

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
 Wed Jan  9 18:27:04 2013
@@ -2,7 +2,7 @@ package org.apache.airavata.services.reg
 
 import org.apache.airavata.common.context.RequestContext;
 import org.apache.airavata.common.context.WorkflowContext;
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.security.AuthenticationException;
@@ -77,7 +77,7 @@ public class ServletRequestHelper {
         if (gatewayId == null) {
             try {
                 gatewayId = ServerSettings.getDefaultGatewayId();
-            } catch (ServerSettingsException e) {
+            } catch (ApplicationSettingsException e) {
                 throw new AuthenticationException("Unable to retrieve default 
gateway", e);
             }
         }

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
 Wed Jan  9 18:27:04 2013
@@ -20,7 +20,7 @@
 
 package org.apache.airavata.services.registry.rest.security.basic;
 
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.security.AbstractAuthenticator;

Modified: 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
 (original)
+++ 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
 Wed Jan  9 18:27:04 2013
@@ -20,10 +20,10 @@
 */
 package org.apache.airavata.server;
 
+import java.io.File;
+
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.catalina.Wrapper;
-import java.io.File;
-import org.apache.catalina.Host;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.deploy.FilterDef;
 import org.apache.catalina.deploy.FilterMap;
@@ -31,10 +31,7 @@ import org.apache.catalina.startup.Tomca
 
 public class ServerMain {
 
-    private String path = null;
     private Tomcat embedded = null;
-    private Host host = null;
-
     /**
      * Default Constructor
      */

Modified: 
airavata/trunk/modules/ws-messenger/commons/src/main/java/org/apache/airavata/wsmg/commons/config/ConfigurationManager.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/ws-messenger/commons/src/main/java/org/apache/airavata/wsmg/commons/config/ConfigurationManager.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/ws-messenger/commons/src/main/java/org/apache/airavata/wsmg/commons/config/ConfigurationManager.java
 (original)
+++ 
airavata/trunk/modules/ws-messenger/commons/src/main/java/org/apache/airavata/wsmg/commons/config/ConfigurationManager.java
 Wed Jan  9 18:27:04 2013
@@ -22,7 +22,7 @@
 package org.apache.airavata.wsmg.commons.config;
 
 
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 
 public class ConfigurationManager {
@@ -40,7 +40,7 @@ public class ConfigurationManager {
     public String getConfig(String configName) {
         try {
                        return ServerSettings.getSetting(configName);
-               } catch (ServerSettingsException e) {
+               } catch (ApplicationSettingsException e) {
                        e.printStackTrace();
                        return null;
                }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 Wed Jan  9 18:27:04 2013
@@ -46,7 +46,7 @@ import org.apache.airavata.client.api.Ai
 import org.apache.airavata.client.api.AiravataAPIInvocationException;
 import org.apache.airavata.client.stub.interpretor.NameValue;
 import org.apache.airavata.client.tools.PeriodicExecutorThread;
-import org.apache.airavata.common.exception.ServerSettingsException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ServiceUtils;
@@ -128,7 +128,7 @@ public class WorkflowInterpretorSkeleton
                                systemUserPW = 
ServerSettings.getSystemUserPassword();
                                gateway = ServerSettings.getSystemUserGateway();
                                airavataAPI = 
AiravataAPIFactory.getAPI(gateway, systemUserName);
-                       } catch (ServerSettingsException e) {
+                       } catch (ApplicationSettingsException e) {
                                log.error("Unable to read the properties file", 
e);
                        } catch (AiravataAPIInvocationException e) {
                                log.error("Unable to create Airavata API", e);
@@ -202,7 +202,7 @@ public class WorkflowInterpretorSkeleton
                        } catch (URISyntaxException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
-                               } catch (ServerSettingsException e) {
+                               } catch (ApplicationSettingsException e) {
                     e.printStackTrace();  //To change body of catch statement 
use File | Settings | File Templates.
                 }
                 WorkflowInterpretorSkeleton.configurationContext = configctx;
@@ -256,7 +256,7 @@ public class WorkflowInterpretorSkeleton
             log.error(e.getMessage());
         } catch (AiravataAPIInvocationException e) {
             log.error(e.getMessage());
-        } catch (ServerSettingsException e) {
+        } catch (ApplicationSettingsException e) {
             log.error(e.getMessage());
         }
         return s;

Modified: 
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java?rev=1431003&r1=1431002&r2=1431003&view=diff
==============================================================================
--- 
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
 (original)
+++ 
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
 Wed Jan  9 18:27:04 2013
@@ -21,7 +21,7 @@
 
 package org.apache.airavata.core.gfac.utils;
 
-import org.apache.airavata.common.exception.UnspecifiedServerSettingsException;
+import 
org.apache.airavata.common.exception.UnspecifiedApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 
 public class PhoebusUtils {
@@ -31,7 +31,7 @@ public class PhoebusUtils {
        public static boolean isPhoebusDriverConfigurationsDefined(String 
hostAddress) throws Exception{
                try {
                        return 
getPhoebusDataChannelXIODriverParameters(hostAddress)!=null;
-               } catch (UnspecifiedServerSettingsException e) {
+               } catch (UnspecifiedApplicationSettingsException e) {
                        return false;
                }
        }


Reply via email to