You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/12/06 21:25:15 UTC

svn commit: r1418055 - in /airavata/trunk/samples/airavata-client: ./ create-application/ create-application/src/ create-application/src/main/ create-application/src/main/java/ create-application/src/main/java/org/ create-application/src/main/java/org/...

Author: lahiru
Date: Thu Dec  6 20:25:13 2012
New Revision: 1418055

URL: http://svn.apache.org/viewvc?rev=1418055&view=rev
Log:
adding new sample for airavata-client use-cases.

Added:
    airavata/trunk/samples/airavata-client/
    airavata/trunk/samples/airavata-client/create-application/
    airavata/trunk/samples/airavata-client/create-application/README.txt
    airavata/trunk/samples/airavata-client/create-application/build.xml
    airavata/trunk/samples/airavata-client/create-application/src/
    airavata/trunk/samples/airavata-client/create-application/src/main/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/Airavata.iml
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/
    airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/CreateApplication.java
    airavata/trunk/samples/airavata-client/create-application/src/main/resources/
    airavata/trunk/samples/airavata-client/create-application/src/main/resources/registry.properties
    airavata/trunk/samples/airavata-client/workflow-run/
    airavata/trunk/samples/airavata-client/workflow-run/README.txt
    airavata/trunk/samples/airavata-client/workflow-run/build.xml
    airavata/trunk/samples/airavata-client/workflow-run/src/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java
    airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/
    airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/EchoWorkflow.xwf
    airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/registry.properties

Added: airavata/trunk/samples/airavata-client/create-application/README.txt
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/README.txt?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/README.txt (added)
+++ airavata/trunk/samples/airavata-client/create-application/README.txt Thu Dec  6 20:25:13 2012
@@ -0,0 +1 @@
+

Added: airavata/trunk/samples/airavata-client/create-application/build.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/build.xml?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/build.xml (added)
+++ airavata/trunk/samples/airavata-client/create-application/build.xml Thu Dec  6 20:25:13 2012
@@ -0,0 +1,50 @@
+<?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.client.samples.CreateApplication" 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}/samples/create-workflow/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}">
+            <classpath refid="javac.classpath"/>
+        </javac>
+    </target>
+</project>

Added: airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/Airavata.iml
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/Airavata.iml?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/Airavata.iml (added)
+++ airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/Airavata.iml Thu Dec  6 20:25:13 2012
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/airavata-api" isTestSource="false" packagePrefix="org.apache.airavata.client" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="lib" level="project" />
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.exportAsHtml" value="true" />
+        <entry key="property.exportAsXml" value="true" />
+        <entry key="property.exportBaseDir" value="" />
+        <entry key="property.exportCreateArchiveDir" value="false" />
+        <entry key="property.exportOpenBrowser" value="true" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

