airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1436516 - in /airavata/trunk/tools: ./ registry-migrate/ registry-migrate/src/ registry-migrate/src/main/ registry-migrate/src/main/java/ registry-migrate/src/main/java/org/ registry-migrate/src/main/java/org/apache/ registry-migrate/src/m...
Date Mon, 21 Jan 2013 18:01:21 GMT
Author: chathuri
Date: Mon Jan 21 18:01:20 2013
New Revision: 1436516

URL: http://svn.apache.org/viewvc?rev=1436516&view=rev
Log:
adding project for registry migration

Added:
    airavata/trunk/tools/registry-migrate/
    airavata/trunk/tools/registry-migrate/pom.xml
    airavata/trunk/tools/registry-migrate/src/
    airavata/trunk/tools/registry-migrate/src/main/
    airavata/trunk/tools/registry-migrate/src/main/java/
    airavata/trunk/tools/registry-migrate/src/main/java/org/
    airavata/trunk/tools/registry-migrate/src/main/java/org/apache/
    airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/
    airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/
    airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/
    airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/DBMigrator.java
    airavata/trunk/tools/registry-migrate/src/main/resources/
    airavata/trunk/tools/registry-migrate/src/main/resources/airavata-server.properties
    airavata/trunk/tools/registry-migrate/src/main/resources/migrate_derby.sql
    airavata/trunk/tools/registry-migrate/src/main/resources/migrate_mysql.sql
Modified:
    airavata/trunk/tools/pom.xml

Modified: airavata/trunk/tools/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/pom.xml?rev=1436516&r1=1436515&r2=1436516&view=diff
==============================================================================
--- airavata/trunk/tools/pom.xml (original)
+++ airavata/trunk/tools/pom.xml Mon Jan 21 18:01:20 2013
@@ -31,6 +31,7 @@
             </activation>
             <modules>
                 <module>phoebus-integration</module>
+		<module>registry-migrate</module>
             </modules>
         </profile>
     </profiles>

