airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding app catalog data model util classes
Date Wed, 02 Jul 2014 20:06:19 GMT
Repository: airavata
Updated Branches:
  refs/heads/master ab566e1b6 -> bd9c12d0d


adding app catalog data model util classes


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/bd9c12d0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/bd9c12d0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/bd9c12d0

Branch: refs/heads/master
Commit: bd9c12d0daff8a6e263ad3488b77117be2f72fb8
Parents: ab566e1
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Jul 2 16:06:13 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Jul 2 16:06:13 2014 -0400

----------------------------------------------------------------------
 .../airavata/model/util/AppDeploymentUtil.java  | 50 ++++++++++++
 .../airavata/model/util/AppInterfaceUtil.java   | 71 +++++++++++++++++
 .../model/util/ComputeResourceUtil.java         | 84 ++++++++++++++++++++
 3 files changed, 205 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/bd9c12d0/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppDeploymentUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppDeploymentUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppDeploymentUtil.java
new file mode 100644
index 0000000..4e1a369
--- /dev/null
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppDeploymentUtil.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.model.util;
+
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths;
+
+public class AppDeploymentUtil {
+    public static ApplicationDeploymentDescription createAppDeployment (String moduleId,
+                                                                        String computeHost,
+                                                                        String executablePath,
+                                                                        String appDepDescription,
+                                                                        String moduleLoadCmd){
+        ApplicationDeploymentDescription description = new ApplicationDeploymentDescription();
+        description.setAppModuleId(moduleId);
+        description.setComputeHostId(computeHost);
+        description.setExecutablePath(executablePath);
+        description.setAppDeploymentDescription(appDepDescription);
+        description.setModuleLoadCmd(moduleLoadCmd);
+        return description;
+    }
+
+    public static SetEnvPaths createEnvPath (String name,
+                                             String val){
+        SetEnvPaths setEnvPaths = new SetEnvPaths();
+        setEnvPaths.setName(name);
+        setEnvPaths.setValue(val);
+        return setEnvPaths;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/bd9c12d0/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppInterfaceUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppInterfaceUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppInterfaceUtil.java
new file mode 100644
index 0000000..2de82b3
--- /dev/null
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/AppInterfaceUtil.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.model.util;
+
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+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 java.util.List;
+
+public class AppInterfaceUtil {
+    public static ApplicationInterfaceDescription createAppInterface (String applicationName,
+                                                                      List<String>
appModules,
+                                                                      List<InputDataObjectType>
appInputs,
+                                                                      List<OutputDataObjectType>
appOutputs){
+        ApplicationInterfaceDescription interfaceDescription = new ApplicationInterfaceDescription();
+        interfaceDescription.setApplicationName(applicationName);
+        interfaceDescription.setApplicationModules(appModules);
+        interfaceDescription.setApplicationInputs(appInputs);
+        interfaceDescription.setApplicationOutputs(appOutputs);
+        return interfaceDescription;
+    }
+
+    public static InputDataObjectType createApplicationInput (String name,
+                                                              String value,
+                                                              DataType type,
+                                                              String applicationArgument,
+                                                              boolean standardInput,
+                                                              String userFriendlyDesc,
+                                                              String metadata){
+        InputDataObjectType appInput = new InputDataObjectType();
+        appInput.setName(name);
+        appInput.setValue(value);
+        appInput.setType(type);
+        appInput.setMetaData(metadata);
+        appInput.setApplicationArguement(applicationArgument);
+        appInput.setUserFriendlyDescription(userFriendlyDesc);
+        appInput.setStandardInput(standardInput);
+        return appInput;
+    }
+
+    public static OutputDataObjectType createApplicationOutput (String name,
+                                                                String value,
+                                                                DataType type){
+        OutputDataObjectType appOutput = new OutputDataObjectType();
+        appOutput.setName(name);
+        appOutput.setValue(value);
+        appOutput.setType(type);
+        return appOutput;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/bd9c12d0/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ComputeResourceUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ComputeResourceUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ComputeResourceUtil.java
new file mode 100644
index 0000000..49d80b0
--- /dev/null
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ComputeResourceUtil.java
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.model.util;
+
+import org.apache.airavata.model.computehost.*;
+
+import java.util.List;
+
+public class ComputeResourceUtil {
+    public static ComputeResourceDescription createComputeResource (String resourceName,
+                                                                    String resourceDesc,
+                                                                    String preferedSubmissionProtocol){
+        ComputeResourceDescription computeResource = new ComputeResourceDescription();
+        computeResource.setHostName(resourceName);
+        computeResource.setResourceDescription(resourceDesc);
+        computeResource.setPreferredJobSubmissionProtocol(preferedSubmissionProtocol);
+        return computeResource;
+    }
+
+    public static SSHJobSubmission createSSHJobSubmission (int sshPort,
+                                                        ResourceJobManager jobManager){
+        SSHJobSubmission jobSubmission = new SSHJobSubmission();
+        jobSubmission.setResourceJobManager(jobManager);
+        jobSubmission.setSshPort(sshPort);
+        return jobSubmission;
+    }
+
+    public static GSISSHJobSubmission createGSISSHJobSubmission (int sshPort,
+                                                              ResourceJobManager jobManager,
+                                                              String installedPath,
+                                                              String monitorMode){
+        GSISSHJobSubmission jobSubmission = new GSISSHJobSubmission();
+        jobSubmission.setResourceJobManager(jobManager);
+        jobSubmission.setSshPort(sshPort);
+        jobSubmission.setInstalledPath(installedPath);
+        jobSubmission.setMonitorMode(monitorMode);
+        return jobSubmission;
+    }
+
+    public static GlobusJobSubmission createGlobusJobSubmission (SecurityProtocol securityProtocol,
+                                                                 ResourceJobManager resourceJobManager,
+                                                                 List<String> globusEPs){
+        GlobusJobSubmission jobSubmission = new GlobusJobSubmission();
+        jobSubmission.setResourceJobManager(resourceJobManager);
+        jobSubmission.setSecurityProtocol(securityProtocol);
+        jobSubmission.setGlobusGateKeeperEndPoint(globusEPs);
+        return jobSubmission;
+    }
+
+    public static SCPDataMovement createSCPDataMovement (SecurityProtocol securityProtocol,
+                                                         int sshPort){
+        SCPDataMovement dataMovement = new SCPDataMovement();
+        dataMovement.setSecurityProtocol(securityProtocol);
+        dataMovement.setSshPort(sshPort);
+        return dataMovement;
+    }
+
+    public static GridFTPDataMovement createGridFTPDataMovement (SecurityProtocol securityProtocol,
+                                                                List<String> gridFTPEPs){
+        GridFTPDataMovement dataMovement = new GridFTPDataMovement();
+        dataMovement.setSecurityProtocol(securityProtocol);
+        dataMovement.setGridFTPEndPoint(gridFTPEPs);
+        return dataMovement;
+    }
+}


Mime
View raw message