Author: samindaw
Date: Mon Dec 31 17:09:15 2012
New Revision: 1427182

URL: http://svn.apache.org/viewvc?rev=1427182&view=rev
Log:
workflow scheduling settings API update + impl

Added:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java
   (contents, props changed)
      - copied, changed from r1425154, 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSchedulingSettings.java
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java
   (with props)
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
   (with props)
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
   (with props)
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
   (with props)
Removed:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSchedulingSettings.java
Modified:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/NodeSettings.java

Copied: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java
 (from r1425154, 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSchedulingSettings.java)
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java?p2=airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java&p1=airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSchedulingSettings.java&r1=1425154&r2=1427182&rev=1427182&view=diff
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSchedulingSettings.java
 (original)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java
 Mon Dec 31 17:09:15 2012
@@ -21,7 +21,7 @@
 
 package org.apache.airavata.client.api;
 
-public interface HPCSchedulingSettings {
+public interface HPCSettings {
        
        /**
         * Get the job manager to use for this job submission
@@ -33,13 +33,13 @@ public interface HPCSchedulingSettings {
         * Get the no of CPU cores to allocate for this job 
         * @return
         */
-       public int getCPUCount();
+       public Integer getCPUCount();
        
        /**
         * Get the no of nodes to allocate for this job
         * @return
         */
-       public int getNodeCount();
+       public Integer getNodeCount();
        
        /**
         * Get the job queue name 
@@ -51,7 +51,7 @@ public interface HPCSchedulingSettings {
         * Get the maximum time the job should be allocated for execution 
         * @return
         */
-       public int getMaxWallTime();
+       public Integer getMaxWallTime();
        
        /**
         * Set the job manager to use for this job submission

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HPCSettings.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java?rev=1427182&r1=1427181&r2=1427182&view=diff
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
 (original)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
 Mon Dec 31 17:09:15 2012
@@ -33,7 +33,7 @@ public interface HostSchedulingSettings 
         * Using WS-Gram or not (Pre WS-GRAM) 
         * @return
         */
-       public boolean isWSGRAMPreffered();
+       public Boolean isWSGRAMPreffered();
        
        /**
         * Get the gatekeeper endpoint reference

Modified: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/NodeSettings.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/NodeSettings.java?rev=1427182&r1=1427181&r2=1427182&view=diff
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/NodeSettings.java
 (original)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/NodeSettings.java
 Mon Dec 31 17:09:15 2012
@@ -45,7 +45,7 @@ public interface NodeSettings {
         * HPC settings for the grid application exposed by the service 
descriptor
         * @return
         */
-       public HPCSchedulingSettings getHPCSettings();
+       public HPCSettings getHPCSettings();
        
        /**
         * Set the node Id of the workflow

Added: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java?rev=1427182&view=auto
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java
 (added)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java
 Mon Dec 31 17:09:15 2012
@@ -0,0 +1,108 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import org.apache.airavata.client.api.HPCSettings;
+
+public class HPCSettingsImpl implements HPCSettings {
+       private String jobManager;
+       private String queueName;
+       private Integer cpuCount;
+       private Integer nodeCount;
+       private Integer maxWallTime;
+       
+       @Override
+       public String getJobManager() {
+               return jobManager;
+       }
+
+       @Override
+       public Integer getCPUCount() {
+               return cpuCount;
+       }
+
+       @Override
+       public Integer getNodeCount() {
+               return nodeCount;
+       }
+
+       @Override
+       public String getQueueName() {
+               return queueName;
+       }
+
+       @Override
+       public Integer getMaxWallTime() {
+               return maxWallTime;
+       }
+
+       @Override
+       public void setJobManager(String jobManager) {
+               this.jobManager=jobManager;
+       }
+
+       @Override
+       public void setCPUCount(Integer cpuCount) {
+               this.cpuCount=cpuCount;
+       }
+
+       @Override
+       public void setNodeCount(Integer nodeCount) {
+               this.nodeCount=nodeCount;
+       }
+
+       @Override
+       public void setQueueName(String queueName) {
+               this.queueName=queueName;
+       }
+
+       @Override
+       public void setMaxWallTime(Integer maxWallTime) {
+               this.maxWallTime=maxWallTime;
+       }
+
+       @Override
+       public void resetJobManager() {
+               this.jobManager=null;
+       }
+
+       @Override
+       public void resetCPUCount() {
+               this.cpuCount=null;
+       }
+
+       @Override
+       public void resetNodeCount() {
+               this.nodeCount=null;
+       }
+
+       @Override
+       public void resetQueueName() {
+               this.queueName=null;
+       }
+
+       @Override
+       public void resetMaxWallTime() {
+               this.maxWallTime=null;
+       }
+
+}

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HPCSettingsImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java?rev=1427182&view=auto
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
 (added)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
 Mon Dec 31 17:09:15 2012
@@ -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.client.impl;
+
+import org.apache.airavata.client.api.HostSchedulingSettings;
+
+public class HostSchedulingSettingsImpl implements HostSchedulingSettings {
+       private String hostId;
+       private String gatekeeperEPR;
+       private Boolean wsgramPreffered;
+       
+       @Override
+       public String getHostId() {
+               return hostId;
+       }
+
+       @Override
+       public Boolean isWSGRAMPreffered() {
+               return wsgramPreffered;
+       }
+
+       @Override
+       public String getGatekeeperEPR() {
+               return gatekeeperEPR;
+       }
+
+       @Override
+       public void setHostId(String hostId) {
+               this.hostId=hostId;
+       }
+
+       @Override
+       public void setWSGramPreffered(boolean wsgramPreffered) {
+               this.wsgramPreffered=wsgramPreffered;
+       }
+
+       @Override
+       public void setGatekeeperEPR(String gatekeeperEPR) {
+               this.gatekeeperEPR=gatekeeperEPR;
+       }
+
+       @Override
+       public void resetWSGramPreffered() {
+               this.wsgramPreffered=null;
+       }
+
+       @Override
+       public void resetGatekeeperEPR() {
+               this.gatekeeperEPR=null;
+       }
+
+}

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java?rev=1427182&view=auto
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
 (added)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
 Mon Dec 31 17:09:15 2012
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import org.apache.airavata.client.api.HPCSettings;
+import org.apache.airavata.client.api.HostSchedulingSettings;
+import org.apache.airavata.client.api.NodeSettings;
+
+public class NodeSettingsImpl implements NodeSettings {
+       private String nodeId;
+       private String serviceId;
+       private HPCSettings hpcSettings;
+       private HostSchedulingSettings hostSchedulingSettings;
+       
+       public NodeSettingsImpl(String nodeId) {
+               this(nodeId,null);
+       }
+
+       public NodeSettingsImpl(String nodeId, String serviceId) {
+               setNodeId(nodeId);
+               setServiceId(serviceId);
+       }
+       
+       @Override
+       public String getNodeId() {
+               return nodeId;
+       }
+
+       @Override
+       public String getServiceId() {
+               return serviceId;
+       }
+
+       @Override
+       public HostSchedulingSettings getHostSettings() {
+               if (hostSchedulingSettings==null){
+                       hostSchedulingSettings=new HostSchedulingSettingsImpl();
+               }
+               return hostSchedulingSettings;
+       }
+
+       @Override
+       public HPCSettings getHPCSettings() {
+               if (hpcSettings==null){
+                       hpcSettings=new HPCSettingsImpl();
+               }
+               return hpcSettings;
+       }
+
+       @Override
+       public void setNodeId(String nodeId) {
+               this.nodeId=nodeId;
+       }
+
+       @Override
+       public void setServiceId(String serviceId) {
+               this.serviceId=serviceId;
+       }
+
+}

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java?rev=1427182&view=auto
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
 (added)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
 Mon Dec 31 17:09:15 2012
@@ -0,0 +1,96 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.airavata.client.api.NodeSettings;
+import org.apache.airavata.client.api.WorkflowSchedulingSettings;
+
+public class WorkflowSchedulingSettingsImpl implements
+               WorkflowSchedulingSettings {
+
+       private List<NodeSettings> nodeSettingsList;
+       
+       private List<NodeSettings> getNodeSettingsList(){
+               if (nodeSettingsList==null){
+                       nodeSettingsList=new ArrayList<NodeSettings>();
+               }
+               return nodeSettingsList;
+       }
+       
+       @Override
+       public NodeSettings[] getNodeSettings() {
+               return getNodeSettingsList().toArray(new NodeSettings[]{});
+       }
+
+       @Override
+       public NodeSettings addNewNodeSettings(String nodeId) {
+               getNodeSettingsList().add(new NodeSettingsImpl(nodeId));
+               return 
getNodeSettingsList().get(getNodeSettingsList().size()-1);
+       }
+
+       @Override
+       public NodeSettings addNewNodeSettings(String nodeId, String serviceId,
+                       int cpuCount, int nodeCount) {
+               NodeSettingsImpl nodeSettings = new NodeSettingsImpl(nodeId, 
serviceId);
+               nodeSettings.getHPCSettings().setCPUCount(cpuCount);
+               nodeSettings.getHPCSettings().setNodeCount(nodeCount);
+               return nodeSettings;
+       }
+
+       @Override
+       public void addNewNodeSettings(NodeSettings... newNodeSettingsList) {
+               
getNodeSettingsList().addAll(Arrays.asList(newNodeSettingsList));
+       }
+
+       @Override
+       public boolean hasNodeSettings(String nodeId) {
+               return getNodeSettings(nodeId)!=null;
+       }
+
+       @Override
+       public NodeSettings getNodeSettings(String nodeId) {
+               for(NodeSettings nodeSettings:getNodeSettingsList()){
+                       if (nodeSettings.getNodeId().equals(nodeId)){
+                               return nodeSettings;
+                       }
+               }
+               return null;
+       }
+
+       @Override
+       public void removeNodeSettings(String nodeId) {
+               if (hasNodeSettings(nodeId)){
+                       getNodeSettingsList().remove(getNodeSettings(nodeId));
+               }
+
+       }
+
+       @Override
+       public void removeAllNodeSettings() {
+               getNodeSettingsList().clear();
+       }
+
+}

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowSchedulingSettingsImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to