Added: airavata/trunk/tools/registry-migrate/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-migrate/pom.xml?rev=1436516&view=auto
==============================================================================
--- airavata/trunk/tools/registry-migrate/pom.xml (added)
+++ airavata/trunk/tools/registry-migrate/pom.xml Mon Jan 21 18:01:20 2013
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata-tools-parent</artifactId>
+        <version>0.6-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.airavata</groupId>
+    <artifactId>registry-migrate</artifactId>
+    <packaging>jar</packaging>
+    <name>registry-migrate</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-jpa-registry</artifactId>
+            <version>0.6-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.9.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>10.9.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+            <version>10.9.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbytools</artifactId>
+            <version>10.9.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-all</artifactId>
+            <version>2.2.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>jcl104-over-slf4j</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/DBMigrator.java
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/DBMigrator.java?rev=1436516&view=auto
==============================================================================
--- airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/DBMigrator.java
(added)
+++ airavata/trunk/tools/registry-migrate/src/main/java/org/apache/airavata/registry/migrate/DBMigrator.java
Mon Jan 21 18:01:20 2013
@@ -0,0 +1,296 @@
+/*
+ *
+ * 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.migrate;
+
+import org.apache.airavata.common.exception.AiravataConfigurationException;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.AiravataRegistryFactory;
+import org.apache.airavata.registry.api.AiravataUser;
+import org.apache.airavata.registry.api.Gateway;
+import org.apache.airavata.registry.api.exception.RegistryAccessorInstantiateException;
+import org.apache.airavata.registry.api.exception.RegistryAccessorInvalidException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URL;
+import java.sql.*;
+import java.util.*;
+import java.util.Date;
+
+public class DBMigrator {
+    private static final Logger logger = LoggerFactory.getLogger(DBMigrator.class);
+    private static final String delimiter = ";";
+    private static final String MIGRATE_SQL_DERBY = "migrate_derby.sql";
+    private static final String MIGRATE_SQL_MYSQL = "migrate_mysql.sql";
+    private static final String AIRAVATA_PROPERTIES = "airavata-server.properties";
+    private static final String MIGRATED_AIRAVATA_VERSION = "migrated.airavata.version";
+    private static final String DEFAULT_SYSTEM_GATEWAY = "system.gateway";
+    private static final String DEFAULT_SYSTEM_USER = "system.user";
+
+
+
+    public static void main(String[] args) {
+         updateDB("jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata",
+                 "airavata",
+                 "airavata");
+    }
+
+    //we assume given database is up and running
+    public static void updateDB (String jdbcUrl, String jdbcUser, String jdbcPwd){
+        Scanner in = new Scanner(System.in);
+        if (jdbcPwd == null){
+            System.out.println("Enter JDBC password : ");
+            jdbcPwd = in.next();
+        }
+        File sqlFile = null;
+        String dbType = getDBType(jdbcUrl);
+        String jdbcDriver = null;
+
+        Connection connection;
+        try {
+            if (dbType.contains("derby")){
+                jdbcDriver = "org.apache.derby.jdbc.ClientDriver";
+                URL url = DBMigrator.class.getClassLoader()
+                        .getResource(MIGRATE_SQL_DERBY);
+                sqlFile = new File(url.toURI());
+
+            } else if (dbType.contains("mysql")){
+                jdbcDriver = "com.mysql.jdbc.Driver";
+                URL url = DBMigrator.class.getClassLoader()
+                        .getResource(MIGRATE_SQL_MYSQL);
+                sqlFile = new File(url.toURI());
+            }
+            Class.forName(jdbcDriver).newInstance();
+            connection = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPwd);
+            InputStream sqlStream = new FileInputStream(sqlFile);
+            if (canUpdated()){
+                executeSQLScript(connection, sqlStream);
+                //update configuration table with airavata version
+                updateConfigTable();
+            }
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static boolean canUpdated (){
+        try {
+            AiravataRegistry2 registry = getRegistry();
+            Object configuration = registry.getConfiguration(MIGRATED_AIRAVATA_VERSION);
+            if (configuration != null){
+                return false;
+            } else {
+                return true;
+            }
+        } catch (RegistryAccessorInvalidException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    private static void updateConfigTable (){
+        try {
+            AiravataRegistry2 registry = getRegistry();
+            registry.addConfiguration(MIGRATED_AIRAVATA_VERSION, registry.getVersion().getVersion(),
getCurrentDate());
+        } catch (RegistryAccessorInvalidException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static Date getCurrentDate (){
+        Calendar cal = Calendar.getInstance();
+        Date date = cal.getTime();
+        return date;
+    }
+
+    private static AiravataRegistry2 getRegistry() throws RegistryAccessorInvalidException
{
+        try {
+            URL url = DBMigrator.class.getClassLoader()
+                    .getResource(AIRAVATA_PROPERTIES);
+            Properties properties = new Properties();
+            properties.load(url.openStream());
+            String gatewayName = properties.getProperty(DEFAULT_SYSTEM_GATEWAY);
+            String airavataUserName = properties.getProperty(DEFAULT_SYSTEM_USER);
+            Gateway gateway = new Gateway(gatewayName);
+            AiravataUser airavataUser = new AiravataUser(airavataUserName);
+            AiravataRegistry2 registry = AiravataRegistryFactory.getRegistry(gateway, airavataUser);
+            return registry;
+        } catch (RegistryAccessorInstantiateException e) {
+            e.printStackTrace();
+        } catch (RegistryException e) {
+            e.printStackTrace();
+        } catch (AiravataConfigurationException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    private static void executeSQLScript(Connection conn, InputStream inputStream) throws
Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+        try{
+            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))) {
+                    String sqlString = sql.substring(0, sql.length() - delimiter.length());
+                    System.out.println("##########sql string = " + sqlString);
+                    executeSQL(sqlString, conn);
+                    sql.replace(0, sql.length(), "");
+                }
+            }
+            // Catch any statements not followed by ;
+            if (sql.length() > 0) {
+                System.out.println("sql string = " + sql.toString());
+                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 String getDBType(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    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;
+    }
+
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        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.warn(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                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);
+                }
+            }
+        }
+    }
+}

Added: airavata/trunk/tools/registry-migrate/src/main/resources/airavata-server.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-migrate/src/main/resources/airavata-server.properties?rev=1436516&view=auto
==============================================================================
--- airavata/trunk/tools/registry-migrate/src/main/resources/airavata-server.properties (added)
+++ airavata/trunk/tools/registry-migrate/src/main/resources/airavata-server.properties Mon
Jan 21 18:01:20 2013
@@ -0,0 +1,233 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+#
+#  This properties file provides configuration for all Airavata Services: 
+#  Registry, Workflow Interpreter, GFac, Message Broker, Message Box
+#
+###########################################################################
+
+###########################################################################
+# Airavata Embedded-Tomcat Server Configuration
+###########################################################################
+# By default, tomcat runs on port 80. If the port is changed, it will be  
+#  have to be specified with port properties. This will be picked up by 
+#  the registry service to register the service end-points.
+
+port=8080
+
+# Axis2 server automatically picks up IP address from axis configuration, 
+#  but some DHCP enables machines do not report correct ip addresses,  
+#  in which case, the IP address can be manually specified. 
+
+#ip=192.2.33.12
+
+###########################################################################
+# Airavata Registry Configuration
+###########################################################################
+
+#registry.user=admin
+#registry.password=admin
+gateway.id=default
+#registry.jdbc.user=airavata
+#registry.jdbc.password=airavata
+#start.derby.server.mode=true
+
+system.gateway=default
+system.user=admin
+system.password=admin
+
+#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.ClientDriver
+#registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+
+###########################################################################
+# Airavata Workflow Interpreter Configurations
+###########################################################################
+
+runInThread=true
+provenance=true
+provenanceWriterThreadPoolSize=20
+gfac.embedded=true
+
+#
+# Security Configuration used by Airavata Generic Factory Service
+#  to interact with Computational Resources.
+#
+
+###########################################################################
+# Airavata GFac MyProxy GSI credentials to access Grid Resources.
+###########################################################################
+
+myproxy.server=myproxy.teragrid.org
+myproxy.user=username
+myproxy.pass=password
+myproxy.life=3600
+# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
+trusted.cert.location=/path/to/trusted/certificates
+
+# SSH PKI key pair is SSH based authentication is used.
+#ssh.key=/home/user/.ssh/id_rsa
+#ssh.keypass=
+#ssh.username=usernameAtHost
+
+###########################################################################
+# Airavata Message Broker Basic Configurations.
+#  the Advanced section provides detailed custom configuration properties.
+###########################################################################
+
+# Default derby database configuration
+broker.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+broker.jdbc.url=jdbc:derby:wsmg;create=true;user=airavata;password=airavata
+
+# Note: This database will only be used  if 'broker.storage.type=persistent' 
+#       is set in advanced properties below.
+# MySql database configuration
+#broker.jdbc.driver=com.mysql.jdbc.Driver
+#broker.jdbc.url=jdbc:mysql://localhost:3306/wsmg?user=airavata&password=airavata
+
+###########################################################################
+# Airavata Message Box Basic Configurations, 
+#  the Advanced section provides detailed custom configuration properties.
+###########################################################################  
+
+# Default derby database
+msgBox.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+msgBox.jdbc.url=jdbc:derby:wsmg;create=true;user=airavata;password=airavata
+
+# MySql database configuration
+#msgBox.jdbc.driver=com.mysql.jdbc.Driver
+#msgBox.jdbc.url=jdbc:mysql://localhost:3306/wsmg?user=airavata&password=airavata
+
+###########################################################################
+# Advance configuration to change service implementations
+###########################################################################
+
+#Update the server context root path if airavata server is deployed under a different context
root other than axis2
+#server.context-root=axis2
+
+#
+# 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
+
+#
+# Advanced Message Broker Configurations
+#
+
+#socket time out in milliseconds for sending messages. (defaults is 20000)
+broker.socket.timeout=60000
+
+broker.storage.type=persistent
+#broker.storage.type=memory
+
+#specifies wether delivery component should be started or not.
+broker.start.delivery.thread=true
+
+#fixed thread pool based delivery
+#broker.delivery.method=pcrew
+
+#dynamic thread pool based delivery
+#broker.delivery.method=parallel
+
+#single thread delivery
+broker.delivery.method=serial
+
+#number of message delivery failures before a url become black listed (default is 2)
+#broker.msg.delivery.retries=2
+
+#time period (in seconds) a url will be kept blacklisted (default is 5 seconds) 
+#consumer.expiration.time.gap=5 
+
+#maximum number of messages to be send to a one consumer/url at time. 
+#applicable if 'broker.delivery.method' is 'pcrew' . (default is 10)
+
+#sending.batch.size=10
+
+#size of the thread pool. only applicable if 'broker.delivery.method' is 'pcrew'. (default
is 4)
+#sending.thread.pool.size=4
+
+#
+# Advanced Message Box Configurations
+# 
+msgBox.usedatabase=true
+messagePreservationDays=2
+messagePreservationHours=0
+messagePreservationMinutes=0
+messagePerservationIntervalDays=0
+messagePerservationIntervalHours=1
+messagePerservationIntervalMinutes=0
+
+###---------------------------REGISTRY API IMPLEMENTATION---------------------------###
+
+class.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.registry.accessor=org.apache.airavata.rest.client.RegistryClient
+
+###---------------------REGISTRY API IMPLEMENTATION - CUSTOM SETTINGS----------------------###
+
+#for mysql [AiravataJPARegistry]
+#registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+
+#for derby [AiravataJPARegistry]
+registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.user=airavata
+registry.jdbc.password=airavata
+start.derby.server.mode=true
+
+default.registry.user=admin
+default.registry.password=admin
+default.registry.password.hash.method=SHA
+default.registry.gateway=default
+
+#for rest [RegistryClient]
+#registry.jdbc.url=http://localhost:9080/airavata-services
+
+#user defined registry accessor classes
+#class.provenance.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.configuration.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.descriptor.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.project.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.user.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+#class.published.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+

Added: airavata/trunk/tools/registry-migrate/src/main/resources/migrate_derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-migrate/src/main/resources/migrate_derby.sql?rev=1436516&view=auto
==============================================================================
--- airavata/trunk/tools/registry-migrate/src/main/resources/migrate_derby.sql (added)
+++ airavata/trunk/tools/registry-migrate/src/main/resources/migrate_derby.sql Mon Jan 21
18:01:20 2013
@@ -0,0 +1,12 @@
+ALTER TABLE Configuration ADD category_id varchar(255) NOT NULL DEFAULT 'SYSTEM';
+
+ALTER TABLE Configuration DROP PRIMARY KEY;
+
+ALTER TABLE Configuration ADD PRIMARY KEY(config_key, config_val, category_id);
+
+ALTER TABLE Node_Data
+ADD execution_index int NOT NULL DEFAULT 0;
+
+ALTER TABLE Node_Data DROP PRIMARY KEY;
+
+ALTER TABLE Node_Data ADD PRIMARY KEY(workflow_instanceID, node_id, execution_index);
\ No newline at end of file

Added: airavata/trunk/tools/registry-migrate/src/main/resources/migrate_mysql.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-migrate/src/main/resources/migrate_mysql.sql?rev=1436516&view=auto
==============================================================================
--- airavata/trunk/tools/registry-migrate/src/main/resources/migrate_mysql.sql (added)
+++ airavata/trunk/tools/registry-migrate/src/main/resources/migrate_mysql.sql Mon Jan 21
18:01:20 2013
@@ -0,0 +1,11 @@
+ALTER TABLE Configuration
+ADD category_id varchar(255);
+
+UPDATE Configuration SET category_id="SYSTEM" ;
+
+ALTER TABLE Configuration DROP PRIMARY KEY, ADD PRIMARY KEY(config_key, config_val, category_id);
+
+ALTER TABLE Node_Data
+ADD execution_index int NOT NULL;
+
+ALTER TABLE Node_Data DROP PRIMARY KEY, ADD PRIMARY KEY(workflow_instanceID, node_id, execution_index);
\ No newline at end of file



Mime
View raw message