airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1139550 [2/6] - in /incubator/airavata/core/trunk/gfac: ./ .settings/ src/main/java/org/apache/airavata/core/gfac/context/ src/main/java/org/apache/airavata/core/gfac/context/impl/ src/main/java/org/apache/airavata/core/gfac/context/impl/u...
Date Sat, 25 Jun 2011 15:17:38 GMT
Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.core.gfac.external;
 
 import java.io.File;
@@ -16,98 +37,97 @@ import org.globus.gsi.gssapi.auth.HostAu
 import org.ietf.jgss.GSSCredential;
 
 public class GridFtp {
-	public void makeDir(URI destURI, GSSCredential gssCred) throws GfacException {
-		GridFTPClient destClient = null;
-		try {
-			ContactInfo destHost = new ContactInfo(destURI.getHost(), destURI.getPort());
-			String destPath = destURI.getPath();
-			System.out.println(("Creating Directory = " + destHost + "=" + destPath));
-
-			destClient = new GridFTPClient(destHost.hostName, destHost.port);
-
-			int tryCount = 0;
-			while (true) {
-				try {
-					destClient.setAuthorization(new HostAuthorization("host"));
-					destClient.authenticate(gssCred);
-					destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
-
-					if (!destClient.exists(destPath)) {
-						destClient.makeDir(destPath);
-					}
-					break;
-				} catch (Exception e) {
-					String message = "Mkdir " + destURI + " with " + e.getMessage() + " (try " + tryCount + ") retrying at Gfac";
-					tryCount++;
-					if (tryCount >= 3) {
-						throw new GfacException(e.getMessage(), e);
-					}
-					Thread.sleep(10000);
-				}
-			}
-		} catch (ServerException e) {
-			e.printStackTrace();
-		} catch (IOException e) {
-			e.printStackTrace();
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		} finally {
-			if (destClient != null)
-				try {
-					destClient.close();
-				} catch (Exception e) {
-					// no op
-				}
-		}
-	}
-
-	public String readRemoteFile(URI destURI, GSSCredential gsCredential, File localFile) throws GfacException {
-		GridFTPClient ftpClient = null;
-
-		try {
-			ContactInfo contactInfo = new ContactInfo(destURI.getHost(), destURI.getPort());
-			String remoteFile = destURI.getPath();
-
-			ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
-			ftpClient.setAuthorization(new HostAuthorization("host"));
-			ftpClient.authenticate(gsCredential);
-			ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
-
-			File localTempfile;
-			if (localFile == null) {
-				localTempfile = File.createTempFile("stderr", "err");
-			} else {
-				localTempfile = localFile;
-			}
-
-			System.out.println("the local temp file is " + localTempfile);
-			System.out.println("the remote file is " + remoteFile);
-
-			ftpClient.get(remoteFile, localTempfile);
-			FileInputStream instream = new FileInputStream(localTempfile);
-			int size = instream.available();
-			byte[] buf = new byte[size];
-
-			instream.read(buf);
-
-			return new String(buf);
-		} catch (ServerException e) {
-			e.printStackTrace();
-		} catch (ClientException e) {
-			e.printStackTrace();
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-		} catch (IOException e) {
-			e.printStackTrace();
-		} finally {
-			if (ftpClient != null)
-				try {
-					ftpClient.close();
-				} catch (Exception e) {
-					// no op
-				}
-		}
-		return null;
-	}
+    public void makeDir(URI destURI, GSSCredential gssCred) throws GfacException {
+        GridFTPClient destClient = null;
+        try {
+            ContactInfo destHost = new ContactInfo(destURI.getHost(), destURI.getPort());
+            String destPath = destURI.getPath();
+            System.out.println(("Creating Directory = " + destHost + "=" + destPath));
+
+            destClient = new GridFTPClient(destHost.hostName, destHost.port);
+
+            int tryCount = 0;
+            while (true) {
+                try {
+                    destClient.setAuthorization(new HostAuthorization("host"));
+                    destClient.authenticate(gssCred);
+                    destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
+
+                    if (!destClient.exists(destPath)) {
+                        destClient.makeDir(destPath);
+                    }
+                    break;
+                } catch (Exception e) {
+                    tryCount++;
+                    if (tryCount >= 3) {
+                        throw new GfacException(e.getMessage(), e);
+                    }
+                    Thread.sleep(10000);
+                }
+            }
+        } catch (ServerException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        } finally {
+            if (destClient != null)
+                try {
+                    destClient.close();
+                } catch (Exception e) {
+                    // no op
+                }
+        }
+    }
+
+    public String readRemoteFile(URI destURI, GSSCredential gsCredential, File localFile) throws GfacException {
+        GridFTPClient ftpClient = null;
+
+        try {
+            ContactInfo contactInfo = new ContactInfo(destURI.getHost(), destURI.getPort());
+            String remoteFile = destURI.getPath();
+
+            ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
+            ftpClient.setAuthorization(new HostAuthorization("host"));
+            ftpClient.authenticate(gsCredential);
+            ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
+
+            File localTempfile;
+            if (localFile == null) {
+                localTempfile = File.createTempFile("stderr", "err");
+            } else {
+                localTempfile = localFile;
+            }
+
+            System.out.println("the local temp file is " + localTempfile);
+            System.out.println("the remote file is " + remoteFile);
+
+            ftpClient.get(remoteFile, localTempfile);
+            FileInputStream instream = new FileInputStream(localTempfile);
+            int size = instream.available();
+            byte[] buf = new byte[size];
+
+            instream.read(buf);
+
+            return new String(buf);
+        } catch (ServerException e) {
+            e.printStackTrace();
+        } catch (ClientException e) {
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (ftpClient != null)
+                try {
+                    ftpClient.close();
+                } catch (Exception e) {
+                    // no op
+                }
+        }
+        return null;
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/AbstractServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/AbstractServiceFactory.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/AbstractServiceFactory.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/AbstractServiceFactory.java Sat Jun 25 15:17:35 2011
@@ -1,14 +1,35 @@
+/*
+ *
+ * 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.core.gfac.factory;
 
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.services.GenericService;
 
 public abstract class AbstractServiceFactory {
-	
-	public final GenericService createService() throws GfacException{
-		getGenericService().init();		
-		return getGenericService();
-	}
-	
-	protected abstract GenericService getGenericService() throws GfacException;
+
+    public final GenericService createService() throws GfacException {
+        getGenericService().init();
+        return getGenericService();
+    }
+
+    protected abstract GenericService getGenericService() throws GfacException;
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/PropertyServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/PropertyServiceFactory.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/PropertyServiceFactory.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/factory/PropertyServiceFactory.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.core.gfac.factory;
 
 import org.apache.airavata.core.gfac.services.GenericService;
@@ -5,12 +26,12 @@ import org.apache.airavata.core.gfac.ser
 
 public class PropertyServiceFactory extends AbstractServiceFactory {
 
-	private GenericService service;
+    private GenericService service;
 
-	public GenericService getGenericService(){
-		if(service == null){
-			service = new PropertiesBasedServiceImpl();
-		}
-		return service;
-	}
+    public GenericService getGenericService() {
+        if (service == null) {
+            service = new PropertiesBasedServiceImpl();
+        }
+        return service;
+    }
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/model/ExecutionModel.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/model/ExecutionModel.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/model/ExecutionModel.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/model/ExecutionModel.java Sat Jun 25 15:17:35 2011
@@ -1,7 +1,27 @@
+/*
+ *
+ * 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.core.gfac.model;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Map;
 
 import org.ogce.schemas.gfac.documents.ApplicationDescriptionType;
@@ -10,285 +30,285 @@ import org.ogce.schemas.gfac.documents.H
 
 public class ExecutionModel {
 
-	private String jobID;
-	
-	private String userDN;
-
-	private String workingDir;
-
-	private String tmpDir;
-
-	private String stdOut;
-
-	private String stderr;
-
-	private String host;
-
-	private String executable;
-
-	private Map<String, String> env;
-
-	private String inputDataDir;
-
-	private String outputDataDir;
-
-	private String stdIn;
-
-	private String stdoutStr;
-
-	private String stderrStr;
-
-	private ArrayList<String> inputParameters;
-
-	private ArrayList<String> outputParameters;
-
-	private HostDescriptionType hostDesc;
-
-	private ApplicationDescriptionType aplicationDesc;
-
-	private GlobusGatekeeperType gatekeeper;
-
-	/**
-	 * @return the userDN
-	 */
-	public String getUserDN() {
-		return userDN;
-	}
-
-	/**
-	 * @param userDN
-	 *            the userDN to set
-	 */
-	public void setUserDN(String userDN) {
-		this.userDN = userDN;
-	}
-
-	/**
-	 * @return the workingDir
-	 */
-	public String getWorkingDir() {
-		return workingDir;
-	}
-
-	/**
-	 * @param workingDir
-	 *            the workingDir to set
-	 */
-	public void setWorkingDir(String workingDir) {
-		this.workingDir = workingDir;
-	}
-
-	/**
-	 * @return the tmpDir
-	 */
-	public String getTmpDir() {
-		return tmpDir;
-	}
-
-	/**
-	 * @param tmpDir
-	 *            the tmpDir to set
-	 */
-	public void setTmpDir(String tmpDir) {
-		this.tmpDir = tmpDir;
-	}
-
-	/**
-	 * @return the stdOut
-	 */
-	public String getStdOut() {
-		return stdOut;
-	}
-
-	/**
-	 * @param stdOut
-	 *            the stdOut to set
-	 */
-	public void setStdOut(String stdOut) {
-		this.stdOut = stdOut;
-	}
-
-	/**
-	 * @return the stderr
-	 */
-	public String getStderr() {
-		return stderr;
-	}
-
-	/**
-	 * @param stderr
-	 *            the stderr to set
-	 */
-	public void setStderr(String stderr) {
-		this.stderr = stderr;
-	}
-
-	/**
-	 * @return the host
-	 */
-	public String getHost() {
-		return host;
-	}
-
-	/**
-	 * @param host
-	 *            the host to set
-	 */
-	public void setHost(String host) {
-		this.host = host;
-	}
-
-	/**
-	 * @return the executable
-	 */
-	public String getExecutable() {
-		return executable;
-	}
-
-	/**
-	 * @param executable
-	 *            the executable to set
-	 */
-	public void setExecutable(String executable) {
-		this.executable = executable;
-	}
-
-	/**
-	 * @return the env
-	 */
-	public Map<String, String> getEnv() {
-		return env;
-	}
-
-	/**
-	 * @param env
-	 *            the env to set
-	 */
-	public void setEnv(Map<String, String> env) {
-		this.env = env;
-	}
-
-	/**
-	 * @return the inputDataDir
-	 */
-	public String getInputDataDir() {
-		return inputDataDir;
-	}
-
-	/**
-	 * @param inputDataDir
-	 *            the inputDataDir to set
-	 */
-	public void setInputDataDir(String inputDataDir) {
-		this.inputDataDir = inputDataDir;
-	}
-
-	/**
-	 * @return the outputDataDir
-	 */
-	public String getOutputDataDir() {
-		return outputDataDir;
-	}
-
-	/**
-	 * @param outputDataDir
-	 *            the outputDataDir to set
-	 */
-	public void setOutputDataDir(String outputDataDir) {
-		this.outputDataDir = outputDataDir;
-	}
-
-	/**
-	 * @return the stdIn
-	 */
-	public String getStdIn() {
-		return stdIn;
-	}
-
-	/**
-	 * @param stdIn
-	 *            the stdIn to set
-	 */
-	public void setStdIn(String stdIn) {
-		this.stdIn = stdIn;
-	}
-
-	/**
-	 * @return the stdoutStr
-	 */
-	public String getStdoutStr() {
-		return stdoutStr;
-	}
-
-	/**
-	 * @param stdoutStr
-	 *            the stdoutStr to set
-	 */
-	public void setStdoutStr(String stdoutStr) {
-		this.stdoutStr = stdoutStr;
-	}
-
-	/**
-	 * @return the stderrStr
-	 */
-	public String getStderrStr() {
-		return stderrStr;
-	}
-
-	/**
-	 * @param stderrStr
-	 *            the stderrStr to set
-	 */
-	public void setStderrStr(String stderrStr) {
-		this.stderrStr = stderrStr;
-	}
-
-	public void setInputParameters(ArrayList<String> inputParameters) {
-		this.inputParameters = inputParameters;
-	}
-
-	public ArrayList<String> getInputParameters() {
-		return inputParameters;
-	}
-
-	public void setOutputParameters(ArrayList<String> outputParameters) {
-		this.outputParameters = outputParameters;
-	}
-
-	public ArrayList<String> getOutputParameters() {
-		return outputParameters;
-	}
-
-	public void setHostDesc(HostDescriptionType hostDesc) {
-		this.hostDesc = hostDesc;
-	}
-
-	public HostDescriptionType getHostDesc() {
-		return hostDesc;
-	}
-
-	public void setGatekeeper(GlobusGatekeeperType gatekeeper) {
-		this.gatekeeper = gatekeeper;
-	}
-
-	public GlobusGatekeeperType getGatekeeper() {
-		return gatekeeper;
-	}
-
-	public void setAplicationDesc(ApplicationDescriptionType aplicationDesc) {
-		this.aplicationDesc = aplicationDesc;
-	}
-
-	public ApplicationDescriptionType getAplicationDesc() {
-		return aplicationDesc;
-	}
-
-	public void setJobID(String jobID) {
-		this.jobID = jobID;
-	}
-
-	public String getJobID() {
-		return jobID;
-	}
+    private String jobID;
+
+    private String userDN;
+
+    private String workingDir;
+
+    private String tmpDir;
+
+    private String stdOut;
+
+    private String stderr;
+
+    private String host;
+
+    private String executable;
+
+    private Map<String, String> env;
+
+    private String inputDataDir;
+
+    private String outputDataDir;
+
+    private String stdIn;
+
+    private String stdoutStr;
+
+    private String stderrStr;
+
+    private ArrayList<String> inputParameters;
+
+    private ArrayList<String> outputParameters;
+
+    private HostDescriptionType hostDesc;
+
+    private ApplicationDescriptionType aplicationDesc;
+
+    private GlobusGatekeeperType gatekeeper;
+
+    /**
+     * @return the userDN
+     */
+    public String getUserDN() {
+        return userDN;
+    }
+
+    /**
+     * @param userDN
+     *            the userDN to set
+     */
+    public void setUserDN(String userDN) {
+        this.userDN = userDN;
+    }
+
+    /**
+     * @return the workingDir
+     */
+    public String getWorkingDir() {
+        return workingDir;
+    }
+
+    /**
+     * @param workingDir
+     *            the workingDir to set
+     */
+    public void setWorkingDir(String workingDir) {
+        this.workingDir = workingDir;
+    }
+
+    /**
+     * @return the tmpDir
+     */
+    public String getTmpDir() {
+        return tmpDir;
+    }
+
+    /**
+     * @param tmpDir
+     *            the tmpDir to set
+     */
+    public void setTmpDir(String tmpDir) {
+        this.tmpDir = tmpDir;
+    }
+
+    /**
+     * @return the stdOut
+     */
+    public String getStdOut() {
+        return stdOut;
+    }
+
+    /**
+     * @param stdOut
+     *            the stdOut to set
+     */
+    public void setStdOut(String stdOut) {
+        this.stdOut = stdOut;
+    }
+
+    /**
+     * @return the stderr
+     */
+    public String getStderr() {
+        return stderr;
+    }
+
+    /**
+     * @param stderr
+     *            the stderr to set
+     */
+    public void setStderr(String stderr) {
+        this.stderr = stderr;
+    }
+
+    /**
+     * @return the host
+     */
+    public String getHost() {
+        return host;
+    }
+
+    /**
+     * @param host
+     *            the host to set
+     */
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    /**
+     * @return the executable
+     */
+    public String getExecutable() {
+        return executable;
+    }
+
+    /**
+     * @param executable
+     *            the executable to set
+     */
+    public void setExecutable(String executable) {
+        this.executable = executable;
+    }
+
+    /**
+     * @return the env
+     */
+    public Map<String, String> getEnv() {
+        return env;
+    }
+
+    /**
+     * @param env
+     *            the env to set
+     */
+    public void setEnv(Map<String, String> env) {
+        this.env = env;
+    }
+
+    /**
+     * @return the inputDataDir
+     */
+    public String getInputDataDir() {
+        return inputDataDir;
+    }
+
+    /**
+     * @param inputDataDir
+     *            the inputDataDir to set
+     */
+    public void setInputDataDir(String inputDataDir) {
+        this.inputDataDir = inputDataDir;
+    }
+
+    /**
+     * @return the outputDataDir
+     */
+    public String getOutputDataDir() {
+        return outputDataDir;
+    }
+
+    /**
+     * @param outputDataDir
+     *            the outputDataDir to set
+     */
+    public void setOutputDataDir(String outputDataDir) {
+        this.outputDataDir = outputDataDir;
+    }
+
+    /**
+     * @return the stdIn
+     */
+    public String getStdIn() {
+        return stdIn;
+    }
+
+    /**
+     * @param stdIn
+     *            the stdIn to set
+     */
+    public void setStdIn(String stdIn) {
+        this.stdIn = stdIn;
+    }
+
+    /**
+     * @return the stdoutStr
+     */
+    public String getStdoutStr() {
+        return stdoutStr;
+    }
+
+    /**
+     * @param stdoutStr
+     *            the stdoutStr to set
+     */
+    public void setStdoutStr(String stdoutStr) {
+        this.stdoutStr = stdoutStr;
+    }
+
+    /**
+     * @return the stderrStr
+     */
+    public String getStderrStr() {
+        return stderrStr;
+    }
+
+    /**
+     * @param stderrStr
+     *            the stderrStr to set
+     */
+    public void setStderrStr(String stderrStr) {
+        this.stderrStr = stderrStr;
+    }
+
+    public void setInputParameters(ArrayList<String> inputParameters) {
+        this.inputParameters = inputParameters;
+    }
+
+    public ArrayList<String> getInputParameters() {
+        return inputParameters;
+    }
+
+    public void setOutputParameters(ArrayList<String> outputParameters) {
+        this.outputParameters = outputParameters;
+    }
+
+    public ArrayList<String> getOutputParameters() {
+        return outputParameters;
+    }
+
+    public void setHostDesc(HostDescriptionType hostDesc) {
+        this.hostDesc = hostDesc;
+    }
+
+    public HostDescriptionType getHostDesc() {
+        return hostDesc;
+    }
+
+    public void setGatekeeper(GlobusGatekeeperType gatekeeper) {
+        this.gatekeeper = gatekeeper;
+    }
+
+    public GlobusGatekeeperType getGatekeeper() {
+        return gatekeeper;
+    }
+
+    public void setAplicationDesc(ApplicationDescriptionType aplicationDesc) {
+        this.aplicationDesc = aplicationDesc;
+    }
+
+    public ApplicationDescriptionType getAplicationDesc() {
+        return aplicationDesc;
+    }
+
+    public void setJobID(String jobID) {
+        this.jobID = jobID;
+    }
+
+    public String getJobID() {
+        return jobID;
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/DummyNotification.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/DummyNotification.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/DummyNotification.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/DummyNotification.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.core.gfac.notification;
 
 import java.net.URI;
@@ -11,104 +32,105 @@ import edu.indiana.extreme.lead.workflow
 
 public class DummyNotification implements NotificationService {
 
-	public DataDurationObj dataReceiveFinished(DataDurationObj dataObj, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DataDurationObj dataReceiveFinished(DataDurationObj dataObj, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public DataDurationObj dataReceiveStarted(URI dataID, URI remoteLocation, URI localLocation) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DataDurationObj dataReceiveStarted(URI dataID, URI remoteLocation, URI localLocation) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public DataDurationObj dataSendFinished(DataDurationObj dataObj, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DataDurationObj dataSendFinished(DataDurationObj dataObj, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public DataDurationObj dataSendStarted(DataObj dataObj, URI remoteLocation) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DataDurationObj dataSendStarted(DataObj dataObj, URI remoteLocation) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public void dataConsumed(URI dataID, URI replica, String type, String soapElementName) {
-		// TODO Auto-generated method stub
+    public void dataConsumed(URI dataID, URI replica, String type, String soapElementName) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void dataProduced(URI dataID, URI replica, String type, String soapElementName) {
-		// TODO Auto-generated method stub
+    public void dataProduced(URI dataID, URI replica, String type, String soapElementName) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public DurationObj computationDuration(long durationMillis) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DurationObj computationDuration(long durationMillis) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public DurationObj computationFinished(DurationObj compObj) {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DurationObj computationFinished(DurationObj compObj) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public DurationObj computationStarted() {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public DurationObj computationStarted() {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public void exception(String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void exception(String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void flush() {
-		// TODO Auto-generated method stub
+    public void flush() {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void info(String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void info(String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void sendingResponseFailed(Throwable trace, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void sendingResponseFailed(Throwable trace, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void sendingResponseSucceeded(String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void sendingResponseSucceeded(String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void sendingResult(MessageContext messageContext) throws GfacException {
-		// TODO Auto-generated method stub
+    public void sendingResult(MessageContext messageContext) throws GfacException {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void warning(String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void warning(String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void sendingFault(String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void sendingFault(String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void publishURL(String title, String url, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void publishURL(String title, String url, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void appAudit(String name, URI jobHandle, String host, String queueName, String jobId, String dName, String projectId, String rsl, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void appAudit(String name, URI jobHandle, String host, String queueName, String jobId, String dName,
+            String projectId, String rsl, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void sendResourceMappingNotifications(String hostName, String... descriptionAndAnnotation) {
-		// TODO Auto-generated method stub
+    public void sendResourceMappingNotifications(String hostName, String... descriptionAndAnnotation) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/NotificationService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/NotificationService.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/NotificationService.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/notification/NotificationService.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.core.gfac.notification;
 
 import java.net.URI;
@@ -11,20 +32,17 @@ import edu.indiana.extreme.lead.workflow
 
 public interface NotificationService {
 
-    DataDurationObj dataReceiveFinished(DataDurationObj dataObj,
-            String... descriptionAndAnnotation);
+    DataDurationObj dataReceiveFinished(DataDurationObj dataObj, String... descriptionAndAnnotation);
 
-    DataDurationObj dataReceiveStarted(URI dataID, URI remoteLocation,
-            URI localLocation);
+    DataDurationObj dataReceiveStarted(URI dataID, URI remoteLocation, URI localLocation);
 
-    DataDurationObj dataSendFinished(DataDurationObj dataObj,
-            String... descriptionAndAnnotation);
+    DataDurationObj dataSendFinished(DataDurationObj dataObj, String... descriptionAndAnnotation);
 
     DataDurationObj dataSendStarted(DataObj dataObj, URI remoteLocation);
 
-    void dataConsumed(URI dataID,URI replica,String type,String soapElementName);
+    void dataConsumed(URI dataID, URI replica, String type, String soapElementName);
 
-    void dataProduced(URI dataID,URI replica,String type,String soapElementName);
+    void dataProduced(URI dataID, URI replica, String type, String soapElementName);
 
     DurationObj computationDuration(long durationMillis);
 
@@ -45,12 +63,14 @@ public interface NotificationService {
     void sendingResult(MessageContext messageContext) throws GfacException;
 
     void warning(String... descriptionAndAnnotation);
-    
+
     void sendingFault(String... descriptionAndAnnotation);
+
     void publishURL(String title, String url, String... descriptionAndAnnotation);
-    
-    void appAudit(String name, URI jobHandle, String host, String queueName, String jobId, String dName, String projectId, String rsl, String... descriptionAndAnnotation);
 
-    void sendResourceMappingNotifications(String hostName, String ...descriptionAndAnnotation );
+    void appAudit(String name, URI jobHandle, String host, String queueName, String jobId, String dName,
+            String projectId, String rsl, String... descriptionAndAnnotation);
+
+    void sendResourceMappingNotifications(String hostName, String... descriptionAndAnnotation);
 
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/AbstractProvider.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/AbstractProvider.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/AbstractProvider.java Sat Jun 25 15:17:35 2011
@@ -1,10 +1,30 @@
+/*
+ *
+ * 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.core.gfac.provider;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+public abstract class AbstractProvider implements Provider {
+    protected final Logger log = LoggerFactory.getLogger(this.getClass());
 
-public abstract class AbstractProvider implements Provider{
-	protected final Logger log = LoggerFactory.getLogger(this.getClass());
-	
 }

Modified: incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java?rev=1139550&r1=1139549&r2=1139550&view=diff
==============================================================================
--- incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java (original)
+++ incubator/airavata/core/trunk/gfac/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java Sat Jun 25 15:17:35 2011
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.core.gfac.provider;
 
 import java.io.BufferedReader;
@@ -56,500 +77,506 @@ import com.amazonaws.services.ec2.model.
 
 import edu.indiana.extreme.lead.workflow_tracking.common.DurationObj;
 
+public class EC2Provider extends AbstractProvider {
 
+    public static final String AMAZON_SECURITY_CONTEXT = "amazon";
 
-public class EC2Provider extends AbstractProvider {
-	
-	public static final String AMAZON_SECURITY_CONTEXT = "amazon";
-	
-	public static final int SLEEP_TIME_SECOND = 120;
-
-	public static final String KEY_PAIR_NAME = "gfac";
-
-	public static final String KEY_PAIR_FILE = "ec2_rsa";
-	
-	private static final String privateKeyFilePath = System.getProperty("user.home") + "/.ssh/" + KEY_PAIR_FILE;
-
-	private Instance instance;	
-	
-	private static final String SPACE = " ";
-	
-	private String buildCommand(List<String> cmdList) {
-		StringBuffer buff = new StringBuffer();
-		for (String string : cmdList) {
-			buff.append(string);
-			buff.append(SPACE);
-		}
-		return buff.toString();
-	}
-
-	@Override
-	public void initialize(InvocationContext invocationContext) throws GfacException {
-		ExecutionContext appExecContext = invocationContext.getExecutionContext();
-		ExecutionModel model = appExecContext.getExecutionModel();
-		
-		AmazonSecurityContext amazonSecurityContext = ((AmazonSecurityContext) invocationContext.getSecurityContext(AMAZON_SECURITY_CONTEXT));
-		String access_key = amazonSecurityContext.getAccessKey();
-		String secret_key = amazonSecurityContext.getSecretKey();
-
-		//TODO way to read value (header or xregistry)
-		String ami_id = "";
-		String ins_type = "";
-		String ins_id = "";
-		
-		/*
-		 * Need to start EC2 instance before running it
-		 */
-		AWSCredentials credential = new BasicAWSCredentials(access_key, secret_key);
-		AmazonEC2Client ec2client = new AmazonEC2Client(credential);
-				
-		try {
-			/*
-			 * Build key pair before start instance
-			 */
-			buildKeyPair(ec2client);
-
-			// right now, we can run it on one host
-			if (ami_id != null)
-				this.instance = startInstances(ec2client, ami_id, ins_type, invocationContext.getExecutionContext().getNotificationService()).get(0);
-			else {
-
-				// already running instance
-				DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
-				DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));
-
-				if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
-					throw new GfacException("Instance not found:" + ins_id, FaultCode.InvalidRequest);
-				}
-
-				this.instance = describeInstancesResult.getReservations().get(0).getInstances().get(0);
-
-				// check instance keypair
-				if (this.instance.getKeyName() == null || !this.instance.getKeyName().equals(KEY_PAIR_NAME))
-					throw new GfacException("Keypair for instance:" + ins_id + " is not valid", FaultCode.InvalidRequest);
-			}
-			
-			//send out instance id
-			invocationContext.getExecutionContext().getNotificationService().sendResourceMappingNotifications(this.instance.getPublicDnsName(), "EC2 Instance " + this.instance.getInstanceId() + " is running with public name " + this.instance.getPublicDnsName(), this.instance.getInstanceId());
-			
-
-			/*
-			 * Make sure port 22 is connectable
-			 */
-			for (GroupIdentifier g : this.instance.getSecurityGroups()) {
-				IpPermission ip = new IpPermission();
-				ip.setIpProtocol("tcp");
-				ip.setFromPort(22);
-				ip.setToPort(22);
-				AuthorizeSecurityGroupIngressRequest r = new AuthorizeSecurityGroupIngressRequest();
-				r = r.withIpPermissions(ip.withIpRanges("0.0.0.0/0"));
-				r.setGroupId(g.getGroupId());
-				try {
-					ec2client.authorizeSecurityGroupIngress(r);
-				} catch (AmazonServiceException as) {
-					/*
-					 * If exception is from duplicate room, ignore it.
-					 */
-					if (!as.getErrorCode().equals("InvalidPermission.Duplicate"))
-						throw as;
-				}
-			}		
-
-		} catch (Exception e) {
-			// TODO throw out
-			e.printStackTrace();
-			log.error(e.getMessage(), e);
-			throw new GfacException(e, FaultCode.InvalidRequest);
-		}		
-				
-		//set Host location
-		model.setHost(this.instance.getPublicDnsName());
-		
-		/*
-		 * Make directory
-		 */
-		SSHClient ssh = new SSHClient();
-		try {
-			ssh.loadKnownHosts();
-			ssh.connect(this.instance.getPublicDnsName());
-
-			ssh.authPublickey(privateKeyFilePath);
-			final Session session = ssh.startSession();
-			try {
-				StringBuilder command = new StringBuilder();
-				command.append("mkdir -p ");
-				command.append(model.getTmpDir());
-				command.append(" | ");
-				command.append("mkdir -p ");
-				command.append(model.getWorkingDir());
-				command.append(" | ");
-				command.append("mkdir -p ");
-				command.append(model.getInputDataDir());
-				command.append(" | ");
-				command.append("mkdir -p ");
-				command.append(model.getOutputDataDir());
-				Command cmd = session.exec(command.toString());
-				cmd.join(5, TimeUnit.SECONDS);
-			} catch (Exception e) {
-				throw e;
-			} finally {
-				try {
-					session.close();
-				} catch (Exception e) {
-				}
-			}
-		} catch (Exception e) {
-			throw new GfacException(e.getMessage(), e);
-		} finally {
-			try {
-				ssh.disconnect();
-			} catch (Exception e) {
-			}
-		}
-	}
-	
-	@Override
-	public void execute(InvocationContext invocationContext) throws GfacException {
-		ExecutionContext context = invocationContext.getExecutionContext();
-		ExecutionModel model = context.getExecutionModel();
-
-		List<String> cmdList = new ArrayList<String>();
-
-		SSHClient ssh = new SSHClient();
-		try {
-
-			/*
-			 * Notifier
-			 */
-			NotificationService notifier = context.getNotificationService();
-
-			/*
-			 * Builder Command
-			 */
-			cmdList.add(context.getExecutionModel().getExecutable());
-			cmdList.addAll(context.getExecutionModel().getInputParameters());
-
-			// create process builder from command
-			String command = buildCommand(cmdList);
-			
-			//redirect StdOut and StdErr
-			command += SPACE + "1>" + SPACE + model.getStdOut();
-			command += SPACE + "2>" + SPACE + model.getStderr();			
-
-			// get the env of the host and the application
-			Map<String, String> nv = context.getExecutionModel().getEnv();			
-
-			// extra env's
-			nv.put(GFacConstants.INPUT_DATA_DIR, context.getExecutionModel().getInputDataDir());
-			nv.put(GFacConstants.OUTPUT_DATA_DIR, context.getExecutionModel().getOutputDataDir());
-			
-			// log info
-			log.info("Command = " + buildCommand(cmdList));			
-			for (String key : nv.keySet()) {
-				log.info("Env[" + key + "] = " + nv.get(key));
-			}
-
-			// notify start
-			DurationObj compObj = notifier.computationStarted();
-
-			/*
-			 * Create ssh connection
-			 */
-			ssh.loadKnownHosts();
-			ssh.connect(model.getHost());
-			ssh.authPublickey(privateKeyFilePath);
-
-			final Session session = ssh.startSession();
-			try {
-				/*
-				 * Build working Directory
-				 */
-				log.info("WorkingDir = " + model.getWorkingDir());			
-				session.exec("mkdir -p " + model.getWorkingDir());
-				session.exec("cd " + model.getWorkingDir());
-				
-				/*
-				 * Set environment
-				 */
-				for (String key : nv.keySet()) {
-					session.setEnvVar(key, nv.get(key));
-				}
-				
-				/*
-				 * Execute
-				 */
-				Command cmd = session.exec(command);
-				log.info("stdout=" + GfacUtils.readFromStream(session.getInputStream()));
-				cmd.join(5, TimeUnit.SECONDS);
-				
-				
-				// notify end
-				notifier.computationFinished(compObj);
-				
-				/*
-				 * check return value. usually not very helpful to draw conclusions
-				 * based on return values so don't bother. just provide warning in
-				 * the log messages
-				 */				
-				if (cmd.getExitStatus() != 0) {
-					log.error("Process finished with non zero return value. Process may have failed");
-				} else {
-					log.info("Process finished with return value of zero.");
-				}												
-				
-				File logDir = new File("./service_logs");
-				if (!logDir.exists()) {
-					logDir.mkdir();
-				}				
-				
-				// Get the Stdouts and StdErrs
-				QName x = QName.valueOf(invocationContext.getServiceName());
-				String timeStampedServiceName = GfacUtils.createServiceDirName(x);
-				File localStdOutFile = new File(logDir, timeStampedServiceName + ".stdout");
-				File localStdErrFile = new File(logDir, timeStampedServiceName + ".stderr");
-				
-				SCPFileTransfer fileTransfer = ssh.newSCPFileTransfer();
-				fileTransfer.download(model.getStdOut(), localStdOutFile.getAbsolutePath());
-				fileTransfer.download(model.getStderr(), localStdErrFile.getAbsolutePath());				
-				
-				context.getExecutionModel().setStdoutStr(GfacUtils.readFile(localStdOutFile.getAbsolutePath()));
-				context.getExecutionModel().setStderrStr(GfacUtils.readFile(localStdErrFile.getAbsolutePath()));
-				
-				// set to context
-				OutputUtils.fillOutputFromStdout(invocationContext.getMessageContext("output"), context.getExecutionModel().getStdoutStr(), context.getExecutionModel().getStderrStr());
-				
-			} catch (Exception e) {
-				throw e;
-			} finally {
-				try {
-					session.close();
-				} catch (Exception e) {
-				}
-			}
-		} catch (Exception e) {
-			throw new GfacException(e.getMessage(), e);
-		} finally {
-			try {
-				ssh.disconnect();
-			} catch (Exception e) {
-			}
-		}
-	}
-
-	@Override
-	public void dispose(InvocationContext invocationContext) throws GfacException {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void abort(InvocationContext invocationContext) throws GfacException {
-		// TODO Auto-generated method stub
-		
-	}
-	
-
-	private List<Instance> startInstances(AmazonEC2Client ec2, String AMI_ID, String INS_TYPE, NotificationService notifier) throws AmazonServiceException {
-		// start only 1 instance
-		RunInstancesRequest request = new RunInstancesRequest(AMI_ID, 1, 1);
-		request.setKeyName(KEY_PAIR_NAME);
-		request.setInstanceType(INS_TYPE);
-
-		RunInstancesResult result = ec2.runInstances(request);
-
-		List<Instance> instances = result.getReservation().getInstances();
-
-		while (!allInstancesStateEqual(instances, InstanceStateName.Running)) {
-
-			// instance status should not be Terminated
-			if (anyInstancesStateEqual(instances, InstanceStateName.Terminated)) {
-				throw new AmazonClientException("Some Instance is terminated before running a job");
-			}
-			
-			// notify the status
-			for (Instance ins: instances) {
-				notifier.info("EC2 Instance " +ins.getInstanceId() + " is " + ins.getState().getName().toString());
-			}
-
-			try {
-				Thread.sleep(SLEEP_TIME_SECOND * 1000l);
-			} catch (Exception ex) {
-				// no op
-			}
-
-			DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
-			describeInstancesRequest.setInstanceIds(getInstanceIDs(instances));
-
-			DescribeInstancesResult describeInstancesResult = ec2.describeInstances(describeInstancesRequest);
-			instances = describeInstancesResult.getReservations().get(0).getInstances();
-		}
-
-		log.info("All instances is running");
-		return instances;
-	}
-
-	private void buildKeyPair(AmazonEC2Client ec2) throws NoSuchAlgorithmException, InvalidKeySpecException, AmazonServiceException, AmazonClientException, IOException {
-
-		boolean newKey = false;
-		
-		File privateKeyFile = new File(privateKeyFilePath);
-		File publicKeyFile = new File(privateKeyFilePath + ".pub");
-
-		/*
-		 * Check if Keypair already created on the server
-		 */
-		if (!privateKeyFile.exists()) {
-
-			// check folder and create if it does not exist
-			File sshDir = new File(System.getProperty("user.home") + "/.ssh/");
-			if (!sshDir.exists())
-				sshDir.mkdir();
-
-			// Generate a 1024-bit RSA key pair
-			KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
-			keyGen.initialize(1024);
-			KeyPair keypair = keyGen.genKeyPair();
-
-			FileOutputStream fos = null;
-
-			// Store Public Key.
-			try {
-				fos = new FileOutputStream(privateKeyFilePath + ".pub");
-				fos.write(Base64.encodeBytes(keypair.getPublic().getEncoded()).getBytes());
-			} catch (IOException ioe) {
-				throw ioe;
-			} finally {
-				if (fos != null) {
-					try {
-						fos.close();
-						fos = null;
-					} catch (IOException ioe) {
-						throw ioe;
-					}
-				}
-			}
-
-			// Store Private Key.
-			try {
-				fos = new FileOutputStream(privateKeyFilePath);
-				StringWriter stringWriter = new StringWriter();
-				
-				/*
-				 * Write in PEM format (openssl support)
-				 */
-				PEMWriter pemFormatWriter = new PEMWriter(stringWriter);
-				pemFormatWriter.writeObject(keypair.getPrivate());
-				pemFormatWriter.close();
-				fos.write(stringWriter.toString().getBytes());
-			} catch (IOException ioe) {
-				throw ioe;
-			} finally {
-				if (fos != null) {
-					try {
-						fos.close();
-						fos = null;
-					} catch (IOException ioe) {
-						throw ioe;
-					}
-				}
-			}
-
-			privateKeyFile.setWritable(false, false);
-			privateKeyFile.setExecutable(false, false);
-			privateKeyFile.setReadable(false, false);
-			privateKeyFile.setReadable(true);
-			privateKeyFile.setWritable(true);
-
-			// set that this key is just created
-			newKey = true;
-		}
-
-		/*
-		 * Read Public Key
-		 */
-		String encodedPublicKey = null;
-		BufferedReader br = null;
-		try {
-			br = new BufferedReader(new FileReader(publicKeyFile));
-			encodedPublicKey = br.readLine();
-		} catch (IOException ioe) {
-			throw ioe;
-		} finally {
-			if (br != null) {
-				try {
-					br.close();
-					br = null;
-				} catch (IOException ioe) {
-					throw ioe;
-				}
-			}
-		}
-		
-		/*
-		 * Generate key pair in Amazon if necessary
-		 */
-		try {
-			/*
-			 * Get current key pair in Amazon
-			 */
-			DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
-			ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(KEY_PAIR_NAME));
-
-			/*
-			 * If key exists and new key is created, delete old key and replace
-			 * with new one. Else, do nothing
-			 */
-
-			if (newKey) {
-				DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(KEY_PAIR_NAME);
-				ec2.deleteKeyPair(deleteKeyPairRequest);
-				ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
-				ec2.importKeyPair(importKeyPairRequest);
-			}
-
-		} catch (AmazonServiceException ase) {
-			/*
-			 * Key doesn't exists, import new key.
-			 */
-			if(ase.getErrorCode().equals("InvalidKeyPair.NotFound")){			
-				ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
-				ec2.importKeyPair(importKeyPairRequest);
-			}else{
-				throw ase;
-			}
-		}
-	}
-
-	private boolean anyInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
-		for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
-			Instance instance = (Instance) iterator.next();
-
-			// if one of instance is not running, return false
-			if (InstanceStateName.fromValue(instance.getState().getName()) == name) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private boolean allInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
-		for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
-			Instance instance = (Instance) iterator.next();
-
-			// if one of instance is not running, return false
-			if (InstanceStateName.fromValue(instance.getState().getName()) != name) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	private List<String> getInstanceIDs(List<Instance> instances) {
-		List<String> ret = new ArrayList<String>();
-		for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
-			Instance instance = (Instance) iterator.next();
-			ret.add(instance.getInstanceId());
-		}
-		return ret;
-	}	
+    public static final int SLEEP_TIME_SECOND = 120;
+
+    public static final String KEY_PAIR_NAME = "gfac";
+
+    public static final String KEY_PAIR_FILE = "ec2_rsa";
+
+    private static final String privateKeyFilePath = System.getProperty("user.home") + "/.ssh/" + KEY_PAIR_FILE;
+
+    private Instance instance;
+
+    private static final String SPACE = " ";
+
+    private String buildCommand(List<String> cmdList) {
+        StringBuffer buff = new StringBuffer();
+        for (String string : cmdList) {
+            buff.append(string);
+            buff.append(SPACE);
+        }
+        return buff.toString();
+    }
+
+    @Override
+    public void initialize(InvocationContext invocationContext) throws GfacException {
+        ExecutionContext appExecContext = invocationContext.getExecutionContext();
+        ExecutionModel model = appExecContext.getExecutionModel();
+
+        AmazonSecurityContext amazonSecurityContext = ((AmazonSecurityContext) invocationContext
+                .getSecurityContext(AMAZON_SECURITY_CONTEXT));
+        String access_key = amazonSecurityContext.getAccessKey();
+        String secret_key = amazonSecurityContext.getSecretKey();
+
+        // TODO way to read value (header or xregistry)
+        String ami_id = "";
+        String ins_type = "";
+        String ins_id = "";
+
+        /*
+         * Need to start EC2 instance before running it
+         */
+        AWSCredentials credential = new BasicAWSCredentials(access_key, secret_key);
+        AmazonEC2Client ec2client = new AmazonEC2Client(credential);
+
+        try {
+            /*
+             * Build key pair before start instance
+             */
+            buildKeyPair(ec2client);
+
+            // right now, we can run it on one host
+            if (ami_id != null)
+                this.instance = startInstances(ec2client, ami_id, ins_type,
+                        invocationContext.getExecutionContext().getNotificationService()).get(0);
+            else {
+                // already running instance
+                DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
+                DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest
+                        .withInstanceIds(ins_id));
+
+                if (describeInstancesResult.getReservations().size() == 0
+                        || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
+                    throw new GfacException("Instance not found:" + ins_id, FaultCode.InvalidRequest);
+                }
+
+                this.instance = describeInstancesResult.getReservations().get(0).getInstances().get(0);
+
+                // check instance keypair
+                if (this.instance.getKeyName() == null || !this.instance.getKeyName().equals(KEY_PAIR_NAME))
+                    throw new GfacException("Keypair for instance:" + ins_id + " is not valid",
+                            FaultCode.InvalidRequest);
+            }
+
+            // send out instance id
+            invocationContext
+                    .getExecutionContext()
+                    .getNotificationService()
+                    .sendResourceMappingNotifications(
+                            this.instance.getPublicDnsName(),
+                            "EC2 Instance " + this.instance.getInstanceId() + " is running with public name "
+                                    + this.instance.getPublicDnsName(), this.instance.getInstanceId());
+
+            /*
+             * Make sure port 22 is connectable
+             */
+            for (GroupIdentifier g : this.instance.getSecurityGroups()) {
+                IpPermission ip = new IpPermission();
+                ip.setIpProtocol("tcp");
+                ip.setFromPort(22);
+                ip.setToPort(22);
+                AuthorizeSecurityGroupIngressRequest r = new AuthorizeSecurityGroupIngressRequest();
+                r = r.withIpPermissions(ip.withIpRanges("0.0.0.0/0"));
+                r.setGroupId(g.getGroupId());
+                try {
+                    ec2client.authorizeSecurityGroupIngress(r);
+                } catch (AmazonServiceException as) {
+                    /*
+                     * If exception is from duplicate room, ignore it.
+                     */
+                    if (!as.getErrorCode().equals("InvalidPermission.Duplicate"))
+                        throw as;
+                }
+            }
+
+        } catch (Exception e) {
+            // TODO throw out
+            e.printStackTrace();
+            log.error(e.getMessage(), e);
+            throw new GfacException(e, FaultCode.InvalidRequest);
+        }
+
+        // set Host location
+        model.setHost(this.instance.getPublicDnsName());
+
+        /*
+         * Make directory
+         */
+        SSHClient ssh = new SSHClient();
+        try {
+            ssh.loadKnownHosts();
+            ssh.connect(this.instance.getPublicDnsName());
+
+            ssh.authPublickey(privateKeyFilePath);
+            final Session session = ssh.startSession();
+            try {
+                StringBuilder command = new StringBuilder();
+                command.append("mkdir -p ");
+                command.append(model.getTmpDir());
+                command.append(" | ");
+                command.append("mkdir -p ");
+                command.append(model.getWorkingDir());
+                command.append(" | ");
+                command.append("mkdir -p ");
+                command.append(model.getInputDataDir());
+                command.append(" | ");
+                command.append("mkdir -p ");
+                command.append(model.getOutputDataDir());
+                Command cmd = session.exec(command.toString());
+                cmd.join(5, TimeUnit.SECONDS);
+            } catch (Exception e) {
+                throw e;
+            } finally {
+                try {
+                    session.close();
+                } catch (Exception e) {
+                }
+            }
+        } catch (Exception e) {
+            throw new GfacException(e.getMessage(), e);
+        } finally {
+            try {
+                ssh.disconnect();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    @Override
+    public void execute(InvocationContext invocationContext) throws GfacException {
+        ExecutionContext context = invocationContext.getExecutionContext();
+        ExecutionModel model = context.getExecutionModel();
+
+        List<String> cmdList = new ArrayList<String>();
+
+        SSHClient ssh = new SSHClient();
+        try {
+
+            /*
+             * Notifier
+             */
+            NotificationService notifier = context.getNotificationService();
+
+            /*
+             * Builder Command
+             */
+            cmdList.add(context.getExecutionModel().getExecutable());
+            cmdList.addAll(context.getExecutionModel().getInputParameters());
+
+            // create process builder from command
+            String command = buildCommand(cmdList);
+
+            // redirect StdOut and StdErr
+            command += SPACE + "1>" + SPACE + model.getStdOut();
+            command += SPACE + "2>" + SPACE + model.getStderr();
+
+            // get the env of the host and the application
+            Map<String, String> nv = context.getExecutionModel().getEnv();
+
+            // extra env's
+            nv.put(GFacConstants.INPUT_DATA_DIR, context.getExecutionModel().getInputDataDir());
+            nv.put(GFacConstants.OUTPUT_DATA_DIR, context.getExecutionModel().getOutputDataDir());
+
+            // log info
+            log.info("Command = " + buildCommand(cmdList));
+            for (String key : nv.keySet()) {
+                log.info("Env[" + key + "] = " + nv.get(key));
+            }
+
+            // notify start
+            DurationObj compObj = notifier.computationStarted();
+
+            /*
+             * Create ssh connection
+             */
+            ssh.loadKnownHosts();
+            ssh.connect(model.getHost());
+            ssh.authPublickey(privateKeyFilePath);
+
+            final Session session = ssh.startSession();
+            try {
+                /*
+                 * Build working Directory
+                 */
+                log.info("WorkingDir = " + model.getWorkingDir());
+                session.exec("mkdir -p " + model.getWorkingDir());
+                session.exec("cd " + model.getWorkingDir());
+
+                /*
+                 * Set environment
+                 */
+                for (String key : nv.keySet()) {
+                    session.setEnvVar(key, nv.get(key));
+                }
+
+                /*
+                 * Execute
+                 */
+                Command cmd = session.exec(command);
+                log.info("stdout=" + GfacUtils.readFromStream(session.getInputStream()));
+                cmd.join(5, TimeUnit.SECONDS);
+
+                // notify end
+                notifier.computationFinished(compObj);
+
+                /*
+                 * check return value. usually not very helpful to draw conclusions based on return values so don't
+                 * bother. just provide warning in the log messages
+                 */
+                if (cmd.getExitStatus() != 0) {
+                    log.error("Process finished with non zero return value. Process may have failed");
+                } else {
+                    log.info("Process finished with return value of zero.");
+                }
+
+                File logDir = new File("./service_logs");
+                if (!logDir.exists()) {
+                    logDir.mkdir();
+                }
+
+                // Get the Stdouts and StdErrs
+                QName x = QName.valueOf(invocationContext.getServiceName());
+                String timeStampedServiceName = GfacUtils.createServiceDirName(x);
+                File localStdOutFile = new File(logDir, timeStampedServiceName + ".stdout");
+                File localStdErrFile = new File(logDir, timeStampedServiceName + ".stderr");
+
+                SCPFileTransfer fileTransfer = ssh.newSCPFileTransfer();
+                fileTransfer.download(model.getStdOut(), localStdOutFile.getAbsolutePath());
+                fileTransfer.download(model.getStderr(), localStdErrFile.getAbsolutePath());
+
+                context.getExecutionModel().setStdoutStr(GfacUtils.readFile(localStdOutFile.getAbsolutePath()));
+                context.getExecutionModel().setStderrStr(GfacUtils.readFile(localStdErrFile.getAbsolutePath()));
+
+                // set to context
+                OutputUtils.fillOutputFromStdout(invocationContext.getMessageContext("output"), context
+                        .getExecutionModel().getStdoutStr(), context.getExecutionModel().getStderrStr());
+
+            } catch (Exception e) {
+                throw e;
+            } finally {
+                try {
+                    session.close();
+                } catch (Exception e) {
+                }
+            }
+        } catch (Exception e) {
+            throw new GfacException(e.getMessage(), e);
+        } finally {
+            try {
+                ssh.disconnect();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    @Override
+    public void dispose(InvocationContext invocationContext) throws GfacException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void abort(InvocationContext invocationContext) throws GfacException {
+        // TODO Auto-generated method stub
+
+    }
+
+    private List<Instance> startInstances(AmazonEC2Client ec2, String AMI_ID, String INS_TYPE,
+            NotificationService notifier) throws AmazonServiceException {
+        // start only 1 instance
+        RunInstancesRequest request = new RunInstancesRequest(AMI_ID, 1, 1);
+        request.setKeyName(KEY_PAIR_NAME);
+        request.setInstanceType(INS_TYPE);
+
+        RunInstancesResult result = ec2.runInstances(request);
+
+        List<Instance> instances = result.getReservation().getInstances();
+
+        while (!allInstancesStateEqual(instances, InstanceStateName.Running)) {
+
+            // instance status should not be Terminated
+            if (anyInstancesStateEqual(instances, InstanceStateName.Terminated)) {
+                throw new AmazonClientException("Some Instance is terminated before running a job");
+            }
+
+            // notify the status
+            for (Instance ins : instances) {
+                notifier.info("EC2 Instance " + ins.getInstanceId() + " is " + ins.getState().getName().toString());
+            }
+
+            try {
+                Thread.sleep(SLEEP_TIME_SECOND * 1000l);
+            } catch (Exception ex) {
+                // no op
+            }
+
+            DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
+            describeInstancesRequest.setInstanceIds(getInstanceIDs(instances));
+
+            DescribeInstancesResult describeInstancesResult = ec2.describeInstances(describeInstancesRequest);
+            instances = describeInstancesResult.getReservations().get(0).getInstances();
+        }
+
+        log.info("All instances is running");
+        return instances;
+    }
+
+    private void buildKeyPair(AmazonEC2Client ec2) throws NoSuchAlgorithmException, InvalidKeySpecException,
+            AmazonServiceException, AmazonClientException, IOException {
+
+        boolean newKey = false;
+
+        File privateKeyFile = new File(privateKeyFilePath);
+        File publicKeyFile = new File(privateKeyFilePath + ".pub");
+
+        /*
+         * Check if Keypair already created on the server
+         */
+        if (!privateKeyFile.exists()) {
+
+            // check folder and create if it does not exist
+            File sshDir = new File(System.getProperty("user.home") + "/.ssh/");
+            if (!sshDir.exists())
+                sshDir.mkdir();
+
+            // Generate a 1024-bit RSA key pair
+            KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
+            keyGen.initialize(1024);
+            KeyPair keypair = keyGen.genKeyPair();
+
+            FileOutputStream fos = null;
+
+            // Store Public Key.
+            try {
+                fos = new FileOutputStream(privateKeyFilePath + ".pub");
+                fos.write(Base64.encodeBytes(keypair.getPublic().getEncoded()).getBytes());
+            } catch (IOException ioe) {
+                throw ioe;
+            } finally {
+                if (fos != null) {
+                    try {
+                        fos.close();
+                        fos = null;
+                    } catch (IOException ioe) {
+                        throw ioe;
+                    }
+                }
+            }
+
+            // Store Private Key.
+            try {
+                fos = new FileOutputStream(privateKeyFilePath);
+                StringWriter stringWriter = new StringWriter();
+
+                /*
+                 * Write in PEM format (openssl support)
+                 */
+                PEMWriter pemFormatWriter = new PEMWriter(stringWriter);
+                pemFormatWriter.writeObject(keypair.getPrivate());
+                pemFormatWriter.close();
+                fos.write(stringWriter.toString().getBytes());
+            } catch (IOException ioe) {
+                throw ioe;
+            } finally {
+                if (fos != null) {
+                    try {
+                        fos.close();
+                        fos = null;
+                    } catch (IOException ioe) {
+                        throw ioe;
+                    }
+                }
+            }
+
+            privateKeyFile.setWritable(false, false);
+            privateKeyFile.setExecutable(false, false);
+            privateKeyFile.setReadable(false, false);
+            privateKeyFile.setReadable(true);
+            privateKeyFile.setWritable(true);
+
+            // set that this key is just created
+            newKey = true;
+        }
+
+        /*
+         * Read Public Key
+         */
+        String encodedPublicKey = null;
+        BufferedReader br = null;
+        try {
+            br = new BufferedReader(new FileReader(publicKeyFile));
+            encodedPublicKey = br.readLine();
+        } catch (IOException ioe) {
+            throw ioe;
+        } finally {
+            if (br != null) {
+                try {
+                    br.close();
+                    br = null;
+                } catch (IOException ioe) {
+                    throw ioe;
+                }
+            }
+        }
+
+        /*
+         * Generate key pair in Amazon if necessary
+         */
+        try {
+            /*
+             * Get current key pair in Amazon
+             */
+            DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
+            ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(KEY_PAIR_NAME));
+
+            /*
+             * If key exists and new key is created, delete old key and replace with new one. Else, do nothing
+             */
+
+            if (newKey) {
+                DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(KEY_PAIR_NAME);
+                ec2.deleteKeyPair(deleteKeyPairRequest);
+                ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
+                ec2.importKeyPair(importKeyPairRequest);
+            }
+
+        } catch (AmazonServiceException ase) {
+            /*
+             * Key doesn't exists, import new key.
+             */
+            if (ase.getErrorCode().equals("InvalidKeyPair.NotFound")) {
+                ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
+                ec2.importKeyPair(importKeyPairRequest);
+            } else {
+                throw ase;
+            }
+        }
+    }
+
+    private boolean anyInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
+        for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
+            Instance instance = (Instance) iterator.next();
+
+            // if one of instance is not running, return false
+            if (InstanceStateName.fromValue(instance.getState().getName()) == name) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean allInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
+        for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
+            Instance instance = (Instance) iterator.next();
+
+            // if one of instance is not running, return false
+            if (InstanceStateName.fromValue(instance.getState().getName()) != name) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private List<String> getInstanceIDs(List<Instance> instances) {
+        List<String> ret = new ArrayList<String>();
+        for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
+            Instance instance = (Instance) iterator.next();
+            ret.add(instance.getInstanceId());
+        }
+        return ret;
+    }
 }



Mime
View raw message