Added: airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/CreateApplication.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/CreateApplication.java?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/CreateApplication.java (added)
+++ airavata/trunk/samples/airavata-client/create-application/src/main/java/org/apache/airavata/airavata-api/samples/CreateApplication.java Thu Dec  6 20:25:13 2012
@@ -0,0 +1,131 @@
+package org.apache.airavata.client.samples;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.registry.api.PasswordCallback;
+import org.apache.airavata.rest.client.PasswordCallbackImpl;
+import org.apache.airavata.schemas.gfac.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CreateApplication {
+    private static final Logger log = LoggerFactory.getLogger(CreateApplication.class);
+
+    private static int port;
+    private static String serverUrl;
+    private static String serverContextName;
+
+    private static String registryURL;
+
+    private static String gatewayName = "default";
+    private static String userName = "admin";
+    private static String password = "admin";
+
+    private static AiravataAPI airavataAPI;
+
+    public static void main(String[] args) throws AiravataAPIInvocationException, IOException, URISyntaxException {
+
+        //creating airavata client object //
+        port = Integer.parseInt("8080");
+        serverUrl = "localhost";
+        serverContextName = "airavata-registry";
+
+        log.info("Configurations - port : " + port);
+        log.info("Configurations - serverUrl : " + serverUrl);
+        log.info("Configurations - serverContext : " + serverContextName);
+
+        registryURL = "http://" + serverUrl + ":" + port + "/" + serverContextName + "/api";
+
+        log.info("Configurations - Registry URL : " + registryURL);
+
+        PasswordCallback passwordCallback = new PasswordCallbackImpl(getUserName(), getPassword());
+        airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()),
+                getGatewayName(), getUserName(), passwordCallback);
+
+        //Now creating documents to be saved in to registry using above created airavata client object//
+
+        HostDescription descriptor = new HostDescription(GlobusHostType.type);
+        descriptor.getType().setHostName("localhost");
+        descriptor.getType().setHostAddress("127.0.0.1");
+
+        log.info("Saving host description ....");
+        airavataAPI.getApplicationManager().saveHostDescription(descriptor);
+
+        ServiceDescription serviceDescription = new ServiceDescription();
+        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
+        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
+        serviceDescription.getType().setName("Echo");
+        serviceDescription.getType().setDescription("Echo service");
+        InputParameterType parameter = InputParameterType.Factory.newInstance();
+        parameter.setParameterName("echo_input");
+        parameter.setParameterDescription("echo input");
+        ParameterType parameterType = parameter.addNewParameterType();
+        parameterType.setType(DataType.STRING);
+        parameterType.setName("String");
+        inputParameters.add(parameter);
+
+        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
+        outputParameter.setParameterName("echo_output");
+        outputParameter.setParameterDescription("Echo output");
+        ParameterType outputParaType = outputParameter.addNewParameterType();
+        outputParaType.setType(DataType.STRING);
+        outputParaType.setName("String");
+        outputParameters.add(outputParameter);
+
+        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
+        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
+
+        log.info("Saving service description ...");
+        airavataAPI.getApplicationManager().saveServiceDescription(serviceDescription);
+
+        // Deployment descriptor
+        ApplicationDeploymentDescription applicationDeploymentDescription = new ApplicationDeploymentDescription();
+        ApplicationDeploymentDescriptionType applicationDeploymentDescriptionType
+                = applicationDeploymentDescription.getType();
+        applicationDeploymentDescriptionType.addNewApplicationName().setStringValue("EchoApplication");
+        applicationDeploymentDescriptionType.setExecutableLocation("/bin/echo");
+        applicationDeploymentDescriptionType.setScratchWorkingDirectory("/tmp");
+
+        log.info("Saving deployment description ...");
+        airavataAPI.getApplicationManager().saveDeploymentDescription(serviceDescription.getType().getName(),
+                descriptor.getType().getHostName(), applicationDeploymentDescription);
+    }
+
+    public static int getPort() {
+        return port;
+    }
+
+    public static String getServerUrl() {
+        return serverUrl;
+    }
+
+    public static String getServerContextName() {
+        return serverContextName;
+    }
+
+    public static String getRegistryURL() {
+        return registryURL;
+    }
+
+    public static String getGatewayName() {
+        return gatewayName;
+    }
+
+    public static String getUserName() {
+        return userName;
+    }
+
+    public static String getPassword() {
+        return password;
+    }
+}

Added: airavata/trunk/samples/airavata-client/create-application/src/main/resources/registry.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/src/main/resources/registry.properties?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/src/main/resources/registry.properties (added)
+++ airavata/trunk/samples/airavata-client/create-application/src/main/resources/registry.properties Thu Dec  6 20:25:13 2012
@@ -0,0 +1,54 @@
+#
+#
+# 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 to connect to Registry.
+#  Please do not use this for any server configurations.
+#
+###########################################################################
+
+###---------------------------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.gateway=default
+
+#for rest [RegistryClient]
+#registry.jdbc.url=http://localhost:9080/airavata-services
+

Added: airavata/trunk/samples/airavata-client/workflow-run/README.txt
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/README.txt?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/README.txt (added)
+++ airavata/trunk/samples/airavata-client/workflow-run/README.txt Thu Dec  6 20:25:13 2012
@@ -0,0 +1 @@
+

