airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1398964 [3/3] - in /airavata/trunk/modules: registry/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ registry/airavata-registry-test/ registry/airavata-registry-test/src/ registry/airav...
Date Tue, 16 Oct 2012 20:04:28 GMT
Added: airavata/trunk/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java?rev=1398964&view=auto
==============================================================================
--- airavata/trunk/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
(added)
+++ airavata/trunk/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
Tue Oct 16 20:04:27 2012
@@ -0,0 +1,314 @@
+/*
+*
+* 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.registry.api.test.util;
+
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
+import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
+import org.apache.airavata.persistance.registry.jpa.resources.Utils;
+import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.net.URL;
+import java.sql.*;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+public class Initialize {
+    private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
+    public static final String GATEWAY_ID = "gateway.id";
+    public static final String REGISTRY_USER = "registry.user";
+    public static final String REGISTRY_PASSWORD = "registry.password";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private NetworkServerControl server;
+    private static final String delimiter = ";";
+    public static final String PERSISTANT_DATA = "Configuration";
+
+    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+        if (suffix.length() > buffer.length()) {
+            return false;
+        }
+        // this loop is done on purpose to avoid memory allocation performance
+        // problems on various JDKs
+        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+        // implementation is ok though does allocation/copying
+        // StringBuffer.toString().endsWith() does massive memory
+        // allocation/copying on JDK 1.5
+        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+        int endIndex = suffix.length() - 1;
+        int bufferIndex = buffer.length() - 1;
+        while (endIndex >= 0) {
+            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+                return false;
+            }
+            bufferIndex--;
+            endIndex--;
+        }
+        return true;
+    }
+
+    public void initializeDB() {
+        String jdbcUrl = null;
+        String jdbcDriver = null;
+        URL resource = this.getClass().getClassLoader().getResource("repository.properties");
+        Properties properties = new Properties();
+        try {
+            properties.load(resource.openStream());
+        } catch (IOException e) {
+            System.out.println("Unable to read repository properties");
+        }
+        jdbcDriver = properties.getProperty("registry.jdbc.driver");
+        jdbcUrl = properties.getProperty("registry.jdbc.url");
+        String jdbcUser = properties.getProperty("registry.jdbc.user");
+        String jdbcPassword = properties.getProperty("registry.jdbc.password");
+        jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+
+        startDerbyInServerMode();
+//      startDerbyInEmbeddedMode();
+
+        Connection conn = null;
+        try {
+            Class.forName(Utils.getJDBCDriver()).newInstance();
+            conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
+            if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
+                executeSQLScript(conn);
+                System.out.println("New Database created for Registry");
+            } else {
+                System.out.println("Database already created for Registry!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure");
+        } finally {
+            try {
+                if (!conn.getAutoCommit()) {
+                    conn.commit();
+                }
+                conn.close();
+            } catch (SQLException e) {
+                logger.error(e.getMessage(), e);
+                e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+            }
+        }
+
+        GatewayResource gatewayResource = new GatewayResource();
+        gatewayResource.setGatewayName((String) properties.get(GATEWAY_ID));
+        gatewayResource.setOwner((String) properties.get(GATEWAY_ID));
+        gatewayResource.save();
+
+        UserResource userResource1 = (UserResource) gatewayResource.create(ResourceType.USER);
+        userResource1.setUserName((String) properties.get(REGISTRY_USER));
+        userResource1.setPassword((String) properties.get(REGISTRY_PASSWORD));
+        userResource1.save();
+
+        UserResource userResource2 = (UserResource) gatewayResource.create(ResourceType.USER);
+        userResource2.setUserName("testUser");
+        userResource2.setPassword("testPassword");
+        userResource2.save();
+
+        WorkerResource workerResource1 = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
+        workerResource1.setUser(userResource1.getUserName());
+        workerResource1.save();
+
+        WorkerResource workerResource2 = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
+        workerResource2.setUser(userResource2.getUserName());
+        workerResource2.save();
+
+    }
+
+    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+        try {
+            System.out.println("Running a query to test the database tables existence.");
+            // check whether the tables are already created with a query
+            Statement statement = null;
+            try {
+                statement = conn.createStatement();
+                ResultSet rs = statement.executeQuery("select * from " + tableName);
+                if (rs != null) {
+                    rs.close();
+                }
+            } finally {
+                try {
+                    if (statement != null) {
+                        statement.close();
+                    }
+                } catch (SQLException e) {
+                    return false;
+                }
+            }
+        } catch (SQLException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    private void executeSQLScript(Connection conn) throws Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+        try{
+
+        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("data-derby.sql");
+        reader = new BufferedReader(new InputStreamReader(inputStream));
+        String line;
+        while ((line = reader.readLine()) != null) {
+            line = line.trim();
+            if (line.startsWith("//")) {
+                continue;
+            }
+            if (line.startsWith("--")) {
+                continue;
+            }
+            StringTokenizer st = new StringTokenizer(line);
+            if (st.hasMoreTokens()) {
+                String token = st.nextToken();
+                if ("REM".equalsIgnoreCase(token)) {
+                    continue;
+                }
+            }
+            sql.append(" ").append(line);
+
+            // SQL defines "--" as a comment to EOL
+            // and in Oracle it may contain a hint
+            // so we cannot just remove it, instead we must end it
+            if (line.indexOf("--") >= 0) {
+                sql.append("\n");
+            }
+            if ((checkStringBufferEndsWith(sql, delimiter))) {
+                executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+                sql.replace(0, sql.length(), "");
+            }
+        }
+        // Catch any statements not followed by ;
+        if (sql.length() > 0) {
+            executeSQL(sql.toString(), conn);
+        }
+        }catch (IOException e){
+            logger.error("Error occurred while executing SQL script for creating Airavata
database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata
database", e);
+        }finally {
+            if (reader != null) {
+                reader.close();
+            }
+
+        }
+
+    }
+
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        // Check and ignore empty statements
+        if ("".equals(sql.trim())) {
+            return;
+        }
+
+        Statement statement = null;
+        try {
+            logger.debug("SQL : " + sql);
+
+            boolean ret;
+            int updateCount = 0, updateCountTotal = 0;
+            statement = conn.createStatement();
+            ret = statement.execute(sql);
+            updateCount = statement.getUpdateCount();
+            do {
+                if (!ret) {
+                    if (updateCount != -1) {
+                        updateCountTotal += updateCount;
+                    }
+                }
+                ret = statement.getMoreResults();
+                if (ret) {
+                    updateCount = statement.getUpdateCount();
+                }
+            } while (ret);
+
+            logger.debug(sql + " : " + updateCountTotal + " rows affected");
+
+            SQLWarning warning = conn.getWarnings();
+            while (warning != null) {
+                logger.info(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                // eliminating the table already exception for the derby
+                // database
+                logger.info("Table Already Exists", e);
+            } else {
+                throw new Exception("Error occurred while executing : " + sql, e);
+            }
+        } finally {
+            if (statement != null) {
+                try {
+                    statement.close();
+                } catch (SQLException e) {
+                    logger.error("Error occurred while closing result set.", e);
+                }
+            }
+        }
+    }
+
+    private void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName(Utils.getHost()),
+                    20000,
+                    Utils.getJDBCUser(), Utils.getJDBCUser());
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether
" +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether
" +
+                    "specified port is available");
+        }
+
+    }
+
+    private void startDerbyInEmbeddedMode(){
+        try {
+            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+            DriverManager.getConnection("jdbc:derby:memory:unit-testing-jpa;create=true").close();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        } catch (SQLException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
+    }
+
+    public void stopDerbyServer() {
+        try {
+            server.shutdown();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Added: airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql?rev=1398964&view=auto
==============================================================================
--- airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql
(added)
+++ airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql
Tue Oct 16 20:04:27 2012
@@ -0,0 +1,194 @@
+/*
+ *
+ * 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.
+ *
+ */
+create table Gateway
+(
+        gateway_name varchar(255),
+	    owner varchar(255),
+        PRIMARY KEY (gateway_name)
+);
+
+
+create table Configuration
+(
+        config_key varchar(255),
+        config_val varchar(255),
+        expire_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        PRIMARY KEY(config_key, config_val)
+);
+
+create table Users
+(
+        user_name varchar(255),
+        password varchar(255),
+        PRIMARY KEY(user_name)
+);
+
+create table Gateway_Worker
+(
+      gateway_name varchar(255),
+      user_name varchar(255),
+      PRIMARY KEY (gateway_name, user_name),
+      FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+      FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
+
+);
+
+create table Project
+(
+       gateway_name varchar(255),
+       user_name varchar(255),
+       project_name varchar(255),
+       PRIMARY KEY (project_name),
+       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+       FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table Published_Workflow
+(
+       gateway_name varchar(255),
+       created_user varchar(255),
+       publish_workflow_name varchar(255),
+       version varchar(255),
+       published_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       path varchar (255),
+       workflow_content BLOB,
+       PRIMARY KEY(gateway_name, publish_workflow_name),
+       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+       FOREIGN KEY (created_user) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table User_Workflow
+
+(
+       gateway_name varchar(255),
+       owner varchar(255),
+       template_name varchar(255),
+       last_updated_date TIMESTAMP DEFAULT CURRENT TIMESTAMP,
+       path varchar (255),
+       workflow_graph BLOB,
+       PRIMARY KEY(gateway_name, owner, template_name),
+       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+       FOREIGN KEY (owner) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+
+create table Host_Descriptor
+(
+       gateway_name varchar(255),
+       updated_user varchar(255),
+       host_descriptor_ID varchar(255),
+       host_descriptor_xml BLOB,
+       PRIMARY KEY(gateway_name, host_descriptor_ID),
+       FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+       FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table Service_Descriptor
+(
+         gateway_name varchar(255),
+         updated_user varchar(255),
+         service_descriptor_ID varchar(255),
+         service_descriptor_xml BLOB,
+         PRIMARY KEY(gateway_name,service_descriptor_ID),
+         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table Application_Descriptor
+(
+         gateway_name varchar(255),
+         updated_user varchar(255),
+         application_descriptor_ID varchar(255),
+         host_descriptor_ID varchar(255),
+         service_descriptor_ID varchar(255),
+         application_descriptor_xml BLOB,
+         PRIMARY KEY(gateway_name,application_descriptor_ID),
+         FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+         FOREIGN KEY (updated_user) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table Experiment
+(
+          project_name varchar(255),
+	      gateway_name varchar(255),
+          user_name varchar(255),
+          experiment_ID varchar(255),
+          submitted_date TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+          PRIMARY KEY(experiment_ID),
+          FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE CASCADE,
+          FOREIGN KEY (project_name) REFERENCES Project(project_name) ON DELETE CASCADE,
+          FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
+);
+
+create table Experiment_Data
+(
+	experiment_ID varchar(255),
+	name varchar(255),
+	username varchar(255),
+	PRIMARY KEY (experiment_ID)
+);
+
+create table Experiment_Metadata
+(
+	experiment_ID varchar(255),
+	metadata BLOB,
+	PRIMARY KEY (experiment_ID)
+);
+
+
+create table Workflow_Data
+(
+       experiment_ID varchar(255),
+       workflow_instanceID varchar(255),
+       template_name varchar(255),
+       status varchar(100),
+       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+       PRIMARY KEY(workflow_instanceID),
+       FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
+);
+
+create table Node_Data
+(
+       workflow_instanceID varchar(255),
+       node_id varchar(255),
+       node_type varchar(255),
+       inputs BLOB,
+       outputs BLOB,
+       status varchar(100),
+       start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+       last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+       PRIMARY KEY(workflow_instanceID, node_id),
+       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON
DELETE CASCADE
+);
+
+create table Gram_Data
+(
+       workflow_instanceID varchar(255),
+       node_id varchar(255),
+       rsl BLOB,
+       invoked_host varchar(255),
+       local_Job_ID varchar(255),
+       PRIMARY KEY(workflow_instanceID, node_id),
+       FOREIGN KEY (workflow_instanceID) REFERENCES Workflow_Data(workflow_instanceID) ON
DELETE CASCADE
+);
+
+

Added: airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/repository.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/repository.properties?rev=1398964&view=auto
==============================================================================
--- airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/repository.properties
(added)
+++ airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/repository.properties
Tue Oct 16 20:04:27 2012
@@ -0,0 +1,96 @@
+#
+#
+# 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.
+#
+#
+
+#
+# Properties for JCR Registry interface. By default, Apache Jackrabbit is used.
+#
+#jcr.class=org.apache.jackrabbit.core.RepositoryFactoryImpl
+jcr.class=org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory
+org.apache.jackrabbit.repository.uri=http://localhost:8081/rmi
+jcr.user=admin
+jcr.pass=admin
+
+
+#
+# Class which implemented Scheduler interface. It will be used to determine a Provider
+#
+scheduler.class= org.apache.airavata.core.gfac.scheduler.impl.SchedulerImpl
+
+#
+# Data Service Plugins classes
+#
+datachain.classes= org.apache.airavata.core.gfac.extension.data.RegistryDataService
+
+#
+# Pre execution Plugins classes. For example, GridFTP Input Staging
+#
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.GridFtpInputStaging
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.HttpInputStaging
+
+#
+# Post execution Plugins classes. For example, GridFTP Output Staging
+#
+postchain.classes= org.apache.airavata.core.gfac.extension.post.GridFtpOutputStaging
+postchain.classes= org.apache.airavata.core.gfac.extension.post.OutputRegister
+trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
+
+#Configuring your implementation for Provenance Registry, if you have a implementation for
AiravataProvenanceRegstry put the
+#full qualified path name to property name class.provenance.registry.accessor,
+#We have a mysql JPA provenanceRegistry implementation built in but you can write your own
+#class.provenance.registry.accessor=org.apache.airavata.provenance.impl.jpa.AiravataJPAProvenanceRegistry
+
+#
+# SSH private key location. It will be used by SSHProvider
+#
+# ssh.key=/home/user/.ssh/id_rsa
+# ssh.keypass=
+# ssh.username=usernameAtHost
+
+#
+# MyProxy credential. It will be used by GridFTP Plugins and GramProvider.
+#
+myproxy.server=myproxy.teragrid.org
+myproxy.user=username
+myproxy.pass=password
+myproxy.life=3600
+#Port details will be used by gfac-axis2 when deployed on tomcat
+port=8080
+#ip=192.2.33.12 if you configure the ip we will pick this ip address rather picking it from
axisconfiguration
+
+#Registry Configuration
+class.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+registry.user=admin
+registry.password=admin
+gateway.id=default
+registry.jdbc.user=airavata
+registry.jdbc.password=airavata
+
+#for mysql
+#registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+
+#for derby
+#registry.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+#registry.jdbc.url=jdbc:derby://localhost:20000/memory:persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.url=jdbc:derby:memory:unit-testing;create=true;user=airavata;password=airavata
+
+

Modified: airavata/trunk/modules/registry/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/pom.xml?rev=1398964&r1=1398963&r2=1398964&view=diff
==============================================================================
--- airavata/trunk/modules/registry/pom.xml (original)
+++ airavata/trunk/modules/registry/pom.xml Tue Oct 16 20:04:27 2012
@@ -32,6 +32,7 @@
             <modules>
                 <module>airavata-jpa-registry</module>
                 <module>airavata-registry-service</module>
+                <module>airavata-registry-test</module>
             </modules>
         </profile>
     </profiles>

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/Monitor.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/Monitor.java?rev=1398964&r1=1398963&r2=1398964&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/Monitor.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/Monitor.java
Tue Oct 16 20:04:27 2012
@@ -51,6 +51,8 @@ public class Monitor extends EventProduc
     protected boolean print;
 
     protected long timeout = 20000L;
+
+    protected boolean status = false;
     
     /**
      * Constructs a Monitor.
@@ -64,6 +66,7 @@ public class Monitor extends EventProduc
         // it does not have and filters
         this.eventDataMap.put(DEFAULT_MODEL_KEY, new MonitorEventData());
 
+
     }
 
     /**
@@ -207,6 +210,7 @@ public class Monitor extends EventProduc
         this.wsmgClient.setTimeout(this.getTimeout());
         //Users can set the timeout and interval for the subscription using wsmg setter methods,
here we use the default values
         this.wsmgClient.subscribe();
+        this.status = true;
 
         // Enable/disable some menu items and show the monitor panel.
         sendSafeEvent(new Event(Type.MONITOR_STARTED));
@@ -217,6 +221,7 @@ public class Monitor extends EventProduc
         sendSafeEvent(new Event(Type.MONITOR_STOPED));
 
         client.unsubscribe();
+        this.status = false;
     }
 
     public void setPrint(boolean print) {
@@ -230,4 +235,12 @@ public class Monitor extends EventProduc
     public void setTimeout(long timeout) {
         this.timeout = timeout;
     }
+
+    public boolean isStatus() {
+        return status;
+    }
+
+    public void setStatus(boolean status) {
+        this.status = status;
+    }
 }
\ No newline at end of file

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java?rev=1398964&r1=1398963&r2=1398964&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
Tue Oct 16 20:04:27 2012
@@ -359,6 +359,16 @@ public class RunMenuItem  implements Eve
         AbstractAction action = new AbstractAction() {
             private WorkflowInterpreterLaunchWindow window;
             public void actionPerformed(ActionEvent e) {
+//                if(engine.getMonitor().isStatus()){
+//                    if (JOptionPane.showConfirmDialog(null,
+//                            "A previous workflow execution data needs to be cleared before
launching another workflow. Do you wish to continue?",
+//                            "Run Workflow", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
+//                        //TODO: add clean up workflow interpretter
+//                        cleanup();
+//                    }else{
+//                        return;
+//                    }
+//                }
                 if (this.window == null) {
                     this.window = new WorkflowInterpreterLaunchWindow(engine);
                 }



Mime
View raw message