You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/04/15 15:33:10 UTC
git commit: AIRAVATA-1140
Repository: airavata
Updated Branches:
refs/heads/master bc390e74a -> 00ce4a830
AIRAVATA-1140
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/00ce4a83
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/00ce4a83
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/00ce4a83
Branch: refs/heads/master
Commit: 00ce4a830855a146470ecd53f450ad90768ee046
Parents: bc390e7
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Tue Apr 15 06:30:50 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Tue Apr 15 06:30:50 2014 -0700
----------------------------------------------------------------------
modules/distribution/airavata-client/pom.xml | 11 +-
.../src/main/assembly/bin-assembly.xml | 4 +-
modules/integration-tests/pom.xml | 96 ------------
.../apache/airavata/integration/BaseCaseIT.java | 35 ++---
samples/java-client/experiment/README | 24 +++
samples/java-client/experiment/build.xml | 51 +++++++
samples/java-client/experiment/pom.xml | 153 +++++++++++++++++++
.../airavata/api/samples/ExperimentSample.java | 105 +++++++++++++
samples/java-client/pom.xml | 28 ++++
9 files changed, 390 insertions(+), 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/modules/distribution/airavata-client/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/airavata-client/pom.xml b/modules/distribution/airavata-client/pom.xml
index b1d03bd..4acefcb 100644
--- a/modules/distribution/airavata-client/pom.xml
+++ b/modules/distribution/airavata-client/pom.xml
@@ -143,6 +143,11 @@
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ </dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
@@ -372,7 +377,11 @@
<artifactId>libthrift</artifactId>
<version>0.9.1</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-api-stubs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<properties>
<jersey.version>1.13</jersey.version>
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/modules/distribution/airavata-client/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/airavata-client/src/main/assembly/bin-assembly.xml b/modules/distribution/airavata-client/src/main/assembly/bin-assembly.xml
index aa42b07..e38d100 100644
--- a/modules/distribution/airavata-client/src/main/assembly/bin-assembly.xml
+++ b/modules/distribution/airavata-client/src/main/assembly/bin-assembly.xml
@@ -59,7 +59,7 @@
</includes>
</fileSet>
<fileSet>
- <directory>../../../samples/airavata-client</directory>
+ <directory>../../../samples/java-client</directory>
<outputDirectory>samples</outputDirectory>
<excludes>
<exclude>**/*.iml</exclude>
@@ -110,9 +110,11 @@
<include>org.apache.airavata:airavata-registry-cpi:jar</include>
<include>org.apache.airavata:airavata-jpa-registry:jar</include>
<include>org.apache.airavata:airavata-data-models:jar</include>
+ <include>org.apache.airavata:airavata-api-stubs:jar</include>
<include>org.apache.airavata:airavata-credential-store:jar</include>
<include>org.apache.airavata:airavata-gfac-core:jar</include>
<include>org.apache.airavata:airavata-client-api:jar</include>
+ <include>commons-cli:commons-cli:jar</include>
<!--include>org.apache.airavata:airavata-message-monitor:jar</include>
<include>org.apache.airavata:airavata-workflow-model-core:jar</include>
<include>org.apache.airavata:airavata-messenger-commons:jar</include>
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/modules/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index c89a560..9075a60 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -68,56 +68,10 @@
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
-
- <!-- execution>
- <id>unpack-artifacts</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat</artifactId>
- <version>${tomcat.version}</version>
- <type>zip</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${tomcat.extract.dir}</outputDirectory>
- </configuration>
- </execution -->
</executions>
</plugin>
<!-- Start and stop the server before and after the integration tests -->
- <!--plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <id>start-third-parties</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <executable>${project.build.directory}/apache-airavata-server-0.12-SNAPSHOT/bin/airavata-server.sh</executable>
- </configuration>
- </execution>
- <execution>
- <id>stop-third-parties</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <executable>${project.build.directory}/apache-airavata-server-0.12-SNAPSHOT/bin/airavata-server.sh stop</executable>
- </configuration>
- </execution>
- </executions>
- </plugin -->
-
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
@@ -229,30 +183,6 @@
<version>${project.version}</version>
<type>zip</type>
</dependency-->
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>distribution</artifactId>
- <type>pom</type>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>apache-airavata-server</artifactId>
- <type>pom</type>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
@@ -278,37 +208,11 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-registry-api</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
<artifactId>airavata-data-models</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-standalone-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-service</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
<artifactId>airavata-model-utils</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
index e7bf3d2..f32c714 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/BaseCaseIT.java
@@ -21,26 +21,33 @@
package org.apache.airavata.integration;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import junit.framework.Assert;
import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
import org.apache.airavata.client.tools.DocumentCreator;
import org.apache.airavata.model.util.ExperimentModelUtil;
-import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
+import org.apache.airavata.model.workspace.experiment.DataObjectType;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.JobState;
+import org.apache.airavata.model.workspace.experiment.JobStatus;
+import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
import org.apache.airavata.registry.api.workflow.ApplicationJob;
import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.server.ServerMain;
import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.*;
-import org.apache.commons.cli.ParseException;
+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.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* Integration test class.
*/
@@ -53,16 +60,6 @@ public class BaseCaseIT extends WorkflowIntegrationTestBase {
@BeforeTest
public void setUp() throws Exception {
- new Thread() {
- public void run() {
- try {
- ServerMain.main(new String[]{});
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }.start();
- Thread.sleep(10000);
this.airavataAPI = getAiravataAPI();
this.client = getClient();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/samples/java-client/experiment/README
----------------------------------------------------------------------
diff --git a/samples/java-client/experiment/README b/samples/java-client/experiment/README
new file mode 100644
index 0000000..3cfa344
--- /dev/null
+++ b/samples/java-client/experiment/README
@@ -0,0 +1,24 @@
+Creating an application using Airavata API
+==========================================
+
+This sample demonstrate how to create an Application to run in your localhost. This simply create an echo application to run in your machine with /bin/echo executable.
+
+Pre Requirements
+----------------
+
+1. You need to have executable /bin/echo which echo what is given as the argument (Linux or Mac system do have this executable by default)
+
+2. You have to have registry service running on http://localhost:8080/airavata-registry/api (If you start airavata server distribution without changing any configuration this service will start).
+
+
+Steps to Run
+------------
+
+1. Unpack Airavata server distribution and start with AIRAVATA_SERVER_HOME/bin/airavata-servers.sh.
+
+2. go to create-application folder in the airavata-client distribution and run following command.
+
+ ant run
+
+3. After successful run you can see your application has been created by starting xbaya using airavata xbaya distribution. Connect to the registry service using http://localhost:8080/airavata-registry/api, which is the default setting and you will see the Echo application has registered.
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/samples/java-client/experiment/build.xml
----------------------------------------------------------------------
diff --git a/samples/java-client/experiment/build.xml b/samples/java-client/experiment/build.xml
new file mode 100644
index 0000000..0061d68
--- /dev/null
+++ b/samples/java-client/experiment/build.xml
@@ -0,0 +1,51 @@
+<?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 name="samples" default="help" basedir=".">
+ <property name="airavata.home" value="../.."/>
+ <property name="lib.dir" value="${airavata.home}/lib"/>
+ <target name="help">
+ <echo/>
+ </target>
+ <property name="class.dir" value="target/classes"/>
+ <target name="clean">
+ <delete dir="target" quiet="true"/>
+ <delete dir="${class.dir}" quiet="true"/>
+ </target>
+ <target name="run" depends="compile">
+ <java classname="org.apache.airavata.api.samples.ExperimentSample" classpathref="javac.classpath" fork="true"/>
+ </target>
+ <target name="init">
+ <mkdir dir="${class.dir}"/>
+ <path id="javac.classpath">
+ <pathelement path="${class.dir}"/>
+ <pathelement path="${airavata.home}/lib"/>
+ <pathelement path="${airavata.home}/conf"/>
+ <pathelement path="${airavata.home}/samples/create-application/src/main/resources"/>
+ <fileset dir="${airavata.home}/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+ </target>
+ <target name="compile" depends="init" description="Compile all Java">
+ <javac srcdir="src" destdir="${class.dir}" debug="on">
+ <classpath refid="javac.classpath"/>
+ </javac>
+ </target>
+</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/samples/java-client/experiment/pom.xml
----------------------------------------------------------------------
diff --git a/samples/java-client/experiment/pom.xml b/samples/java-client/experiment/pom.xml
new file mode 100644
index 0000000..33346c0
--- /dev/null
+++ b/samples/java-client/experiment/pom.xml
@@ -0,0 +1,153 @@
+<?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-client-sample</artifactId>
+ <version>0.12-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>airavata-experiment-sample</artifactId>
+ <name>Samples - Single application experiment</name>
+ <url>http://airavata.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>distribution</artifactId>
+ <type>pom</type>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-webapp</artifactId>
+ <version>${axis2.version}</version>
+ <type>war</type>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-jpa-registry</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-client-api</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-registry-api</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-xc</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-jaxrs</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-json</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-data-models</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-model-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-api-stubs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>libthrift</artifactId>
+ <version>${thrift.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/samples/java-client/experiment/src/main/java/org/apache/airavata/api/samples/ExperimentSample.java
----------------------------------------------------------------------
diff --git a/samples/java-client/experiment/src/main/java/org/apache/airavata/api/samples/ExperimentSample.java b/samples/java-client/experiment/src/main/java/org/apache/airavata/api/samples/ExperimentSample.java
new file mode 100644
index 0000000..2a99269
--- /dev/null
+++ b/samples/java-client/experiment/src/main/java/org/apache/airavata/api/samples/ExperimentSample.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * 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.api.samples;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.Airavata.Client;
+import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.api.error.AiravataClientException;
+import org.apache.airavata.api.error.AiravataSystemException;
+import org.apache.airavata.api.error.ExperimentNotFoundException;
+import org.apache.airavata.api.error.InvalidRequestException;
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.tools.DocumentCreator;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ClientSettings;
+import org.apache.airavata.model.util.ExperimentModelUtil;
+import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
+import org.apache.airavata.model.workspace.experiment.DataObjectType;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
+import org.apache.airavata.schemas.gfac.DataType;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ExperimentSample {
+ private static final Logger log = LoggerFactory.getLogger(ExperimentSample.class);
+
+ protected static AiravataAPI getAiravataAPI() throws AiravataAPIInvocationException {
+ return AiravataAPIFactory.getAPI("default", "admin");
+ }
+
+ protected static Airavata.Client getClient() throws ApplicationSettingsException {
+ String THRIFT_SERVER_HOST = ClientSettings.getSetting("thrift.server.host");
+ int THRIFT_SERVER_PORT = Integer.parseInt(ClientSettings.getSetting("thrift.server.port"));
+ return AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+
+ }
+ public static void main(String[] args) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, ApplicationSettingsException, TException, AiravataAPIInvocationException {
+ AiravataAPI airavataAPI = getAiravataAPI();
+ DocumentCreator documentCreator = new DocumentCreator(airavataAPI);
+ documentCreator.createLocalHostDocs();
+
+ List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+ DataObjectType input = new DataObjectType();
+ input.setKey("echo_input");
+// input.setType(DataType.STRING.toString());
+ input.setValue("echo_output=Hello World");
+ exInputs.add(input);
+
+ List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+ DataObjectType output = new DataObjectType();
+ output.setKey("echo_output");
+ output.setType(DataType.STRING.toString());
+ output.setValue("");
+ exOut.add(output);
+
+ Experiment simpleExperiment =
+ ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
+ simpleExperiment.setExperimentOutputs(exOut);
+
+ ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+ scheduling.setResourceHostId("localhost");
+ UserConfigurationData userConfigurationData = new UserConfigurationData();
+ userConfigurationData.setAiravataAutoSchedule(false);
+ userConfigurationData.setOverrideManualScheduledParams(false);
+ userConfigurationData.setComputationalResourceScheduling(scheduling);
+ simpleExperiment.setUserConfigurationData(userConfigurationData);
+
+
+ Client client = getClient();
+ final String expId = client.createExperiment(simpleExperiment);
+ System.out.println("Experiment Id returned : " + expId);
+
+
+ client.launchExperiment(expId,"testToken");
+
+ System.out.println("Launched successfully");
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/00ce4a83/samples/java-client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/java-client/pom.xml b/samples/java-client/pom.xml
new file mode 100644
index 0000000..198a3dc
--- /dev/null
+++ b/samples/java-client/pom.xml
@@ -0,0 +1,28 @@
+<?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</artifactId>
+ <version>0.12-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>airavata-client-sample</artifactId>
+ <name>Samples - Airavata Client Samples</name>
+ <packaging>pom</packaging>
+ <url>http://airavata.apache.org/</url>
+
+ <modules>
+ <module>experiment</module>
+ </modules>
+</project>