Added: airavata/trunk/samples/airavata-client/workflow-run/build.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/build.xml?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/build.xml (added)
+++ airavata/trunk/samples/airavata-client/workflow-run/build.xml Thu Dec  6 20:25:13 2012
@@ -0,0 +1,50 @@
+<?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.client.samples.RunWorkflow" 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}/samples/workflow-run/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}">
+            <classpath refid="javac.classpath"/>
+        </javac>
+    </target>
+</project>

Added: airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java (added)
+++ airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java Thu Dec  6 20:25:13 2012
@@ -0,0 +1,118 @@
+/*
+ *
+ * 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.client.samples;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.PasswordCallback;
+import org.apache.airavata.registry.api.workflow.ExperimentData;
+import org.apache.airavata.rest.client.PasswordCallbackImpl;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class RunWorkflow {
+    private static final Logger log = LoggerFactory.getLogger(RunWorkflow.class);
+
+    private static int port;
+    private static String serverUrl;
+    private static String serverContextName;
+
+    private static String registryURL;
+
+    private static String gatewayName = "default";
+    private static String userName = "admin";
+    private static String password = "admin";
+
+    private static AiravataAPI airavataAPI;
+
+    public static void main(String[] args) throws AiravataAPIInvocationException, IOException, URISyntaxException {
+
+        //creating airavata client object //
+        port = Integer.parseInt("8080");
+        serverUrl = "localhost";
+        serverContextName = "airavata-registry";
+
+        log.info("Configurations - port : " + port);
+        log.info("Configurations - serverUrl : " + serverUrl);
+        log.info("Configurations - serverContext : " + serverContextName);
+
+        registryURL = "http://" + serverUrl + ":" + port + "/" + serverContextName + "/api";
+
+        log.info("Configurations - Registry URL : " + registryURL);
+
+        PasswordCallback passwordCallback = new PasswordCallbackImpl(getUserName(), getPassword());
+        airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()),
+                getGatewayName(), getUserName(), passwordCallback);
+
+        String workflowName = "Echo";
+        List<WorkflowInput> workflowInputs = new ArrayList<WorkflowInput>();
+        String name = "echo_input";
+        String type = "String";
+        String value = "echo_output=ODI Test";
+        WorkflowInput workflowInput = new WorkflowInput(name, (type == null ||
+                type.isEmpty()) ? "String" : type, null, value, false);
+        workflowInputs.add(workflowInput);
+        String result
+                = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, "admin", "",
+                workflowName);
+        System.out.println("Workflow Experiment ID Returned : " + result);
+        List<ExperimentData> experimentDataList = airavataAPI.getProvenanceManager().getExperimentDataList(result);
+        for (ExperimentData data: experimentDataList){
+            System.out.println(data.getExperimentName() + ": " + data.getTopic());
+        }
+    }
+
+    public static int getPort() {
+        return port;
+    }
+
+    public static String getServerUrl() {
+        return serverUrl;
+    }
+
+    public static String getServerContextName() {
+        return serverContextName;
+    }
+
+    public static String getRegistryURL() {
+        return registryURL;
+    }
+
+    public static String getGatewayName() {
+        return gatewayName;
+    }
+
+    public static String getUserName() {
+        return userName;
+    }
+
+    public static String getPassword() {
+        return password;
+    }
+}

Added: airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/EchoWorkflow.xwf
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/EchoWorkflow.xwf?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/EchoWorkflow.xwf (added)
+++ airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/EchoWorkflow.xwf Thu Dec  6 20:25:13 2012
@@ -0,0 +1,140 @@
+<?xml version="1.0"?><xwf:workflow xwf:version="0.5" xmlns:xwf="http://airavata.apache.org/xbaya/xwf">
+  <xgr:graph xgr:version="0.5" xgr:type="ws" xmlns:xgr="http://airavata.apache.org/xbaya/graph">
+    <xgr:id>Workflow1</xgr:id>
+    <xgr:name>Workflow1</xgr:name>
+    <xgr:description></xgr:description>
+    <xgr:metadata>
+      <appinfo xmlns="http://www.w3.org/2001/XMLSchema">
+
+</appinfo>
+    </xgr:metadata>
+    <xgr:node xgr:type="ws">
+      <xgr:id>Echo_invoke</xgr:id>
+      <xgr:name>Echo:invoke</xgr:name>
+      <xgr:outputPort>Echo_invoke_out_0</xgr:outputPort>
+      <xgr:inputPort>Echo_invoke_in_0</xgr:inputPort>
+      <xgr:controlInPort>Echo_invoke_ctrl_in_0</xgr:controlInPort>
+      <xgr:controlOutPort>Echo_invoke_ctrl_out_0</xgr:controlOutPort>
+      <xgr:x>243</xgr:x>
+      <xgr:y>118</xgr:y>
+      <xgr:wsdl>Echo</xgr:wsdl>
+      <xgr:portType>{http://airavata.apache.org/schemas/gfac/2012/12}Echo</xgr:portType>
+      <xgr:operation>invoke</xgr:operation>
+    </xgr:node>
+    <xgr:node xgr:type="input">
+      <xgr:id>echo_input</xgr:id>
+      <xgr:name>echo_input</xgr:name>
+      <xgr:outputPort>Input_out_2</xgr:outputPort>
+      <xgr:x>45</xgr:x>
+      <xgr:y>97</xgr:y>
+      <xgr:config>
+        <xgr:description></xgr:description>
+        <xgr:dataType>{http://airavata.apache.org/schemas/gfac/2012/12}StringParameterType</xgr:dataType>
+        <xgr:visibility>true</xgr:visibility>
+      </xgr:config>
+    </xgr:node>
+    <xgr:node xgr:type="output">
+      <xgr:id>echo_output</xgr:id>
+      <xgr:name>echo_output</xgr:name>
+      <xgr:inputPort>Output_in_2</xgr:inputPort>
+      <xgr:x>481</xgr:x>
+      <xgr:y>111</xgr:y>
+      <xgr:config>
+        <xgr:description></xgr:description>
+        <xgr:dataType>{http://airavata.apache.org/schemas/gfac/2012/12}StringParameterType</xgr:dataType>
+      </xgr:config>
+    </xgr:node>
+    <xgr:port xgr:type="ws">
+      <xgr:id>Echo_invoke_in_0</xgr:id>
+      <xgr:name>echo_input</xgr:name>
+      <xgr:node>Echo_invoke</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="ws">
+      <xgr:id>Echo_invoke_out_0</xgr:id>
+      <xgr:name>echo_output</xgr:name>
+      <xgr:node>Echo_invoke</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>Echo_invoke_ctrl_in_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>Echo_invoke</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>Echo_invoke_ctrl_out_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>Echo_invoke</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="systemData">
+      <xgr:id>Input_out_2</xgr:id>
+      <xgr:name>Parameter</xgr:name>
+      <xgr:node>echo_input</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="systemData">
+      <xgr:id>Output_in_2</xgr:id>
+      <xgr:name>Parameter</xgr:name>
+      <xgr:node>echo_output</xgr:node>
+    </xgr:port>
+    <xgr:edge xgr:type="data">
+      <xgr:fromPort>Input_out_2</xgr:fromPort>
+      <xgr:toPort>Echo_invoke_in_0</xgr:toPort>
+    </xgr:edge>
+    <xgr:edge xgr:type="data">
+      <xgr:fromPort>Echo_invoke_out_0</xgr:fromPort>
+      <xgr:toPort>Output_in_2</xgr:toPort>
+    </xgr:edge>
+  </xgr:graph>
+  <xwf:wsdls>
+    <xwf:wsdl xwf:id="Echo">&lt;wsdl:definitions name="Echo" targetNamespace="http://airavata.apache.org/schemas/gfac/2012/12"
+  xmlns:typens="http://airavata.apache.org/schemas/gfac/2012/12/Echo/xsd" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:globalTypens="http://airavata.apache.org/schemas/gfac/2012/12/xsd"
+  xmlns:wsdlns="http://airavata.apache.org/schemas/gfac/2012/12" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+  xmlns:gfac="http://airavata.apache.org/schemas/gfac/2012/12" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  &lt;wsdl:types>
+    &lt;schema elementFormDefault="unqualified" targetNamespace="http://airavata.apache.org/schemas/gfac/2012/12/Echo/xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+      &lt;import namespace="http://airavata.apache.org/schemas/gfac/2012/12" schemaLocation="http://airavata.apache.org/schemas/gfac/2012/12/GFacParameterTypes.xsd" />
+      &lt;element name="invoke_InputParams" type="typens:invoke_InputParamsType" />
+      &lt;complexType name="invoke_InputParamsType">
+        &lt;sequence>
+          &lt;element name="echo_input" type="gfac:StringParameterType">
+            &lt;annotation>
+              &lt;documentation />
+            &lt;/annotation>
+          &lt;/element>
+        &lt;/sequence>
+      &lt;/complexType>
+      &lt;element name="invoke_OutputParams" type="typens:invoke_OutputParamsType" />
+      &lt;complexType name="invoke_OutputParamsType">
+        &lt;sequence>
+          &lt;element name="echo_output" type="gfac:StringParameterType">
+            &lt;annotation>
+              &lt;documentation />
+            &lt;/annotation>
+          &lt;/element>
+        &lt;/sequence>
+      &lt;/complexType>
+    &lt;/schema>
+  &lt;/wsdl:types>
+  &lt;wsdl:message name="invoke_ResponseMessage_10099abd-885f-4f4d-8709-b131c6c3d058">
+    &lt;wsdl:part name="parameters" element="typens:invoke_OutputParams">
+    &lt;/wsdl:part>
+  &lt;/wsdl:message>
+  &lt;wsdl:message name="invoke_RequestMessage_e9b6a5f6-9ccd-411b-a7e6-41ab0e0acafd">
+    &lt;wsdl:part name="parameters" element="typens:invoke_InputParams">
+    &lt;/wsdl:part>
+  &lt;/wsdl:message>
+  &lt;wsdl:portType name="Echo">
+&lt;wsdl:documentation />
+    &lt;wsdl:operation name="invoke">
+&lt;wsdl:documentation />
+      &lt;wsdl:input name="invoke_RequestMessage_e9b6a5f6-9ccd-411b-a7e6-41ab0e0acafd" message="wsdlns:invoke_RequestMessage_e9b6a5f6-9ccd-411b-a7e6-41ab0e0acafd">
+    &lt;/wsdl:input>
+      &lt;wsdl:output name="invoke_ResponseMessage_10099abd-885f-4f4d-8709-b131c6c3d058" message="wsdlns:invoke_ResponseMessage_10099abd-885f-4f4d-8709-b131c6c3d058">
+    &lt;/wsdl:output>
+    &lt;/wsdl:operation>
+  &lt;/wsdl:portType>
+&lt;/wsdl:definitions></xwf:wsdl>
+  </xwf:wsdls>
+  <xwf:image>iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mN49Ojef2Iww6hC+ioE
+AJr2avQ9sXYrAAAAAElFTkSuQmCC
+</xwf:image>
+</xwf:workflow>
\ No newline at end of file

Added: airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/registry.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/registry.properties?rev=1418055&view=auto
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/registry.properties (added)
+++ airavata/trunk/samples/airavata-client/workflow-run/src/main/resources/registry.properties Thu Dec  6 20:25:13 2012
@@ -0,0 +1,54 @@
+#
+#
+# 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 to connect to Registry.
+#  Please do not use this for any server configurations.
+#
+###########################################################################
+
+###---------------------------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.gateway=default
+
+#for rest [RegistryClient]
+#registry.jdbc.url=http://localhost:9080/airavata-services
+