You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2014/11/06 23:40:07 UTC
[1/2] airavata git commit: Gfac - Removed AcutalParameter objects and
replace Input and Output DataObjectTypes
Repository: airavata
Updated Branches:
refs/heads/gfac_appcatalog_int 088e80f03 -> b52499eb7
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index c5a96f9..6e1b8b7 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -28,7 +28,6 @@ import org.apache.airavata.common.utils.AiravataZKUtils;
import org.apache.airavata.common.utils.DBUtil;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.credential.store.store.CredentialReader;
import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
import org.apache.airavata.gfac.Constants;
@@ -39,16 +38,48 @@ import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.handler.GFacHandlerException;
import org.apache.airavata.gfac.core.states.GfacExperimentState;
import org.apache.airavata.gfac.core.states.GfacPluginState;
-import org.apache.airavata.model.appcatalog.computeresource.*;
-import org.apache.airavata.model.workspace.experiment.*;
-import org.apache.airavata.model.workspace.experiment.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.GlobusJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission;
+import org.apache.airavata.model.workspace.experiment.ActionableGroup;
+import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
+import org.apache.airavata.model.workspace.experiment.ErrorCategory;
+import org.apache.airavata.model.workspace.experiment.ErrorDetails;
+import org.apache.airavata.model.workspace.experiment.JobDetails;
+import org.apache.airavata.model.workspace.experiment.JobState;
+import org.apache.airavata.model.workspace.experiment.JobStatus;
import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.ChildDataType;
import org.apache.airavata.registry.cpi.CompositeIdentifier;
import org.apache.airavata.registry.cpi.Registry;
-import org.apache.airavata.schemas.gfac.*;
+import org.apache.airavata.schemas.gfac.BooleanArrayType;
+import org.apache.airavata.schemas.gfac.BooleanParameterType;
+import org.apache.airavata.schemas.gfac.DataType;
+import org.apache.airavata.schemas.gfac.DoubleArrayType;
+import org.apache.airavata.schemas.gfac.DoubleParameterType;
+import org.apache.airavata.schemas.gfac.FileArrayType;
+import org.apache.airavata.schemas.gfac.FileParameterType;
+import org.apache.airavata.schemas.gfac.FloatArrayType;
+import org.apache.airavata.schemas.gfac.FloatParameterType;
+import org.apache.airavata.schemas.gfac.IntegerArrayType;
+import org.apache.airavata.schemas.gfac.IntegerParameterType;
+import org.apache.airavata.schemas.gfac.Parameter;
+import org.apache.airavata.schemas.gfac.StdErrParameterType;
+import org.apache.airavata.schemas.gfac.StdOutParameterType;
+import org.apache.airavata.schemas.gfac.StringArrayType;
+import org.apache.airavata.schemas.gfac.StringParameterType;
+import org.apache.airavata.schemas.gfac.URIArrayType;
+import org.apache.airavata.schemas.gfac.URIParameterType;
import org.apache.axiom.om.OMElement;
-import org.apache.zookeeper.*;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.ZKUtil;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,11 +93,25 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+//import org.apache.airavata.commons.gfac.type.ActualParameter;
public class GFacUtils {
private final static Logger log = LoggerFactory.getLogger(GFacUtils.class);
@@ -187,410 +232,410 @@ public class GFacUtils {
return buf.toString();
}
- public static ActualParameter getInputActualParameter(Parameter parameter,
- DataObjectType element) {
- ActualParameter actualParameter = new ActualParameter();
- if ("String".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StringParameterType.type);
- if (!"".equals(element.getValue())) {
- ((StringParameterType) actualParameter.getType())
- .setValue(element.getValue());
- } else {
- ((StringParameterType) actualParameter.getType()).setValue("");
- }
- } else if ("Double".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(DoubleParameterType.type);
- if (!"".equals(element.getValue())) {
- ((DoubleParameterType) actualParameter.getType())
- .setValue(new Double(element.getValue()));
- }
- } else if ("Integer".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(IntegerParameterType.type);
- if (!"".equals(element.getValue())) {
- ((IntegerParameterType) actualParameter.getType())
- .setValue(new Integer(element.getValue()));
- }
- } else if ("Float".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FloatParameterType.type);
- if (!"".equals(element.getValue())) {
- ((FloatParameterType) actualParameter.getType())
- .setValue(new Float(element.getValue()));
- }
- } else if ("Boolean".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(BooleanParameterType.type);
- if (!"".equals(element.getValue())) {
- ((BooleanParameterType) actualParameter.getType())
- .setValue(new Boolean(element.getValue()));
- }
- } else if ("File".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FileParameterType.type);
- if (!"".equals(element.getValue())) {
- ((FileParameterType) actualParameter.getType())
- .setValue(element.getValue());
- }
- } else if ("URI".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(URIParameterType.type);
- if (!"".equals(element.getValue())) {
- ((URIParameterType) actualParameter.getType()).setValue(element
- .getValue());
- } else {
- ((URIParameterType) actualParameter.getType()).setValue("");
- }
-
- } else if ("StdOut".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StdOutParameterType.type);
- if (!"".equals(element.getValue())) {
- ((StdOutParameterType) actualParameter.getType())
- .setValue(element.getValue());
- } else {
- ((StdOutParameterType) actualParameter.getType()).setValue("");
- }
-
- } else if ("StdErr".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StdErrParameterType.type);
- if (!"".equals(element.getValue())) {
- ((StdErrParameterType) actualParameter.getType())
- .setValue(element.getValue());
- } else {
- ((StdErrParameterType) actualParameter.getType()).setValue("");
- }
-
- }
- return actualParameter;
- }
-
- public static ActualParameter getInputActualParameter(Parameter parameter,
- OMElement element) {
- OMElement innerelement = null;
- ActualParameter actualParameter = new ActualParameter();
- if ("String".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StringParameterType.type);
- if (!"".equals(element.getText())) {
- ((StringParameterType) actualParameter.getType())
- .setValue(element.getText());
- } else if (element.getChildrenWithLocalName("value").hasNext()) {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((StringParameterType) actualParameter.getType())
- .setValue(innerelement.getText());
- } else {
- ((StringParameterType) actualParameter.getType()).setValue("");
- }
- } else if ("Double".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(DoubleParameterType.type);
- if (!"".equals(element.getText())) {
- ((DoubleParameterType) actualParameter.getType())
- .setValue(new Double(innerelement.getText()));
- } else {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((DoubleParameterType) actualParameter.getType())
- .setValue(new Double(innerelement.getText()));
- }
- } else if ("Integer".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(IntegerParameterType.type);
- if (!"".equals(element.getText())) {
- ((IntegerParameterType) actualParameter.getType())
- .setValue(new Integer(element.getText()));
- } else {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((IntegerParameterType) actualParameter.getType())
- .setValue(new Integer(innerelement.getText()));
- }
- } else if ("Float".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FloatParameterType.type);
- if (!"".equals(element.getText())) {
- ((FloatParameterType) actualParameter.getType())
- .setValue(new Float(element.getText()));
- } else {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((FloatParameterType) actualParameter.getType())
- .setValue(new Float(innerelement.getText()));
- }
- } else if ("Boolean".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(BooleanParameterType.type);
- if (!"".equals(element.getText())) {
- ((BooleanParameterType) actualParameter.getType())
- .setValue(new Boolean(element.getText()));
- } else {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((BooleanParameterType) actualParameter.getType())
- .setValue(Boolean.parseBoolean(innerelement.getText()));
- }
- } else if ("File".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FileParameterType.type);
- if (!"".equals(element.getText())) {
- ((FileParameterType) actualParameter.getType())
- .setValue(element.getText());
- } else {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- ((FileParameterType) actualParameter.getType())
- .setValue(innerelement.getText());
- }
- } else if ("URI".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(URIParameterType.type);
- if (!"".equals(element.getText())) {
- ((URIParameterType) actualParameter.getType()).setValue(element
- .getText());
- } else if (element.getChildrenWithLocalName("value").hasNext()) {
- innerelement = (OMElement) element.getChildrenWithLocalName(
- "value").next();
- System.out.println(actualParameter.getType().toString());
- log.debug(actualParameter.getType().toString());
- ((URIParameterType) actualParameter.getType())
- .setValue(innerelement.getText());
- } else {
- ((URIParameterType) actualParameter.getType()).setValue("");
- }
- } else if ("StringArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StringArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((StringArrayType) actualParameter.getType()).insertValue(
- i++, arrayValue);
- }
- } else {
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((StringArrayType) actualParameter.getType()).insertValue(
- i++, innerelement.getText());
- }
- }
- } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(DoubleArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((DoubleArrayType) actualParameter.getType()).insertValue(
- i++, new Double(arrayValue));
- }
- } else {
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((DoubleArrayType) actualParameter.getType()).insertValue(
- i++, new Double(innerelement.getText()));
- }
- }
-
- } else if ("IntegerArray"
- .equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(IntegerArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((IntegerArrayType) actualParameter.getType()).insertValue(
- i++, new Integer(arrayValue));
- }
- } else {
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((IntegerArrayType) actualParameter.getType()).insertValue(
- i++, new Integer(innerelement.getText()));
- }
- }
- } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FloatArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((FloatArrayType) actualParameter.getType()).insertValue(
- i++, new Float(arrayValue));
- }
- } else {
-
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((FloatArrayType) actualParameter.getType()).insertValue(
- i++, new Float(innerelement.getText()));
- }
- }
- } else if ("BooleanArray"
- .equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(BooleanArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((BooleanArrayType) actualParameter.getType()).insertValue(
- i++, new Boolean(arrayValue));
- }
- } else {
-
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((BooleanArrayType) actualParameter.getType()).insertValue(
- i++, new Boolean(innerelement.getText()));
- }
- }
- } else if ("FileArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FileArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((FileArrayType) actualParameter.getType()).insertValue(
- i++, arrayValue);
- }
- } else {
-
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((FileArrayType) actualParameter.getType()).insertValue(
- i++, innerelement.getText());
- }
- }
- } else if ("URIArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(URIArrayType.type);
- Iterator value = element.getChildrenWithLocalName("value");
- int i = 0;
- if (!"".equals(element.getText())) {
- String[] list = StringUtil.getElementsFromString(element
- .getText());
- for (String arrayValue : list) {
- ((URIArrayType) actualParameter.getType()).insertValue(i++,
- arrayValue);
- }
- } else {
+// public static ActualParameter getInputActualParameter(Parameter parameter,
+// DataObjectType element) {
+// ActualParameter actualParameter = new ActualParameter();
+// if ("String".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StringParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((StringParameterType) actualParameter.getType())
+// .setValue(element.getValue());
+// } else {
+// ((StringParameterType) actualParameter.getType()).setValue("");
+// }
+// } else if ("Double".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(DoubleParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((DoubleParameterType) actualParameter.getType())
+// .setValue(new Double(element.getValue()));
+// }
+// } else if ("Integer".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(IntegerParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((IntegerParameterType) actualParameter.getType())
+// .setValue(new Integer(element.getValue()));
+// }
+// } else if ("Float".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FloatParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((FloatParameterType) actualParameter.getType())
+// .setValue(new Float(element.getValue()));
+// }
+// } else if ("Boolean".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(BooleanParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((BooleanParameterType) actualParameter.getType())
+// .setValue(new Boolean(element.getValue()));
+// }
+// } else if ("File".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FileParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((FileParameterType) actualParameter.getType())
+// .setValue(element.getValue());
+// }
+// } else if ("URI".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(URIParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((URIParameterType) actualParameter.getType()).setValue(element
+// .getValue());
+// } else {
+// ((URIParameterType) actualParameter.getType()).setValue("");
+// }
+//
+// } else if ("StdOut".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StdOutParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((StdOutParameterType) actualParameter.getType())
+// .setValue(element.getValue());
+// } else {
+// ((StdOutParameterType) actualParameter.getType()).setValue("");
+// }
+//
+// } else if ("StdErr".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StdErrParameterType.type);
+// if (!"".equals(element.getValue())) {
+// ((StdErrParameterType) actualParameter.getType())
+// .setValue(element.getValue());
+// } else {
+// ((StdErrParameterType) actualParameter.getType()).setValue("");
+// }
+//
+// }
+// return actualParameter;
+// }
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((URIArrayType) actualParameter.getType()).insertValue(i++,
- innerelement.getText());
- }
- }
- }
- return actualParameter;
- }
+// public static ActualParameter getInputActualParameter(Parameter parameter,
+// OMElement element) {
+// OMElement innerelement = null;
+// ActualParameter actualParameter = new ActualParameter();
+// if ("String".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StringParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((StringParameterType) actualParameter.getType())
+// .setValue(element.getText());
+// } else if (element.getChildrenWithLocalName("value").hasNext()) {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((StringParameterType) actualParameter.getType())
+// .setValue(innerelement.getText());
+// } else {
+// ((StringParameterType) actualParameter.getType()).setValue("");
+// }
+// } else if ("Double".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(DoubleParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((DoubleParameterType) actualParameter.getType())
+// .setValue(new Double(innerelement.getText()));
+// } else {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((DoubleParameterType) actualParameter.getType())
+// .setValue(new Double(innerelement.getText()));
+// }
+// } else if ("Integer".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(IntegerParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((IntegerParameterType) actualParameter.getType())
+// .setValue(new Integer(element.getText()));
+// } else {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((IntegerParameterType) actualParameter.getType())
+// .setValue(new Integer(innerelement.getText()));
+// }
+// } else if ("Float".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FloatParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((FloatParameterType) actualParameter.getType())
+// .setValue(new Float(element.getText()));
+// } else {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((FloatParameterType) actualParameter.getType())
+// .setValue(new Float(innerelement.getText()));
+// }
+// } else if ("Boolean".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(BooleanParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((BooleanParameterType) actualParameter.getType())
+// .setValue(new Boolean(element.getText()));
+// } else {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((BooleanParameterType) actualParameter.getType())
+// .setValue(Boolean.parseBoolean(innerelement.getText()));
+// }
+// } else if ("File".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FileParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((FileParameterType) actualParameter.getType())
+// .setValue(element.getText());
+// } else {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// ((FileParameterType) actualParameter.getType())
+// .setValue(innerelement.getText());
+// }
+// } else if ("URI".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(URIParameterType.type);
+// if (!"".equals(element.getText())) {
+// ((URIParameterType) actualParameter.getType()).setValue(element
+// .getText());
+// } else if (element.getChildrenWithLocalName("value").hasNext()) {
+// innerelement = (OMElement) element.getChildrenWithLocalName(
+// "value").next();
+// System.out.println(actualParameter.getType().toString());
+// log.debug(actualParameter.getType().toString());
+// ((URIParameterType) actualParameter.getType())
+// .setValue(innerelement.getText());
+// } else {
+// ((URIParameterType) actualParameter.getType()).setValue("");
+// }
+// } else if ("StringArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StringArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((StringArrayType) actualParameter.getType()).insertValue(
+// i++, arrayValue);
+// }
+// } else {
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((StringArrayType) actualParameter.getType()).insertValue(
+// i++, innerelement.getText());
+// }
+// }
+// } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(DoubleArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((DoubleArrayType) actualParameter.getType()).insertValue(
+// i++, new Double(arrayValue));
+// }
+// } else {
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((DoubleArrayType) actualParameter.getType()).insertValue(
+// i++, new Double(innerelement.getText()));
+// }
+// }
+//
+// } else if ("IntegerArray"
+// .equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(IntegerArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((IntegerArrayType) actualParameter.getType()).insertValue(
+// i++, new Integer(arrayValue));
+// }
+// } else {
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((IntegerArrayType) actualParameter.getType()).insertValue(
+// i++, new Integer(innerelement.getText()));
+// }
+// }
+// } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FloatArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((FloatArrayType) actualParameter.getType()).insertValue(
+// i++, new Float(arrayValue));
+// }
+// } else {
+//
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((FloatArrayType) actualParameter.getType()).insertValue(
+// i++, new Float(innerelement.getText()));
+// }
+// }
+// } else if ("BooleanArray"
+// .equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(BooleanArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((BooleanArrayType) actualParameter.getType()).insertValue(
+// i++, new Boolean(arrayValue));
+// }
+// } else {
+//
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((BooleanArrayType) actualParameter.getType()).insertValue(
+// i++, new Boolean(innerelement.getText()));
+// }
+// }
+// } else if ("FileArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FileArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((FileArrayType) actualParameter.getType()).insertValue(
+// i++, arrayValue);
+// }
+// } else {
+//
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((FileArrayType) actualParameter.getType()).insertValue(
+// i++, innerelement.getText());
+// }
+// }
+// } else if ("URIArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(URIArrayType.type);
+// Iterator value = element.getChildrenWithLocalName("value");
+// int i = 0;
+// if (!"".equals(element.getText())) {
+// String[] list = StringUtil.getElementsFromString(element
+// .getText());
+// for (String arrayValue : list) {
+// ((URIArrayType) actualParameter.getType()).insertValue(i++,
+// arrayValue);
+// }
+// } else {
+//
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((URIArrayType) actualParameter.getType()).insertValue(i++,
+// innerelement.getText());
+// }
+// }
+// }
+// return actualParameter;
+// }
- public static ActualParameter getInputActualParameter(Parameter parameter,
- String inputVal) throws GFacException {
- OMElement innerelement = null;
- ActualParameter actualParameter = new ActualParameter();
- if ("String".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StringParameterType.type);
- ((StringParameterType) actualParameter.getType())
- .setValue(inputVal);
- } else if ("Double".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(DoubleParameterType.type);
- ((DoubleParameterType) actualParameter.getType())
- .setValue(new Double(inputVal));
- } else if ("Integer".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(IntegerParameterType.type);
- ((IntegerParameterType) actualParameter.getType())
- .setValue(new Integer(inputVal));
- } else if ("Float".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FloatParameterType.type);
- ((FloatParameterType) actualParameter.getType())
- .setValue(new Float(inputVal));
- } else if ("Boolean".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(BooleanParameterType.type);
- ((BooleanParameterType) actualParameter.getType())
- .setValue(new Boolean(inputVal));
- } else if ("File".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FileParameterType.type);
- ((FileParameterType) actualParameter.getType()).setValue(inputVal);
- } else if ("URI".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(URIParameterType.type);
- ((URIParameterType) actualParameter.getType()).setValue(inputVal);
- } else if ("StringArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(StringArrayType.type);
- Iterator iterator = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (iterator.hasNext()) {
- innerelement = (OMElement) iterator.next();
- ((StringArrayType) actualParameter.getType()).insertValue(i++,
- innerelement.getText());
- }
- } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(DoubleArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((DoubleArrayType) actualParameter.getType()).insertValue(i++,
- new Double(innerelement.getText()));
- }
- } else if ("IntegerArray"
- .equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(IntegerArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((IntegerArrayType) actualParameter.getType()).insertValue(i++,
- new Integer(innerelement.getText()));
- }
- } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FloatArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((FloatArrayType) actualParameter.getType()).insertValue(i++,
- new Float(innerelement.getText()));
- }
- } else if ("BooleanArray"
- .equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(BooleanArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((BooleanArrayType) actualParameter.getType()).insertValue(i++,
- new Boolean(innerelement.getText()));
- }
- } else if ("FileArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(FileArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((FileArrayType) actualParameter.getType()).insertValue(i++,
- innerelement.getText());
- }
- } else if ("URIArray".equals(parameter.getParameterType().getName())) {
- actualParameter = new ActualParameter(URIArrayType.type);
- Iterator value = Arrays.asList(
- StringUtil.getElementsFromString(inputVal)).iterator();
- int i = 0;
- while (value.hasNext()) {
- innerelement = (OMElement) value.next();
- ((URIArrayType) actualParameter.getType()).insertValue(i++,
- innerelement.getText());
- }
- } else {
- throw new GFacException(
- "Input parameters are not configured properly ");
- }
- return actualParameter;
- }
+// public static ActualParameter getInputActualParameter(Parameter parameter,
+// String inputVal) throws GFacException {
+// OMElement innerelement = null;
+// ActualParameter actualParameter = new ActualParameter();
+// if ("String".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StringParameterType.type);
+// ((StringParameterType) actualParameter.getType())
+// .setValue(inputVal);
+// } else if ("Double".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(DoubleParameterType.type);
+// ((DoubleParameterType) actualParameter.getType())
+// .setValue(new Double(inputVal));
+// } else if ("Integer".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(IntegerParameterType.type);
+// ((IntegerParameterType) actualParameter.getType())
+// .setValue(new Integer(inputVal));
+// } else if ("Float".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FloatParameterType.type);
+// ((FloatParameterType) actualParameter.getType())
+// .setValue(new Float(inputVal));
+// } else if ("Boolean".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(BooleanParameterType.type);
+// ((BooleanParameterType) actualParameter.getType())
+// .setValue(new Boolean(inputVal));
+// } else if ("File".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FileParameterType.type);
+// ((FileParameterType) actualParameter.getType()).setValue(inputVal);
+// } else if ("URI".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(URIParameterType.type);
+// ((URIParameterType) actualParameter.getType()).setValue(inputVal);
+// } else if ("StringArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(StringArrayType.type);
+// Iterator iterator = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (iterator.hasNext()) {
+// innerelement = (OMElement) iterator.next();
+// ((StringArrayType) actualParameter.getType()).insertValue(i++,
+// innerelement.getText());
+// }
+// } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(DoubleArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((DoubleArrayType) actualParameter.getType()).insertValue(i++,
+// new Double(innerelement.getText()));
+// }
+// } else if ("IntegerArray"
+// .equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(IntegerArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((IntegerArrayType) actualParameter.getType()).insertValue(i++,
+// new Integer(innerelement.getText()));
+// }
+// } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FloatArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((FloatArrayType) actualParameter.getType()).insertValue(i++,
+// new Float(innerelement.getText()));
+// }
+// } else if ("BooleanArray"
+// .equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(BooleanArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((BooleanArrayType) actualParameter.getType()).insertValue(i++,
+// new Boolean(innerelement.getText()));
+// }
+// } else if ("FileArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(FileArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((FileArrayType) actualParameter.getType()).insertValue(i++,
+// innerelement.getText());
+// }
+// } else if ("URIArray".equals(parameter.getParameterType().getName())) {
+// actualParameter = new ActualParameter(URIArrayType.type);
+// Iterator value = Arrays.asList(
+// StringUtil.getElementsFromString(inputVal)).iterator();
+// int i = 0;
+// while (value.hasNext()) {
+// innerelement = (OMElement) value.next();
+// ((URIArrayType) actualParameter.getType()).insertValue(i++,
+// innerelement.getText());
+// }
+// } else {
+// throw new GFacException(
+// "Input parameters are not configured properly ");
+// }
+// return actualParameter;
+// }
// public static ApplicationJob createApplicationJob(
// JobExecutionContext jobExecutionContext) {
@@ -811,89 +856,89 @@ public class GFacUtils {
}
}
- public static Map<String, Object> getInMessageContext(
- List<DataObjectType> experimentData, Parameter[] parameters)
- throws GFacException {
- HashMap<String, Object> stringObjectHashMap = new HashMap<String, Object>();
- Map<String, DataObjectType> map = new HashMap<String, DataObjectType>();
- for (DataObjectType objectType : experimentData) {
- map.put(objectType.getKey(), objectType);
- }
- for (int i = 0; i < parameters.length; i++) {
- DataObjectType input = map.get(parameters[i].getParameterName());
- if (input != null) {
- DataType t = DataType.STRING;
- String type = parameters[i].getParameterType().getType().toString().toUpperCase();
- if (type.equals("STRING")){
- t=DataType.STRING;
- }else if (type.equals("INTEGER")){
- t=DataType.INTEGER;
- }else if (type.equals("FLOAT")){
- //FIXME
- t=DataType.INTEGER;
- }else if (type.equals("URI")){
- t=DataType.URI;
- }
- input.setType(t);
- stringObjectHashMap
- .put(parameters[i].getParameterName(), GFacUtils
- .getInputActualParameter(parameters[i], input));
- } else {
- throw new GFacException(
- "Error finding the parameter: parameter Name"
- + parameters[i].getParameterName());
- }
- }
- return stringObjectHashMap;
- }
+// public static Map<String, Object> getInMessageContext(
+// List<DataObjectType> experimentData, Parameter[] parameters)
+// throws GFacException {
+// HashMap<String, Object> stringObjectHashMap = new HashMap<String, Object>();
+// Map<String, DataObjectType> map = new HashMap<String, DataObjectType>();
+// for (DataObjectType objectType : experimentData) {
+// map.put(objectType.getKey(), objectType);
+// }
+// for (int i = 0; i < parameters.length; i++) {
+// DataObjectType input = map.get(parameters[i].getParameterName());
+// if (input != null) {
+// DataType t = DataType.STRING;
+// String type = parameters[i].getParameterType().getType().toString().toUpperCase();
+// if (type.equals("STRING")){
+// t=DataType.STRING;
+// }else if (type.equals("INTEGER")){
+// t=DataType.INTEGER;
+// }else if (type.equals("FLOAT")){
+// //FIXME
+// t=DataType.INTEGER;
+// }else if (type.equals("URI")){
+// t=DataType.URI;
+// }
+// input.setType(t);
+// stringObjectHashMap
+// .put(parameters[i].getParameterName(), GFacUtils
+// .getInputActualParameter(parameters[i], input));
+// } else {
+// throw new GFacException(
+// "Error finding the parameter: parameter Name"
+// + parameters[i].getParameterName());
+// }
+// }
+// return stringObjectHashMap;
+// }
- public static Map<String, Object> getInMessageContext(List<DataObjectType> experimentData) throws GFacException {
+ public static Map<String, Object> getInputParamMap(List<InputDataObjectType> experimentData) throws GFacException {
Map<String, Object> map = new HashMap<String, Object>();
- for (DataObjectType objectType : experimentData) {
- map.put(objectType.getKey(), objectType);
+ for (InputDataObjectType objectType : experimentData) {
+ map.put(objectType.getName(), objectType);
}
return map;
}
+//
+// public static Map<String, Object> getOutMessageContext(
+// List<DataObjectType> experimentData, Parameter[] parameters)
+// throws GFacException {
+// HashMap<String, Object> stringObjectHashMap = new HashMap<String, Object>();
+// Map<String, DataObjectType> map = new HashMap<String, DataObjectType>();
+// for (DataObjectType objectType : experimentData) {
+// map.put(objectType.getKey(), objectType);
+// }
+// for (int i = 0; i < parameters.length; i++) {
+// DataObjectType output = map.get(parameters[i].getParameterName());
+// if (output==null){
+// output=new DataObjectType();
+// output.setKey(parameters[i].getParameterName());
+// output.setValue("");
+// String type = parameters[i].getParameterType().getType().toString().toUpperCase();
+// DataType t = DataType.STRING;
+// if (type.equals("STRING")){
+// t=DataType.STRING;
+// }else if (type.equals("INTEGER")){
+// t=DataType.INTEGER;
+// }else if (type.equals("FLOAT")){
+// //FIXME
+// t=DataType.INTEGER;
+// }else if (type.equals("URI")){
+// t=DataType.URI;
+// }
+// output.setType(t);
+// }
+// stringObjectHashMap
+// .put(parameters[i].getParameterName(), GFacUtils
+// .getInputActualParameter(parameters[i], output));
+// }
+// return stringObjectHashMap;
+// }
- public static Map<String, Object> getOutMessageContext(
- List<DataObjectType> experimentData, Parameter[] parameters)
- throws GFacException {
- HashMap<String, Object> stringObjectHashMap = new HashMap<String, Object>();
- Map<String, DataObjectType> map = new HashMap<String, DataObjectType>();
- for (DataObjectType objectType : experimentData) {
- map.put(objectType.getKey(), objectType);
- }
- for (int i = 0; i < parameters.length; i++) {
- DataObjectType output = map.get(parameters[i].getParameterName());
- if (output==null){
- output=new DataObjectType();
- output.setKey(parameters[i].getParameterName());
- output.setValue("");
- String type = parameters[i].getParameterType().getType().toString().toUpperCase();
- DataType t = DataType.STRING;
- if (type.equals("STRING")){
- t=DataType.STRING;
- }else if (type.equals("INTEGER")){
- t=DataType.INTEGER;
- }else if (type.equals("FLOAT")){
- //FIXME
- t=DataType.INTEGER;
- }else if (type.equals("URI")){
- t=DataType.URI;
- }
- output.setType(t);
- }
- stringObjectHashMap
- .put(parameters[i].getParameterName(), GFacUtils
- .getInputActualParameter(parameters[i], output));
- }
- return stringObjectHashMap;
- }
-
- public static Map<String, Object> getOutMessageContext(List<DataObjectType> experimentData) throws GFacException {
+ public static Map<String, Object> getOuputParamMap(List<OutputDataObjectType> experimentData) throws GFacException {
Map<String, Object> map = new HashMap<String, Object>();
- for (DataObjectType objectType : experimentData) {
- map.put(objectType.getKey(), objectType);
+ for (OutputDataObjectType objectType : experimentData) {
+ map.put(objectType.getName(), objectType);
}
return map;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutputUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutputUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutputUtils.java
index 4008721..574fab8 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutputUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutputUtils.java
@@ -20,68 +20,64 @@
*/
package org.apache.airavata.gfac.core.utils;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.gfac.core.handler.GFacHandlerException;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.MappingFactory;
-import org.apache.airavata.gfac.core.handler.GFacHandlerException;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
-import org.apache.airavata.model.workspace.experiment.DataType;
-import org.apache.airavata.schemas.gfac.StdErrParameterType;
-import org.apache.airavata.schemas.gfac.StdOutParameterType;
-
public class OutputUtils {
private static String regexPattern = "\\s*=\\s*(.*)\\r?\\n";
- public static void fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr, List<DataObjectType> outputArray) throws Exception {
+ public static void fillOutputFromStdout(Map<String, Object> output, String stdout, String stderr, List<OutputDataObjectType> outputArray) throws Exception {
if (stdout == null || stdout.equals("")) {
throw new GFacHandlerException("Standard output is empty.");
}
Set<String> keys = output.keySet();
+ OutputDataObjectType actual = null;
+ OutputDataObjectType resultOutput = null;
for (String paramName : keys) {
- ActualParameter actual = (ActualParameter) output.get(paramName);
+ actual = (OutputDataObjectType) output.get(paramName);
// if parameter value is not already set, we let it go
if (actual == null) {
continue;
}
- if ("StdOut".equals(actual.getType().getType().toString())) {
- ((StdOutParameterType) actual.getType()).setValue(stdout);
- DataObjectType out = new DataObjectType();
- out.setKey(paramName);
- out.setType(DataType.STDOUT);
- out.setValue(stdout);
- outputArray.add(out);
- } else if ("StdErr".equals(actual.getType().getType().toString())) {
- ((StdErrParameterType) actual.getType()).setValue(stderr);
- DataObjectType out = new DataObjectType();
- out.setKey(paramName);
- out.setType(DataType.STDERR);
- out.setValue(stderr);
- outputArray.add(out);
- }
+ resultOutput = new OutputDataObjectType();
+ if (DataType.STDOUT == actual.getType()) {
+ actual.setValue(stdout);
+ resultOutput.setName(paramName);
+ resultOutput.setType(DataType.STDOUT);
+ resultOutput.setValue(stdout);
+ outputArray.add(resultOutput);
+ } else if (DataType.STDERR == actual.getType()) {
+ actual.setValue(stderr);
+ resultOutput.setName(paramName);
+ resultOutput.setType(DataType.STDERR);
+ resultOutput.setValue(stderr);
+ outputArray.add(resultOutput);
+ }
// else if ("URI".equals(actual.getType().getType().toString())) {
// continue;
// }
- else {
- String parseStdout = parseStdout(stdout, paramName);
- if (parseStdout != null) {
- DataObjectType out = new DataObjectType();
- out.setKey(paramName);
- out.setType(DataType.STRING);
- out.setValue(parseStdout);
- outputArray.add(out);
- MappingFactory.fromString(actual, parseStdout);
- }
- }
- }
+ else {
+ String parseStdout = parseStdout(stdout, paramName);
+ if (parseStdout != null) {
+ actual.setValue(parseStdout);
+ resultOutput.setName(paramName);
+ resultOutput.setType(DataType.STRING);
+ resultOutput.setValue(parseStdout);
+ outputArray.add(resultOutput);
+ }
+ }
+ }
}
private static String parseStdout(String stdout, String outParam) throws Exception {
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java b/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
index 7e226ea..850608f 100644
--- a/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
+++ b/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
@@ -47,6 +47,7 @@ import org.apache.airavata.gfac.core.utils.OutputUtils;
import org.apache.airavata.gfac.gram.security.GSISecurityContext;
import org.apache.airavata.gfac.gram.external.GridFtp;
import org.apache.airavata.gfac.gram.util.GramProviderUtils;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
@@ -157,7 +158,7 @@ public class GridFTPOutputHandler extends AbstractHandler {
log.error("Cannot download stdout/err files. One reason could be the job is not successfully finished: "+e.getMessage());
}
- List<DataObjectType> outputArray = new ArrayList<DataObjectType>();
+ List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
Set<String> keys = output.keySet();
for (String paramName : keys) {
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHInputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHInputHandler.java b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHInputHandler.java
index d9e669d..39f8df1 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHInputHandler.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHInputHandler.java
@@ -30,10 +30,10 @@ import org.apache.airavata.gfac.core.utils.GFacUtils;
import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
import org.apache.airavata.gfac.gsissh.util.GFACGSISSHUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
-import org.apache.airavata.model.workspace.experiment.DataType;
import org.apache.airavata.model.workspace.experiment.ErrorCategory;
import org.apache.airavata.model.workspace.experiment.TransferState;
import org.apache.airavata.model.workspace.experiment.TransferStatus;
@@ -113,8 +113,8 @@ public class GSISSHInputHandler extends AbstractRecoverableHandler {
MessageContext input = jobExecutionContext.getInMessageContext();
Set<String> parameters = input.getParameters().keySet();
for (String paramName : parameters) {
- DataObjectType inputParamType = (DataObjectType) input.getParameters().get(paramName);
- String paramValue = inputParamType.getKey();
+ InputDataObjectType inputParamType = (InputDataObjectType) input.getParameters().get(paramName);
+ String paramValue = inputParamType.getName();
//TODO: Review this with type
if (inputParamType.getType() == DataType.URI) {
if (index < oldIndex) {
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
index a714099..a25e66a 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
@@ -20,23 +20,10 @@
*/
package org.apache.airavata.gfac.gsissh.handler;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-import net.schmizz.sshj.connection.ConnectionException;
-import net.schmizz.sshj.transport.TransportException;
-
-import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.MappingFactory;
+//import org.apache.airavata.commons.gfac.type.ActualParameter;
+//import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.core.context.JobExecutionContext;
-import org.apache.airavata.gfac.core.cpi.BetterGfacImpl;
-import org.apache.airavata.gfac.core.handler.AbstractHandler;
import org.apache.airavata.gfac.core.handler.AbstractRecoverableHandler;
import org.apache.airavata.gfac.core.handler.GFacHandlerException;
import org.apache.airavata.gfac.core.provider.GFacProviderException;
@@ -45,24 +32,26 @@ import org.apache.airavata.gfac.core.utils.OutputUtils;
import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
import org.apache.airavata.gfac.gsissh.util.GFACGSISSHUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.MonitorMode;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.SecurityProtocol;
-import org.apache.airavata.model.messaging.event.TaskIdentifier;
-import org.apache.airavata.model.messaging.event.TaskOutputChangeEvent;
-import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
+import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
+import org.apache.airavata.model.workspace.experiment.ErrorCategory;
+import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.TransferState;
+import org.apache.airavata.model.workspace.experiment.TransferStatus;
import org.apache.airavata.registry.cpi.ChildDataType;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.xmlbeans.XmlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
public class GSISSHOutputHandler extends AbstractRecoverableHandler {
private static final Logger log = LoggerFactory.getLogger(GSISSHOutputHandler.class);
@@ -182,12 +171,12 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
registry.add(ChildDataType.DATA_TRANSFER_DETAIL, detail, jobExecutionContext.getTaskData().getTaskID());
//todo this is a mess we have to fix this
- List<DataObjectType> outputArray = new ArrayList<DataObjectType>();
+ List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
Set<String> keys = output.keySet();
for (String paramName : keys) {
- ActualParameter actualParameter = (ActualParameter) output.get(paramName);
- if ("URI".equals(actualParameter.getType().getType().toString())) {
+ OutputDataObjectType outputDataObjectType = (OutputDataObjectType) output.get(paramName);
+ if (DataType.URI == outputDataObjectType.getType()) {
List<String> outputList = null;
int retry=3;
@@ -210,9 +199,9 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
Set<String> strings = output.keySet();
outputArray.clear();
for (String key : strings) {
- ActualParameter actualParameter1 = (ActualParameter) output.get(key);
- if ("URI".equals(actualParameter1.getType().getType().toString())) {
- String downloadFile = MappingFactory.toString(actualParameter1);
+ OutputDataObjectType outputDataObjectType1 = (OutputDataObjectType) output.get(key);
+ if (DataType.URI == outputDataObjectType1.getType()) {
+ String downloadFile = outputDataObjectType1.getValue();
String localFile;
if (index < oldIndex) {
localFile = oldFiles.get(index);
@@ -225,10 +214,10 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
GFacUtils.savePluginData(jobExecutionContext, temp.insert(0, ++index), this.getClass().getName());
}
jobExecutionContext.addOutputFile(localFile);
- MappingFactory.fromString(actualParameter1, localFile);
- DataObjectType dataObjectType = new DataObjectType();
+ outputDataObjectType1.setValue(localFile);
+ OutputDataObjectType dataObjectType = new OutputDataObjectType();
dataObjectType.setValue(localFile);
- dataObjectType.setKey(key);
+ dataObjectType.setName(key);
dataObjectType.setType(DataType.URI);
outputArray.add(dataObjectType);
}
@@ -248,10 +237,10 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
GFacUtils.savePluginData(jobExecutionContext, temp.insert(0, ++index), this.getClass().getName());
}
jobExecutionContext.addOutputFile(outputFile);
- MappingFactory.fromString(actualParameter, outputFile);
- DataObjectType dataObjectType = new DataObjectType();
+ outputDataObjectType.setValue(outputFile);
+ OutputDataObjectType dataObjectType = new OutputDataObjectType();
dataObjectType.setValue(valueList);
- dataObjectType.setKey(paramName);
+ dataObjectType.setName(paramName);
dataObjectType.setType(DataType.URI);
outputArray.add(dataObjectType);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
index 4cdd0c0..e28726d 100644
--- a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
+++ b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
@@ -39,18 +39,16 @@ import org.apache.airavata.gfac.local.utils.InputStreamToFileWriter;
import org.apache.airavata.gfac.local.utils.InputUtils;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
import org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.messaging.event.JobIdentifier;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskOutputChangeEvent;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.JobDetails;
import org.apache.airavata.model.workspace.experiment.JobState;
import org.apache.airavata.model.workspace.experiment.TaskDetails;
import org.apache.airavata.registry.cpi.ChildDataType;
import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.xmlbeans.XmlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -219,7 +217,7 @@ public class LocalProvider extends AbstractProvider {
public void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException {
try {
- List<DataObjectType> outputArray = new ArrayList<DataObjectType>();
+ List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
String stdOutStr = GFacUtils.readFileToString(jobExecutionContext.getStandardOutput());
String stdErrStr = GFacUtils.readFileToString(jobExecutionContext.getStandardError());
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
index f34b82a..e46dfa5 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
@@ -28,21 +28,18 @@ import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.handler.AbstractHandler;
import org.apache.airavata.gfac.core.handler.GFacHandlerException;
import org.apache.airavata.gfac.core.utils.GFacUtils;
-import org.apache.airavata.gfac.ssh.context.SSHAuthWrapper;
import org.apache.airavata.gfac.ssh.security.SSHSecurityContext;
import org.apache.airavata.gfac.ssh.util.GFACSSHUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
-import org.apache.airavata.model.workspace.experiment.DataType;
import org.apache.airavata.model.workspace.experiment.ErrorCategory;
import org.apache.airavata.registry.cpi.ChildDataType;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -147,7 +144,7 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
}
pbsCluster.scpTo(outputPath, standardError);
pbsCluster.scpTo(outputPath, standardOutput);
- List<DataObjectType> outputArray = new ArrayList<DataObjectType>();
+ List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
Set<String> keys = output.keySet();
for (String paramName : keys) {
@@ -160,9 +157,9 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
}
pbsCluster.scpTo(outputPath, downloadFile);
String fileName = downloadFile.substring(downloadFile.lastIndexOf(File.separatorChar)+1, downloadFile.length());
- DataObjectType dataObjectType = new DataObjectType();
+ OutputDataObjectType dataObjectType = new OutputDataObjectType();
dataObjectType.setValue(outputPath + File.separatorChar + fileName);
- dataObjectType.setKey(paramName);
+ dataObjectType.setName(paramName);
dataObjectType.setType(DataType.URI);
outputArray.add(dataObjectType);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
index d80e92b..94f667e 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
@@ -20,20 +20,6 @@
*/
package org.apache.airavata.gfac.ssh.handler;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-import net.schmizz.sshj.connection.ConnectionException;
-import net.schmizz.sshj.transport.TransportException;
-
-import org.airavata.appcatalog.cpi.AppCatalog;
-import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.handler.AbstractHandler;
@@ -44,21 +30,25 @@ import org.apache.airavata.gfac.core.utils.OutputUtils;
import org.apache.airavata.gfac.ssh.security.SSHSecurityContext;
import org.apache.airavata.gfac.ssh.util.GFACSSHUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.SecurityProtocol;
-import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
+import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
+import org.apache.airavata.model.workspace.experiment.ErrorCategory;
+import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.TransferState;
+import org.apache.airavata.model.workspace.experiment.TransferStatus;
import org.apache.airavata.registry.cpi.ChildDataType;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.xmlbeans.XmlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
public class SSHOutputHandler extends AbstractHandler {
private static final Logger log = LoggerFactory.getLogger(SSHOutputHandler.class);
@@ -141,12 +131,12 @@ public class SSHOutputHandler extends AbstractHandler {
registry.add(ChildDataType.DATA_TRANSFER_DETAIL, detail, jobExecutionContext.getTaskData().getTaskID());
- List<DataObjectType> outputArray = new ArrayList<DataObjectType>();
+ List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
Set<String> keys = output.keySet();
for (String paramName : keys) {
- ActualParameter actualParameter = (ActualParameter) output.get(paramName);
- if ("URI".equals(actualParameter.getType().getType().toString())) {
+ OutputDataObjectType actualParameter = (OutputDataObjectType) output.get(paramName);
+ if (DataType.URI == actualParameter.getType()) {
List<String> outputList = null;
int retry = 3;
while (retry > 0) {
@@ -163,17 +153,17 @@ public class SSHOutputHandler extends AbstractHandler {
Set<String> strings = output.keySet();
outputArray.clear();
for (String key : strings) {
- ActualParameter actualParameter1 = (ActualParameter) output.get(key);
- if ("URI".equals(actualParameter1.getType().getType().toString())) {
- String downloadFile = MappingFactory.toString(actualParameter1);
+ OutputDataObjectType actualParameter1 = (OutputDataObjectType) output.get(key);
+ if (DataType.URI == actualParameter1.getType()) {
+ String downloadFile = actualParameter1.getValue();
cluster.scpFrom(downloadFile, outputDataDir);
String fileName = downloadFile.substring(downloadFile.lastIndexOf(File.separatorChar) + 1, downloadFile.length());
String localFile = outputDataDir + File.separator + fileName;
jobExecutionContext.addOutputFile(localFile);
- MappingFactory.fromString(actualParameter1, localFile);
- DataObjectType dataObjectType = new DataObjectType();
+ actualParameter1.setValue(localFile);
+ OutputDataObjectType dataObjectType = new OutputDataObjectType();
dataObjectType.setValue(localFile);
- dataObjectType.setKey(key);
+ dataObjectType.setName(key);
dataObjectType.setType(DataType.URI);
outputArray.add(dataObjectType);
}
@@ -185,10 +175,10 @@ public class SSHOutputHandler extends AbstractHandler {
cluster.scpFrom(jobExecutionContext.getOutputDir() + File.separator + valueList, outputDataDir);
String outputPath = outputDataDir + File.separator + valueList;
jobExecutionContext.addOutputFile(outputPath);
- MappingFactory.fromString(actualParameter, outputPath);
- DataObjectType dataObjectType = new DataObjectType();
+ actualParameter.setValue(outputPath);
+ OutputDataObjectType dataObjectType = new OutputDataObjectType();
dataObjectType.setValue(outputPath);
- dataObjectType.setKey(paramName);
+ dataObjectType.setName(paramName);
dataObjectType.setType(DataType.URI);
outputArray.add(dataObjectType);
}
[2/2] airavata git commit: Gfac - Removed AcutalParameter objects and
replace Input and Output DataObjectTypes
Posted by sh...@apache.org.
Gfac - Removed AcutalParameter objects and replace Input and Output DataObjectTypes
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b52499eb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b52499eb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b52499eb
Branch: refs/heads/gfac_appcatalog_int
Commit: b52499eb72b438718f32d1b6653c40d4de8ced9f
Parents: 088e80f
Author: shamrath <sh...@gmail.com>
Authored: Thu Nov 6 17:39:59 2014 -0500
Committer: shamrath <sh...@gmail.com>
Committed: Thu Nov 6 17:39:59 2014 -0500
----------------------------------------------------------------------
.../client/samples/CreateLaunchExperiment.java | 231 ++--
.../samples/CreateLaunchExperimentUS3.java | 139 +--
.../airavata/gfac/core/cpi/BetterGfacImpl.java | 10 +-
.../handler/AbstractRecoverableHandler.java | 4 +-
.../airavata/gfac/core/utils/GFacUtils.java | 1017 +++++++++---------
.../airavata/gfac/core/utils/OutputUtils.java | 72 +-
.../gfac/gram/handler/GridFTPOutputHandler.java | 3 +-
.../gfac/gsissh/handler/GSISSHInputHandler.java | 8 +-
.../gsissh/handler/GSISSHOutputHandler.java | 71 +-
.../gfac/local/provider/impl/LocalProvider.java | 6 +-
.../ssh/handler/AdvancedSCPOutputHandler.java | 13 +-
.../gfac/ssh/handler/SSHOutputHandler.java | 64 +-
12 files changed, 831 insertions(+), 807 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index daaf4cc..d6c0f80 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -25,6 +25,9 @@ import org.apache.airavata.api.Airavata;
import org.apache.airavata.api.client.AiravataClientFactory;
import org.apache.airavata.client.tools.RegisterSampleApplications;
import org.apache.airavata.client.tools.RegisterSampleApplicationsUtils;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
@@ -152,16 +155,16 @@ public class CreateLaunchExperiment {
public static String createEchoExperimentForTrestles(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Input_to_Echo");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Input_to_Echo");
input.setType(DataType.STRING);
input.setValue("Echoed_Output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("echo_output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("echo_output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -204,16 +207,16 @@ public class CreateLaunchExperiment {
public static String createEchoExperimentForFSD(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Input_to_Echo");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Input_to_Echo");
input.setType(DataType.STRING);
input.setValue("Echoed_Output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("echo_output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("echo_output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -261,19 +264,19 @@ public class CreateLaunchExperiment {
public static String createExperimentWRFStampede(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Config_Namelist_File");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Config_Namelist_File");
input.setType(DataType.URI);
input.setValue("/Users/lahirugunathilake/Downloads/wrf_sample_inputs/namelist.input");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("WRF_Initial_Conditions");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("WRF_Initial_Conditions");
input1.setType(DataType.URI);
input1.setValue("/Users/lahirugunathilake/Downloads/wrf_sample_inputs/wrfinput_d01");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("WRF_Boundary_File");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("WRF_Boundary_File");
input2.setType(DataType.URI);
input2.setValue("/Users/lahirugunathilake/Downloads/wrf_sample_inputs/wrfbdy_d01");
@@ -282,14 +285,14 @@ public class CreateLaunchExperiment {
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("WRF_Output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("WRF_Output");
output.setType(DataType.URI);
output.setValue("");
- DataObjectType output1 = new DataObjectType();
- output1.setKey("WRF_Execution_Log");
+ OutputDataObjectType output1 = new OutputDataObjectType();
+ output1.setName("WRF_Execution_Log");
output1.setType(DataType.URI);
output1.setValue("");
@@ -335,19 +338,19 @@ public class CreateLaunchExperiment {
public static String createExperimentWRFTrestles(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("WRF_Namelist");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("WRF_Namelist");
input.setType(DataType.URI);
input.setValue("/Users/chathuri/Downloads/wrf_sample_inputs/namelist.input");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("WRF_Input_File");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("WRF_Input_File");
input1.setType(DataType.URI);
input1.setValue("/Users/chathuri/Downloads/wrf_sample_inputs/wrfinput_d01");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("WRF_Boundary_File");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("WRF_Boundary_File");
input2.setType(DataType.URI);
input2.setValue("/Users/chathuri/Downloads/wrf_sample_inputs/wrfbdy_d01");
@@ -356,14 +359,14 @@ public class CreateLaunchExperiment {
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("WRF_Output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("WRF_Output");
output.setType(DataType.URI);
output.setValue("");
- DataObjectType output1 = new DataObjectType();
- output1.setKey("WRF_Execution_Log");
+ OutputDataObjectType output1 = new OutputDataObjectType();
+ output1.setName("WRF_Execution_Log");
output1.setType(DataType.URI);
output1.setValue("");
@@ -431,16 +434,16 @@ public class CreateLaunchExperiment {
public static String createExperimentEchoForLocalHost(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Input_to_Echo");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Input_to_Echo");
input.setType(DataType.STRING);
input.setValue("Echoed_Output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("Echoed_Output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("Echoed_Output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -485,16 +488,16 @@ public class CreateLaunchExperiment {
// public static String createExperimentForSSHHost(Airavata.Client client) throws TException {
// try {
-// List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
-// DataObjectType input = new DataObjectType();
-// input.setKey("echo_input");
+// List<OutputDataObjectType> exInputs = new ArrayList<OutputDataObjectType>();
+// OutputDataObjectType input = new OutputDataObjectType();
+// input.setName("echo_input");
// input.setType(DataType.STRING);
// input.setValue("echo_output=Hello World");
// exInputs.add(input);
//
-// List<DataObjectType> exOut = new ArrayList<DataObjectType>();
-// DataObjectType output = new DataObjectType();
-// output.setKey("echo_output");
+// List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+// OutputDataObjectType output = new OutputDataObjectType();
+// output.setName("echo_output");
// output.setType(DataType.STRING);
// output.setValue("");
// exOut.add(output);
@@ -531,16 +534,16 @@ public class CreateLaunchExperiment {
public static String createEchoExperimentForStampede(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Input_to_Echo");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Input_to_Echo");
input.setType(DataType.STRING);
input.setValue("Echoed_Output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("Echoed_Output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("Echoed_Output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -585,16 +588,16 @@ public class CreateLaunchExperiment {
// public static String createEchoExperimentForLonestar(Airavata.Client client) throws TException {
// try {
-// List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
-// DataObjectType input = new DataObjectType();
-// input.setKey("echo_input");
+// List<OutputDataObjectType> exInputs = new ArrayList<OutputDataObjectType>();
+// OutputDataObjectType input = new OutputDataObjectType();
+// input.setName("echo_input");
// input.setType(DataType.STRING);
// input.setValue("echo_output=Hello World");
// exInputs.add(input);
//
-// List<DataObjectType> exOut = new ArrayList<DataObjectType>();
-// DataObjectType output = new DataObjectType();
-// output.setKey("echo_output");
+// List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+// OutputDataObjectType output = new OutputDataObjectType();
+// output.setName("echo_output");
// output.setType(DataType.STRING);
// output.setValue("");
// exOut.add(output);
@@ -655,16 +658,16 @@ public class CreateLaunchExperiment {
public static String createExperimentForBR2(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Input_to_Echo");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Input_to_Echo");
input.setType(DataType.STRING);
input.setValue("Echoed_Output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("Echoed_Output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("Echoed_Output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -709,44 +712,44 @@ public class CreateLaunchExperiment {
public static String createExperimentForBR2Amber(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Heat_Restart_File");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Heat_Restart_File");
input.setType(DataType.URI);
input.setValue("/Users/lahirugunathilake/Downloads/02_Heat.rst");
exInputs.add(input);
- DataObjectType input1 = new DataObjectType();
- input1.setKey("Production_Control_File");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("Production_Control_File");
input1.setType(DataType.URI);
input1.setValue("/Users/lahirugunathilake/Downloads/03_Prod.in");
exInputs.add(input1);
- DataObjectType input2 = new DataObjectType();
- input2.setKey("Parameter_Topology_File");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("Parameter_Topology_File");
input2.setType(DataType.URI);
input2.setValue("/Users/lahirugunathilake/Downloads/prmtop");
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("AMBER_Execution_Summary");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("AMBER_Execution_Summary");
output.setType(DataType.URI);
output.setValue("");
exOut.add(output);
- DataObjectType output1 = new DataObjectType();
- output1.setKey("AMBER_Execution_log");
+ OutputDataObjectType output1 = new OutputDataObjectType();
+ output1.setName("AMBER_Execution_log");
output1.setType(DataType.URI);
output1.setValue("");
exOut.add(output1);
- DataObjectType output2 = new DataObjectType();
- output2.setKey("AMBER_Trajectory_file");
+ OutputDataObjectType output2 = new OutputDataObjectType();
+ output2.setName("AMBER_Trajectory_file");
output2.setType(DataType.URI);
output2.setValue("");
exOut.add(output2);
- DataObjectType output3 = new DataObjectType();
- output3.setKey("AMBER_Restart_file");
+ OutputDataObjectType output3 = new OutputDataObjectType();
+ output3.setName("AMBER_Restart_file");
output3.setType(DataType.URI);
output3.setValue("");
exOut.add(output3);
@@ -792,44 +795,44 @@ public class CreateLaunchExperiment {
public static String createExperimentForStampedeAmber(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Heat_Restart_File");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Heat_Restart_File");
input.setType(DataType.URI);
input.setValue("/Users/lahirugunathilake/Downloads/02_Heat.rst");
exInputs.add(input);
- DataObjectType input1 = new DataObjectType();
- input1.setKey("Production_Control_File");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("Production_Control_File");
input1.setType(DataType.URI);
input1.setValue("/Users/lahirugunathilake/Downloads/03_Prod.in");
exInputs.add(input1);
- DataObjectType input2 = new DataObjectType();
- input2.setKey("Parameter_Topology_File");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("Parameter_Topology_File");
input2.setType(DataType.URI);
input2.setValue("/Users/lahirugunathilake/Downloads/prmtop");
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("AMBER_Execution_Summary");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("AMBER_Execution_Summary");
output.setType(DataType.URI);
output.setValue("");
exOut.add(output);
- DataObjectType output1 = new DataObjectType();
- output1.setKey("AMBER_Execution_Summary");
+ OutputDataObjectType output1 = new OutputDataObjectType();
+ output1.setName("AMBER_Execution_Summary");
output1.setType(DataType.URI);
output1.setValue("");
exOut.add(output1);
- DataObjectType output2 = new DataObjectType();
- output2.setKey("AMBER_Trajectory_file");
+ OutputDataObjectType output2 = new OutputDataObjectType();
+ output2.setName("AMBER_Trajectory_file");
output2.setType(DataType.URI);
output2.setValue("");
exOut.add(output2);
- DataObjectType output3 = new DataObjectType();
- output3.setKey("AMBER_Restart_file");
+ OutputDataObjectType output3 = new OutputDataObjectType();
+ output3.setName("AMBER_Restart_file");
output3.setType(DataType.URI);
output3.setValue("");
exOut.add(output3);
@@ -874,44 +877,44 @@ public class CreateLaunchExperiment {
public static String createExperimentForTrestlesAmber(Airavata.Client client) throws TException {
try {
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("Heat_Restart_File");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("Heat_Restart_File");
input.setType(DataType.URI);
input.setValue("/Users/lahirugunathilake/Downloads/02_Heat.rst");
exInputs.add(input);
- DataObjectType input1 = new DataObjectType();
- input1.setKey("Production_Control_File");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("Production_Control_File");
input1.setType(DataType.URI);
input1.setValue("/Users/lahirugunathilake/Downloads/03_Prod.in");
exInputs.add(input1);
- DataObjectType input2 = new DataObjectType();
- input2.setKey("Production_Control_File");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("Production_Control_File");
input2.setType(DataType.URI);
input2.setValue("/Users/lahirugunathilake/Downloads/prmtop");
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("AMBER_Execution_Summary");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("AMBER_Execution_Summary");
output.setType(DataType.URI);
output.setValue("");
exOut.add(output);
- DataObjectType output1 = new DataObjectType();
- output1.setKey("AMBER_Execution_log");
+ OutputDataObjectType output1 = new OutputDataObjectType();
+ output1.setName("AMBER_Execution_log");
output1.setType(DataType.URI);
output1.setValue("");
exOut.add(output1);
- DataObjectType output2 = new DataObjectType();
- output2.setKey("AMBER_Trajectory_file");
+ OutputDataObjectType output2 = new OutputDataObjectType();
+ output2.setName("AMBER_Trajectory_file");
output2.setType(DataType.URI);
output2.setValue("");
exOut.add(output2);
- DataObjectType output3 = new DataObjectType();
- output3.setKey("AMBER_Restart_file");
+ OutputDataObjectType output3 = new OutputDataObjectType();
+ output3.setName("AMBER_Restart_file");
output3.setType(DataType.URI);
output3.setValue("");
exOut.add(output3);
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
index bd9d959..b4f8d98 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperimentUS3.java
@@ -21,6 +21,9 @@ package org.apache.airavata.client.samples;
import org.apache.airavata.api.Airavata;
import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.error.AiravataClientException;
import org.apache.airavata.model.error.AiravataSystemException;
import org.apache.airavata.model.error.ExperimentNotFoundException;
@@ -140,16 +143,16 @@ public class CreateLaunchExperimentUS3 {
public static String createExperimentForTrestles(Airavata.Client client) throws TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("echo_input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("echo_input");
input.setType(DataType.STRING);
input.setValue("echo_output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("echo_output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("echo_output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
@@ -186,17 +189,17 @@ public class CreateLaunchExperimentUS3 {
public static String createUS3ExperimentForTrestles (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("input");
input.setType(DataType.URI);
input.setValue("file:///home/airavata/input/hpcinput.tar");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("walltime");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("walltime");
input1.setType(DataType.STRING);
input1.setValue("-walltime=60");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("mgroupcount");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("mgroupcount");
input2.setType(DataType.STRING);
input2.setValue("-mgroupcount=1");
@@ -204,17 +207,17 @@ public class CreateLaunchExperimentUS3 {
exInputs.add(input1);
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("output");
output.setType(DataType.URI);
output.setValue("");
-// DataObjectType output1 = new DataObjectType();
-// output1.setKey("stdout");
+// OutputDataObjectType output1 = new OutputDataObjectType();
+// output1.setName("stdout");
// output1.setType(DataType.STDOUT);
// output1.setValue("");
-// DataObjectType output2 = new DataObjectType();
-// output2.setKey("stderr");
+// OutputDataObjectType output2 = new OutputDataObjectType();
+// output2.setName("stderr");
// output2.setType(DataType.STDERR);
// output2.setValue("");
exOut.add(output);
@@ -257,17 +260,17 @@ public class CreateLaunchExperimentUS3 {
}
public static String createUS3ExperimentForStampede (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("input");
input.setType(DataType.URI);
input.setValue("file:///home/airavata/input/hpcinput.tar");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("walltime");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("walltime");
input1.setType(DataType.STRING);
input1.setValue("-walltime=60");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("mgroupcount");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("mgroupcount");
input2.setType(DataType.STRING);
input2.setValue("-mgroupcount=1");
@@ -276,17 +279,17 @@ public class CreateLaunchExperimentUS3 {
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("output");
output.setType(DataType.URI);
output.setValue("");
-// DataObjectType output1 = new DataObjectType();
-// output1.setKey("stdout");
+// OutputDataObjectType output1 = new OutputDataObjectType();
+// output1.setName("stdout");
// output1.setType(DataType.STDOUT);
// output1.setValue("");
-// DataObjectType output2 = new DataObjectType();
-// output2.setKey("stderr");
+// OutputDataObjectType output2 = new OutputDataObjectType();
+// output2.setName("stderr");
// output2.setType(DataType.STDERR);
// output2.setValue("");
exOut.add(output);
@@ -330,17 +333,17 @@ public class CreateLaunchExperimentUS3 {
}
public static String createUS3ExperimentForLonestar (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("input");
input.setType(DataType.URI);
input.setValue("file:///home/airavata/input/hpcinput.tar");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("walltime");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("walltime");
input1.setType(DataType.STRING);
input1.setValue("-walltime=60");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("mgroupcount");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("mgroupcount");
input2.setType(DataType.STRING);
input2.setValue("-mgroupcount=1");
@@ -348,17 +351,17 @@ public class CreateLaunchExperimentUS3 {
exInputs.add(input1);
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("output");
output.setType(DataType.URI);
output.setValue("");
-// DataObjectType output1 = new DataObjectType();
-// output1.setKey("stdout");
+// OutputDataObjectType output1 = new OutputDataObjectType();
+// output1.setName("stdout");
// output1.setType(DataType.STDOUT);
// output1.setValue("");
-// DataObjectType output2 = new DataObjectType();
-// output2.setKey("stderr");
+// OutputDataObjectType output2 = new OutputDataObjectType();
+// output2.setName("stderr");
// output2.setType(DataType.STDERR);
// output2.setValue("");
exOut.add(output);
@@ -402,17 +405,17 @@ public class CreateLaunchExperimentUS3 {
}
public static String createUS3ExperimentForAlamo (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("input");
input.setType(DataType.URI);
input.setValue("file:///home/airavata/input/hpcinput.tar");
- DataObjectType input1 = new DataObjectType();
- input1.setKey("walltime");
+ InputDataObjectType input1 = new InputDataObjectType();
+ input1.setName("walltime");
input1.setType(DataType.STRING);
input1.setValue("-walltime=60");
- DataObjectType input2 = new DataObjectType();
- input2.setKey("mgroupcount");
+ InputDataObjectType input2 = new InputDataObjectType();
+ input2.setName("mgroupcount");
input2.setType(DataType.STRING);
input2.setValue("-mgroupcount=1");
@@ -421,17 +424,17 @@ public class CreateLaunchExperimentUS3 {
exInputs.add(input2);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("output");
output.setType(DataType.URI);
output.setValue("");
-// DataObjectType output1 = new DataObjectType();
-// output1.setKey("stdout");
+// OutputDataObjectType output1 = new OutputDataObjectType();
+// output1.setName("stdout");
// output1.setType(DataType.STDOUT);
// output1.setValue("");
-// DataObjectType output2 = new DataObjectType();
-// output2.setKey("stderr");
+// OutputDataObjectType output2 = new OutputDataObjectType();
+// output2.setName("stderr");
// output2.setType(DataType.STDERR);
// output2.setValue("");
exOut.add(output);
@@ -475,16 +478,16 @@ public class CreateLaunchExperimentUS3 {
}
public static String createExperimentForStampede(Airavata.Client client) throws TException {
try{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("echo_input");
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("echo_input");
input.setType(DataType.STRING);
input.setValue("echo_output=Hello World");
exInputs.add(input);
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("echo_output");
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("echo_output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index d063dac..cbf32f7 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -51,6 +51,8 @@ import org.apache.airavata.messaging.core.Publisher;
import org.apache.airavata.messaging.core.PublisherFactory;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
import org.apache.airavata.model.appcatalog.computeresource.DataMovementInterface;
import org.apache.airavata.model.appcatalog.computeresource.FileSystems;
@@ -295,11 +297,11 @@ public class BetterGfacImpl implements GFac,Watcher {
applicationContext.setComputeResourcePreference(gatewayResourcePreferences);
jobExecutionContext.setApplicationContext(applicationContext);
- List<DataObjectType> experimentInputs = taskData.getApplicationInputs();
- jobExecutionContext.setInMessageContext(new MessageContext(GFacUtils.getInMessageContext(experimentInputs)));
+ List<InputDataObjectType> experimentInputs = taskData.getApplicationInputs();
+ jobExecutionContext.setInMessageContext(new MessageContext(GFacUtils.getInputParamMap(experimentInputs)));
- List<DataObjectType> outputData = taskData.getApplicationOutputs();
- jobExecutionContext.setOutMessageContext(new MessageContext(GFacUtils.getOutMessageContext(outputData)));
+ List<OutputDataObjectType> outputData = taskData.getApplicationOutputs();
+ jobExecutionContext.setOutMessageContext(new MessageContext(GFacUtils.getOuputParamMap(outputData)));
jobExecutionContext.setProperty(Constants.PROP_TOPIC, experimentID);
jobExecutionContext.setGfac(this);
http://git-wip-us.apache.org/repos/asf/airavata/blob/b52499eb/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractRecoverableHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractRecoverableHandler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractRecoverableHandler.java
index 1ae19f3..566a6ba 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractRecoverableHandler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AbstractRecoverableHandler.java
@@ -25,9 +25,9 @@ import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.cpi.BetterGfacImpl;
import org.apache.airavata.gfac.core.states.GfacPluginState;
import org.apache.airavata.gfac.core.utils.GFacUtils;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskOutputChangeEvent;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.Registry;
import org.apache.airavata.registry.cpi.RegistryException;
@@ -78,7 +78,7 @@ public abstract class AbstractRecoverableHandler implements GFacRecoverableHandl
this.registry = registry;
}
- protected void fireTaskOutputChangeEvent(JobExecutionContext jobExecutionContext, List<DataObjectType> outputArray) {
+ protected void fireTaskOutputChangeEvent(JobExecutionContext jobExecutionContext, List<OutputDataObjectType> outputArray) {
TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID(),