| 
      
      
      From: <ha...@us...> - 2006-10-07 01:16:34
       | 
| Revision: 874
          http://svn.sourceforge.net/cogkit/?rev=874&view=rev
Author:   hategan
Date:     2006-10-06 18:16:27 -0700 (Fri, 06 Oct 2006)
Log Message:
-----------
textual GRAM errors
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-06 23:29:15 UTC (rev 873)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-07 01:16:27 UTC (rev 874)
@@ -1,3 +1,7 @@
+(10/06/2006)
+
+*** Use textual GRAM messages instead of the error code
+
 (04/12/2006)
 
 *** Limited delegation is now the default
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2006-10-06 23:29:15 UTC (rev 873)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2006-10-07 01:16:27 UTC (rev 874)
@@ -410,7 +410,7 @@
                 newStatus.setPrevStatusCode(oldStatus.getStatusCode());
                 newStatus.setStatusCode(Status.FAILED);
                 int errorCode = job.getError();
-                Exception e = new Exception("Error code: " + errorCode);
+                Exception e = new GramException(errorCode);
                 newStatus.setException(e);
                 this.task.setStatus(newStatus);
                 break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2006-10-09 14:45:30
       | 
| Revision: 879
          http://svn.sourceforge.net/cogkit/?rev=879&view=rev
Author:   hategan
Date:     2006-10-09 07:45:15 -0700 (Mon, 09 Oct 2006)
Log Message:
-----------
use JGlobus RSL classes to build the RSL
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-07 15:49:11 UTC (rev 878)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-09 14:45:15 UTC (rev 879)
@@ -1,3 +1,8 @@
+(10/09/2006)
+
+*** Use JGlobus RSL classes to construct the RSL in a structured way. 
+	This does proper quoting and possibly eliminates other errors.
+
 (10/06/2006)
 
 *** Use textual GRAM messages instead of the error code
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2006-10-07 15:49:11 UTC (rev 878)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2006-10-09 14:45:15 UTC (rev 879)
@@ -7,8 +7,8 @@
 package org.globus.cog.abstraction.impl.execution.gt2;
 
 import java.util.Collection;
-import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Vector;
 
@@ -30,10 +30,14 @@
 import org.globus.io.gass.server.GassServer;
 import org.globus.io.gass.server.JobOutputListener;
 import org.globus.io.gass.server.JobOutputStream;
+import org.globus.rsl.Binding;
+import org.globus.rsl.Bindings;
+import org.globus.rsl.ListRslNode;
 import org.globus.rsl.NameOpValue;
 import org.globus.rsl.RSLParser;
 import org.globus.rsl.RslNode;
 import org.globus.rsl.Value;
+import org.globus.rsl.VarRef;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
 
@@ -262,10 +266,10 @@
 
     private String prepareSpecification(JobSpecification spec)
             throws IllegalSpecException, TaskSubmissionException {
+        ListRslNode rsl = new ListRslNode(RslNode.AND);
         if (spec.getSpecification() != null) {
             return spec.getSpecification();
         } else {
-            StringBuffer buf = new StringBuffer("&");
             boolean batchJob = spec.isBatchJob();
             boolean redirected = spec.isRedirected();
             boolean localExecutable = spec.isLocalExecutable();
@@ -279,98 +283,121 @@
             if (redirected || localExecutable || localInput) {
                 this.startGassServer = true;
                 String gassURL = startGassServer();
-                appendRSL(buf, "rsl_substitution", "(GLOBUSRUN_GASS_URL "
-                        + gassURL + ")");
+                Bindings subst = new Bindings("rsl_substitution");
+                subst.add(new Binding("GLOBUSRUN_GASS_URL", gassURL));
+                rsl.add(subst);
             }
             // sets the executable
-            if (this.startGassServer && localExecutable) {
-                appendRSL(buf, "executable", "$(GLOBUSRUN_GASS_URL)"
-                        + spec.getExecutable());
+            if (spec.getExecutable() != null) {
+                if (this.startGassServer && localExecutable) {
+                    rsl.add(new NameOpValue("executable", NameOpValue.EQ,
+                            new VarRef("GLOBUSRUN_GASS_URL", null, new Value(
+                                    spec.getExecutable()))));
+                } else {
+                    rsl.add(new NameOpValue("executable", NameOpValue.EQ, spec
+                            .getExecutable()));
+                }
             } else {
-                appendRSL(buf, "executable", spec.getExecutable());
+                throw new IllegalSpecException("Missing executable");
             }
+
             // sets other parameters
-            appendRSL(buf, "arguments", spec.getArgumentsAsString());
-            appendRSL(buf, "directory", spec.getDirectory());
+            NameOpValue args = new NameOpValue("arguments", NameOpValue.EQ);
+            if (!spec.getArgumentsAsList().isEmpty()) {
+                List arglist = new LinkedList();
+                Iterator i = spec.getArgumentsAsList().iterator();
+                while (i.hasNext()) {
+                    arglist.add(new Value((String) i.next()));
+                }
+                args.add(arglist);
+                rsl.add(args);
+            }
 
-            Collection environment = spec.getEnvironment();
+            if (spec.getDirectory() != null) {
+                rsl.add(new NameOpValue("directory", NameOpValue.EQ, spec
+                        .getDirectory()));
+            }
+
+            Collection environment = spec.getEnvironmentVariableNames();
             if (environment.size() > 0) {
-                String env = "";
+                NameOpValue env = new NameOpValue("environment", NameOpValue.EQ);
                 Iterator iterator = environment.iterator();
                 while (iterator.hasNext()) {
                     String name = (String) iterator.next();
                     String value = spec.getEnvironmentVariable(name);
-                    env += "(" + name + " " + value + ")";
+                    System.err.println(value);
+                    List l = new LinkedList();
+                    l.add(new Value(name));
+                    l.add(new Value(value));
+                    env.add(l);
                 }
-                appendRSL(buf, "environment", env);
+                rsl.add(env);
             }
 
             // sets the stdin
-            if (this.startGassServer && localInput) {
-                appendRSL(buf, "stdin", "$(GLOBUSRUN_GASS_URL)"
-                        + spec.getStdInput());
-            } else {
-                appendRSL(buf, "stdin", spec.getStdInput());
+            if (spec.getStdInput() != null) {
+                if (this.startGassServer && localInput) {
+                    rsl.add(new NameOpValue("stdin", NameOpValue.EQ,
+                            new VarRef("GLOBUSRUN_GASS_URL", null, new Value(
+                                    spec.getStdInput()))));
+                } else {
+                    rsl.add(new NameOpValue("stdin", NameOpValue.EQ, spec
+                            .getStdInput()));
+                }
             }
 
             // if output is to be redirected
             if (this.startGassServer && redirected) {
+                Value v;
                 // if no output file is specified, use the stdout
                 if ((spec.getStdOutput() == null)
                         || (spec.getStdOutput().equals(""))) {
-                    appendRSL(buf, "stdout",
-                            "$(GLOBUSRUN_GASS_URL)/dev/stdout-"
-                                    + this.task.getIdentity().toString());
+                    v = new Value("/dev/stdout-"
+                            + this.task.getIdentity().toString());
                 } else {
-                    appendRSL(buf, "stdout", "$(GLOBUSRUN_GASS_URL)/"
-                            + spec.getStdOutput());
+                    v = new Value(spec.getStdOutput());
                 }
-            } else {
+                rsl.add(new NameOpValue("stdout", NameOpValue.EQ, new VarRef(
+                        "GLOBUSRUN_GASS_URL", null, v)));
+            } else if (spec.getStdOutput() != null) {
                 // output on the remote machine
-                appendRSL(buf, "stdout", spec.getStdOutput());
+                rsl.add(new NameOpValue("stdout", NameOpValue.EQ, spec
+                        .getStdOutput()));
             }
             // if error is to be redirected
             if (this.startGassServer && redirected) {
+                Value v;
                 // if no error file is specified, use the stdout
                 if ((spec.getStdError() == null)
                         || (spec.getStdError().equals(""))) {
-                    appendRSL(buf, "stderr",
-                            "$(GLOBUSRUN_GASS_URL)/dev/stderr-"
-                                    + this.task.getIdentity().toString());
+                    v = new Value("/dev/stderr-"
+                            + this.task.getIdentity().toString());
                 } else {
-                    appendRSL(buf, "stderr", "$(GLOBUSRUN_GASS_URL)/"
-                            + spec.getStdError());
+                    v = new Value(spec.getStdError());
                 }
-            } else {
+                rsl.add(new NameOpValue("stderr", NameOpValue.EQ, new VarRef(
+                        "GLOBUSRUN_GASS_URL", null, v)));
+            } else if (spec.getStdError() != null) {
                 // error on the remote machine
-                appendRSL(buf, "stderr", spec.getStdError());
+                rsl.add(new NameOpValue("stderr", NameOpValue.EQ, spec
+                        .getStdError()));
             }
 
-            Enumeration en = spec.getAllAttributes();
-            while (en.hasMoreElements()) {
+            Iterator i = spec.getAttributeNames().iterator();
+            while (i.hasNext()) {
                 try {
-                    String key = (String) en.nextElement();
-                    appendRSL(buf, key, (String) spec.getAttribute(key));
+                    String key = (String) i.next();
+                    rsl.add(new NameOpValue(key, NameOpValue.EQ, (String) spec
+                            .getAttribute(key)));
                 } catch (Exception e) {
                     throw new IllegalSpecException(
                             "Cannot parse the user defined attributes");
                 }
             }
-            return buf.toString();
+            return rsl.toString();
         }
     }
 
-    private void appendRSL(StringBuffer rsl, String attribute, String value) {
-        if (value == null || value.length() == 0) {
-            return;
-        }
-        rsl.append("(");
-        rsl.append(attribute);
-        rsl.append("=");
-        rsl.append(value);
-        rsl.append(")");
-    }
-
     private String startGassServer() throws TaskSubmissionException {
         GlobusSecurityContextImpl securityContext = (GlobusSecurityContextImpl) this.task
                 .getService(0).getSecurityContext();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2006-12-22 23:18:25
       | 
| Revision: 1489
          http://svn.sourceforge.net/cogkit/?rev=1489&view=rev
Author:   hategan
Date:     2006-12-22 15:18:24 -0800 (Fri, 22 Dec 2006)
Log Message:
-----------
updated version, changelog
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/project.properties
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-12-22 23:17:07 UTC (rev 1488)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-12-22 23:18:24 UTC (rev 1489)
@@ -1,3 +1,5 @@
+-------------------------------2.3----------------------------------
+
 (11/28/2006)
 
 *** Cleaned up the file resource implementations
Modified: trunk/current/src/cog/modules/provider-gt2/project.properties
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/project.properties	2006-12-22 23:17:07 UTC (rev 1488)
+++ trunk/current/src/cog/modules/provider-gt2/project.properties	2006-12-22 23:18:24 UTC (rev 1489)
@@ -1,6 +1,6 @@
 module.name 		= provider-gt2
 long.name 		= GT2 Provider for Java CoG Kit abstractions
-version			= 2.2
+version			= 2.3
 project			= Java CoG Kit
 lib.deps		= -
 debug			= true
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-08-20 22:25:50
       | 
| Revision: 1690
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1690&view=rev
Author:   hategan
Date:     2007-08-20 15:25:48 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
updated redirection stuff
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-08-20 22:24:33 UTC (rev 1689)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-08-20 22:25:48 UTC (rev 1690)
@@ -1,3 +1,7 @@
+(08/20/2007)
+
+*** Updated to use the new redirection stuff
+
 (08/10/2007)
 
 *** Removed a puzzling thing. Seems like most put/get methods in
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2007-08-20 22:24:33 UTC (rev 1689)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2007-08-20 22:25:48 UTC (rev 1690)
@@ -20,6 +20,7 @@
 import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
 import org.globus.cog.abstraction.interfaces.DelegatedTaskHandler;
 import org.globus.cog.abstraction.interfaces.Delegation;
+import org.globus.cog.abstraction.interfaces.FileLocation;
 import org.globus.cog.abstraction.interfaces.JobSpecification;
 import org.globus.cog.abstraction.interfaces.ServiceContact;
 import org.globus.cog.abstraction.interfaces.Status;
@@ -301,16 +302,18 @@
         }
         else {
             boolean batchJob = spec.isBatchJob();
-            boolean redirected = spec.isRedirected();
-            boolean localExecutable = spec.isLocalExecutable();
-            boolean localInput = spec.isLocalInput();
+            boolean redirected = spec.getStdOutputLocation().overlaps(
+                    FileLocation.MEMORY_AND_LOCAL)
+                    || spec.getStdErrorLocation().overlaps(FileLocation.MEMORY_AND_LOCAL);
 
             if (batchJob && redirected) {
                 throw new IllegalSpecException(
                         "Cannot redirect the output/error of a batch job");
             }
 
-            if (redirected || localExecutable || localInput) {
+            if (redirected
+                    || FileLocation.LOCAL.equals(spec.getStdInputLocation())
+                    || FileLocation.LOCAL.equals(spec.getExecutableLocation())) {
                 this.startGassServer = true;
                 String gassURL = startGassServer();
                 Bindings subst = new Bindings("rsl_substitution");
@@ -319,7 +322,7 @@
             }
             // sets the executable
             if (spec.getExecutable() != null) {
-                if (this.startGassServer && localExecutable) {
+                if (FileLocation.LOCAL.equals(spec.getExecutableLocation())) {
                     rsl.add(new NameOpValue("executable", NameOpValue.EQ,
                             new VarRef("GLOBUSRUN_GASS_URL", null, new Value(
                                     fixAbsPath(spec.getExecutable())))));
@@ -366,7 +369,7 @@
 
             // sets the stdin
             if (spec.getStdInput() != null) {
-                if (this.startGassServer && localInput) {
+                if (FileLocation.LOCAL.equals(spec.getStdInputLocation())) {
                     rsl.add(new NameOpValue("stdin", NameOpValue.EQ,
                             new VarRef("GLOBUSRUN_GASS_URL", null, new Value(
                                     fixAbsPath(spec.getStdInput())))));
@@ -378,11 +381,10 @@
             }
 
             // if output is to be redirected
-            if (this.startGassServer && redirected) {
+            if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec.getStdOutputLocation())) {
                 Value v;
                 // if no output file is specified, use the stdout
-                if ((spec.getStdOutput() == null)
-                        || (spec.getStdOutput().equals(""))) {
+                if (FileLocation.MEMORY.overlaps(spec.getStdOutputLocation())) {
                     v = new Value("/dev/stdout-"
                             + this.task.getIdentity().toString());
                 }
@@ -398,11 +400,10 @@
                         .getStdOutput()));
             }
             // if error is to be redirected
-            if (this.startGassServer && redirected) {
+            if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec.getStdErrorLocation())) {
                 Value v;
                 // if no error file is specified, use the stdout
-                if ((spec.getStdError() == null)
-                        || (spec.getStdError().equals(""))) {
+                if (FileLocation.MEMORY.overlaps(spec.getStdErrorLocation())) {
                     v = new Value("/dev/stderr-"
                             + this.task.getIdentity().toString());
                 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-10-03 16:12:39
       | 
| Revision: 1773
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1773&view=rev
Author:   hategan
Date:     2007-10-03 09:12:31 -0700 (Wed, 03 Oct 2007)
Log Message:
-----------
fixed callback issue
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-10-02 21:27:33 UTC (rev 1772)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-10-03 16:12:31 UTC (rev 1773)
@@ -1,3 +1,8 @@
+(10/03/2007)
+
+*** Fixed some issues with the credentials used for the callback
+    handler.
+
 (08/20/2007)
 
 *** Updated to use the new redirection stuff
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2007-10-02 21:27:33 UTC (rev 1772)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java	2007-10-03 16:12:31 UTC (rev 1773)
@@ -22,6 +22,7 @@
 import org.globus.cog.abstraction.interfaces.Delegation;
 import org.globus.cog.abstraction.interfaces.FileLocation;
 import org.globus.cog.abstraction.interfaces.JobSpecification;
+import org.globus.cog.abstraction.interfaces.SecurityContext;
 import org.globus.cog.abstraction.interfaces.ServiceContact;
 import org.globus.cog.abstraction.interfaces.Status;
 import org.globus.cog.abstraction.interfaces.Task;
@@ -40,8 +41,10 @@
 import org.globus.rsl.RslNode;
 import org.globus.rsl.Value;
 import org.globus.rsl.VarRef;
+import org.gridforum.jgss.ExtendedGSSManager;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
+import org.ietf.jgss.GSSManager;
 
 public class JobSubmissionTaskHandler implements DelegatedTaskHandler,
         GramJobListener, JobOutputListener {
@@ -52,8 +55,10 @@
     private Vector jobList = null;
     private boolean startGassServer = false;
     private GassServer gassServer = null;
+    private SecurityContext securityContext;
     private JobOutputStream stdoutStream;
     private JobOutputStream stderrStream;
+    private GSSCredential credential;
 
     public void submit(Task task) throws IllegalSpecException,
             InvalidSecurityContextException, InvalidServiceContactException,
@@ -63,6 +68,8 @@
                     "JobSubmissionTaskHandler cannot handle two active jobs simultaneously");
         }
         this.task = task;
+        this.securityContext = getSecurityContext(task);
+        this.credential = (GSSCredential) securityContext.getCredentials();
         String rsl;
         JobSpecification spec;
         try {
@@ -97,10 +104,8 @@
             throws IllegalSpecException, InvalidSecurityContextException,
             InvalidServiceContactException, TaskSubmissionException {
         this.gramJob = new GramJob(rsl);
-        GlobusSecurityContextImpl securityContext = getSecurityContext();
         try {
-            this.gramJob.setCredentials((GSSCredential) securityContext
-                    .getCredentials());
+            this.gramJob.setCredentials(this.credential);
         }
         catch (IllegalArgumentException iae) {
             throw new InvalidSecurityContextException(
@@ -108,7 +113,7 @@
         }
 
         if (!spec.isBatchJob()) {
-            CallbackHandlerManager.increaseUsageCount(gramJob.getCredentials());
+            CallbackHandlerManager.increaseUsageCount(this.credential);
             this.gramJob.addListener(this);
         }
 
@@ -125,7 +130,7 @@
         if (logger.isDebugEnabled()) {
             logger.debug("Execution server: " + server);
         }
-        boolean limitedDeleg = (securityContext.getDelegation() != Delegation.FULL_DELEGATION);
+        boolean limitedDeleg = isLimitedDelegation(this.securityContext);
         if (spec.getDelegation() == Delegation.FULL_DELEGATION) {
             limitedDeleg = false;
         }
@@ -154,6 +159,15 @@
                     gsse);
         }
     }
+    
+    private boolean isLimitedDelegation(SecurityContext sc) {
+        if (sc instanceof GlobusSecurityContextImpl) {
+            return ((GlobusSecurityContextImpl) securityContext).getDelegation() != Delegation.FULL_DELEGATION; 
+        }
+        else {
+            return true;
+        }
+    }
 
     private void submitMultipleJobs(RslNode rslTree, JobSpecification spec)
             throws IllegalSpecException, InvalidSecurityContextException,
@@ -192,18 +206,15 @@
 
         job.addListener(listener);
 
-        GlobusSecurityContextImpl securityContext = getSecurityContext();
         try {
-            job
-                    .setCredentials((GSSCredential) securityContext
-                            .getCredentials());
+            job.setCredentials(this.credential);
         }
         catch (IllegalArgumentException iae) {
             throw new InvalidSecurityContextException(
                     "Cannot set the SecurityContext twice", iae);
         }
 
-        boolean limitedDeleg = (securityContext.getDelegation() == GlobusSecurityContextImpl.PARTIAL_DELEGATION);
+        boolean limitedDeleg = isLimitedDelegation(this.securityContext);
         try {
             job.request(rmc, false, limitedDeleg);
             if (logger.isDebugEnabled()) {
@@ -422,8 +433,7 @@
 
         try {
             this.gassServer = GassServerFactory
-                    .getGassServer((GSSCredential) securityContext
-                            .getCredentials());
+                    .getGassServer(this.credential);
             this.gassServer.registerDefaultDeactivator();
         }
         catch (Exception e) {
@@ -479,7 +489,7 @@
     private synchronized void cleanup() {
         try {
             this.gramJob.removeListener(this);
-            CallbackHandlerManager.decreaseUsageCount(gramJob.getCredentials());
+            CallbackHandlerManager.decreaseUsageCount(this.credential);
             if (gassServer != null) {
                 GassServerFactory.decreaseUsageCount(gassServer);
             }
@@ -503,14 +513,20 @@
     public void outputClosed() {
     }
 
-    private GlobusSecurityContextImpl getSecurityContext() {
-        GlobusSecurityContextImpl securityContext = (GlobusSecurityContextImpl) this.task
-                .getService(0).getSecurityContext();
-        if (securityContext == null) {
+    private SecurityContext getSecurityContext(Task task) throws InvalidSecurityContextException {
+        SecurityContext sc = task.getService(0).getSecurityContext();
+        if (sc == null) {
             // create default credentials
-            securityContext = new GlobusSecurityContextImpl();
+            sc = new GlobusSecurityContextImpl();
+            GSSManager manager = ExtendedGSSManager.getInstance();
+            try {
+                sc.setCredentials(manager.createCredential(GSSCredential.INITIATE_AND_ACCEPT));
+            }
+            catch (GSSException e) {
+                throw new InvalidSecurityContextException(e);
+            }
         }
-        return securityContext;
+        return sc;
     }
 
     private String handleJobManager(String server, String jobmanager)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-12-03 17:47:03
       | 
| Revision: 1850
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1850&view=rev
Author:   hategan
Date:     2007-12-03 09:47:00 -0800 (Mon, 03 Dec 2007)
Log Message:
-----------
data channel reuse
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-11-30 19:47:29 UTC (rev 1849)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2007-12-03 17:47:00 UTC (rev 1850)
@@ -1,3 +1,9 @@
+(12/03/2007)
+
+*** Added data channel reuse mode for GridFTP if the server
+    version is 2.3. Presumably more versions support this and
+    they should eventually be added.
+
 (10/30/2007)
 
 *** Added totalSize implementation to data sources such that 
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java	2007-11-30 19:47:29 UTC (rev 1849)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/GlobusSecurityContextImpl.java	2007-12-03 17:47:00 UTC (rev 1850)
@@ -19,7 +19,7 @@
     public void setAuthorization(Authorization authorization) {
         setAttribute("authorization", authorization);
     }
-
+    
     public Authorization getAuthorization() {
         Authorization authorization = (Authorization) getAttribute("authorization");
         if (authorization == null) {
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2007-11-30 19:47:29 UTC (rev 1849)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2007-12-03 17:47:00 UTC (rev 1850)
@@ -49,7 +49,9 @@
 import org.globus.ftp.MarkerListener;
 import org.globus.ftp.MlsxEntry;
 import org.globus.ftp.Session;
+import org.globus.ftp.exception.ClientException;
 import org.globus.ftp.exception.ServerException;
+import org.globus.ftp.vanilla.Reply;
 import org.ietf.jgss.GSSCredential;
 
 /**
@@ -67,6 +69,8 @@
     public static final int MAX_REPLY_WAIT_TIME = 30000; // ms
 
     private GridFTPClient gridFTPClient;
+    private boolean dataChannelReuse;
+    private boolean dataChannelInitialized;
 
     /** throws InvalidProviderException */
     public FileResourceImpl() throws Exception {
@@ -96,12 +100,21 @@
                 port = 2811;
             }
             gridFTPClient = new GridFTPClient(host, port);
+            Reply r = gridFTPClient.getLastReply();
+
+            if (r != null && r.getMessage().indexOf("GridFTP Server 2.3") != -1) {
+                dataChannelReuse = true;
+                logger.debug("GridFTP version is 2.3. Enabling data channel reuse.");
+            }
             gridFTPClient.setClientWaitParams(MAX_REPLY_WAIT_TIME,
                     Session.DEFAULT_WAIT_DELAY);
             GSSCredential proxy = (GSSCredential) getSecurityContext()
                     .getCredentials();
             gridFTPClient.authenticate(proxy);
             gridFTPClient.setType(Session.TYPE_IMAGE);
+            if (dataChannelReuse) {
+                gridFTPClient.setMode(GridFTPSession.MODE_EBLOCK);
+            }
             setSecurityOptions(gridFTPClient);
 
             setStarted(true);
@@ -112,6 +125,14 @@
         }
     }
 
+    private void initializeDataChannel() throws ClientException,
+            ServerException, IOException {
+        if (!dataChannelInitialized || !dataChannelReuse) {
+            gridFTPClient.setPassiveMode(true);
+            dataChannelInitialized = true;
+        }
+    }
+
     protected void setSecurityOptions(GridFTPClient client)
             throws ServerException, IOException {
         DataChannelAuthenticationType dcau = GridFTPSecurityContext
@@ -193,7 +214,7 @@
 
         Vector gridFileList = new Vector();
         try {
-            gridFTPClient.setPassiveMode(true);
+            this.initializeDataChannel();
             Enumeration list = gridFTPClient.list().elements();
             while (list.hasMoreElements()) {
                 gridFileList.add(createGridFile((FileInfo) list.nextElement()));
@@ -288,7 +309,7 @@
     public void get(String remoteFileName, DataSink sink,
             MarkerListener mListener) throws FileResourceException {
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             gridFTPClient.get(remoteFileName, sink, mListener);
         }
         catch (Exception e) {
@@ -300,7 +321,7 @@
     public void get(String remoteFileName, File localFile)
             throws FileResourceException {
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             gridFTPClient.get(remoteFileName, localFile);
         }
         catch (Exception e) {
@@ -320,7 +341,7 @@
             final ProgressMonitor progressMonitor) throws FileResourceException {
         File localFile = new File(localFileName);
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             final long size = localFile.length();
             DataSink sink;
             if (progressMonitor != null) {
@@ -353,7 +374,7 @@
 
         final File localFile = new File(localFileName);
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             final long size = localFile.length();
             DataSource source;
             if (progressMonitor != null) {
@@ -362,7 +383,7 @@
                         progressMonitor.progress(totalRead, size);
                         return super.read();
                     }
-                    
+
                     public long totalSize() {
                         return localFile.length();
                     }
@@ -387,7 +408,7 @@
             throws FileResourceException {
 
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             gridFTPClient.put(localFile, remoteFileName, append);
         }
         catch (Exception e) {
@@ -403,7 +424,7 @@
     public void put(DataSource source, String remoteFileName,
             MarkerListener mListener) throws FileResourceException {
         try {
-            gridFTPClient.setPassiveMode(true);
+            initializeDataChannel();
             gridFTPClient.put(remoteFileName, source, mListener);
         }
         catch (Exception e) {
@@ -487,7 +508,8 @@
             return createGridFile(e);
         }
         catch (Exception e) {
-            throw translateException("Failed to retrieve file information about " + fileName, e);
+            throw translateException(
+                    "Failed to retrieve file information about " + fileName, e);
         }
     }
 
@@ -552,7 +574,7 @@
 
         return gridFile;
     }
-    
+
     private GridFile createGridFile(MlsxEntry e) throws FileResourceException {
 
         GridFile gridFile = new GridFileImpl();
@@ -571,7 +593,8 @@
         if (MlsxEntry.TYPE_FILE.equals(type)) {
             gridFile.setFileType(GridFile.FILE);
         }
-        if (MlsxEntry.TYPE_DIR.equals(type) || MlsxEntry.TYPE_PDIR.equals(type) || MlsxEntry.TYPE_CDIR.equals(type)) {
+        if (MlsxEntry.TYPE_DIR.equals(type) || MlsxEntry.TYPE_PDIR.equals(type)
+                || MlsxEntry.TYPE_CDIR.equals(type)) {
             gridFile.setFileType(GridFile.DIRECTORY);
         }
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2008-04-05 13:59:29
       | 
| Revision: 1956
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1956&view=rev
Author:   hategan
Date:     2008-04-05 06:59:25 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
fixed data channel reuse stuff
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-04-04 12:29:00 UTC (rev 1955)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-04-05 13:59:25 UTC (rev 1956)
@@ -1,3 +1,7 @@
+(04/05/2008)
+
+*** Fixed data channel reuse behavior
+
 (02/11/2008)
 
 *** The last commit broke things (mlst seems picky).
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-04-04 12:29:00 UTC (rev 1955)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-04-05 13:59:25 UTC (rev 1956)
@@ -69,7 +69,7 @@
         }
         else {
             try {
-                initializeDataChannel();
+                initializeDataChannel(RETRIEVE);
                 Vector v = this.getGridFTPClient().mlsd();
                 ArrayList list = new ArrayList();
                 Iterator i = v.iterator();
@@ -126,7 +126,7 @@
         }
         else {
             try {
-                initializeDataChannel();
+                initializeDataChannel(RETRIEVE);
                 Vector v = this.getGridFTPClient().mlsd(directory);
                 ArrayList list = new ArrayList();
                 Iterator i = v.iterator();
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2008-04-04 12:29:00 UTC (rev 1955)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2008-04-05 13:59:25 UTC (rev 1956)
@@ -61,6 +61,9 @@
 public class FileResourceImpl extends AbstractFTPFileResource {
     public static final Logger logger = Logger
             .getLogger(FileResourceImpl.class);
+    
+    protected static final boolean STORE = true;
+    protected static final boolean RETRIEVE = false;
 
     /**
      * By default JGlobus sets this to 6000 ms. Experience has proved that it
@@ -71,6 +74,7 @@
     private GridFTPClient gridFTPClient;
     private boolean dataChannelReuse;
     private boolean dataChannelInitialized;
+    private boolean dataChannelDirection;
 
     /** throws InvalidProviderException */
     public FileResourceImpl() throws Exception {
@@ -102,10 +106,18 @@
             gridFTPClient = new GridFTPClient(host, port);
             Reply r = gridFTPClient.getLastReply();
 
-            if (r != null && r.getMessage().indexOf("GridFTP Server 2.3") != -1) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Initial reply: " + r.getMessage());
+            }
+            if (r != null && r.getMessage().indexOf("Virtual Broken GridFTP Server") != -1) {
+                dataChannelReuse = false;
+            }
+            else {
                 dataChannelReuse = true;
-                logger.debug("GridFTP version is 2.3. Enabling data channel reuse.");
             }
+            if (logger.isDebugEnabled()) {
+                logger.debug("Data channel reuse: " + dataChannelReuse);
+            }
             gridFTPClient.setClientWaitParams(MAX_REPLY_WAIT_TIME,
                     Session.DEFAULT_WAIT_DELAY);
             GSSCredential proxy = (GSSCredential) getSecurityContext()
@@ -124,14 +136,28 @@
                     "Error communicating with the GridFTP server", e);
         }
     }
+    
+    public boolean getDataChannelReuse() {
+        return dataChannelReuse;
+    }
+    
+    public void setDataChannelReuse(boolean dataChannelReuse) {
+        this.dataChannelReuse = dataChannelReuse;
+        this.dataChannelInitialized = false;
+    }
 
-    protected void initializeDataChannel() throws ClientException,
+    protected void initializeDataChannel(boolean mode) throws ClientException,
             ServerException, IOException {
-        if (!dataChannelInitialized || !dataChannelReuse) {
-            gridFTPClient.setPassiveMode(true);
+        if (!dataChannelInitialized || !dataChannelReuse || dataChannelDirection != mode) {
+            gridFTPClient.setPassiveMode(mode);
             dataChannelInitialized = true;
+            dataChannelDirection = mode;
         }
     }
+    
+    protected void resetDataChannel() {
+        dataChannelInitialized = false;
+    }
 
     protected void setSecurityOptions(GridFTPClient client)
             throws ServerException, IOException {
@@ -214,7 +240,7 @@
 
         Vector gridFileList = new Vector();
         try {
-            this.initializeDataChannel();
+            this.initializeDataChannel(RETRIEVE);
             Enumeration list = gridFTPClient.list().elements();
             while (list.hasMoreElements()) {
                 gridFileList.add(createGridFile((FileInfo) list.nextElement()));
@@ -309,7 +335,7 @@
     public void get(String remoteFileName, DataSink sink,
             MarkerListener mListener) throws FileResourceException {
         try {
-            initializeDataChannel();
+            initializeDataChannel(RETRIEVE);
             gridFTPClient.get(remoteFileName, sink, mListener);
         }
         catch (Exception e) {
@@ -321,7 +347,7 @@
     public void get(String remoteFileName, File localFile)
             throws FileResourceException {
         try {
-            initializeDataChannel();
+            initializeDataChannel(RETRIEVE);
             gridFTPClient.get(remoteFileName, localFile);
         }
         catch (Exception e) {
@@ -341,7 +367,7 @@
             final ProgressMonitor progressMonitor) throws FileResourceException {
         File localFile = new File(localFileName);
         try {
-            initializeDataChannel();
+            initializeDataChannel(RETRIEVE);
             final long size = localFile.length();
             DataSink sink;
             if (progressMonitor != null) {
@@ -374,7 +400,7 @@
 
         final File localFile = new File(localFileName);
         try {
-            initializeDataChannel();
+            initializeDataChannel(STORE);
             final long size = localFile.length();
             DataSource source;
             if (progressMonitor != null) {
@@ -408,7 +434,7 @@
             throws FileResourceException {
 
         try {
-            initializeDataChannel();
+            initializeDataChannel(STORE);
             gridFTPClient.put(localFile, remoteFileName, append);
         }
         catch (Exception e) {
@@ -424,7 +450,7 @@
     public void put(DataSource source, String remoteFileName,
             MarkerListener mListener) throws FileResourceException {
         try {
-            initializeDataChannel();
+            initializeDataChannel(STORE);
             gridFTPClient.put(remoteFileName, source, mListener);
         }
         catch (Exception e) {
@@ -495,7 +521,7 @@
                 setCurrentDirectory(currentDirectory);
             }
             catch (Exception e) {
-                // do nothihng
+                // do nothing
             }
         }
         return isDir;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2006-10-18 20:56:21
       | 
| Revision: 1014
          http://svn.sourceforge.net/cogkit/?rev=1014&view=rev
Author:   hategan
Date:     2006-10-18 13:56:11 -0700 (Wed, 18 Oct 2006)
Log Message:
-----------
mkdirs() file operation
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-18 20:55:03 UTC (rev 1013)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2006-10-18 20:56:11 UTC (rev 1014)
@@ -1,3 +1,7 @@
+(10/18/2006)
+
+*** Added a mkdirs implementation for the file resource
+
 (10/09/2006)
 
 *** Use JGlobus RSL classes to construct the RSL in a structured way. 
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java	2006-10-18 20:55:03 UTC (rev 1013)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/ftp/FileResourceImpl.java	2006-10-18 20:56:11 UTC (rev 1014)
@@ -24,6 +24,7 @@
 import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
 import org.globus.cog.abstraction.impl.file.DirectoryNotFoundException;
 import org.globus.cog.abstraction.impl.file.FileNotFoundException;
+import org.globus.cog.abstraction.impl.file.FileResourceUtil;
 import org.globus.cog.abstraction.impl.file.GeneralException;
 import org.globus.cog.abstraction.impl.file.GridFileImpl;
 import org.globus.cog.abstraction.impl.file.IllegalHostException;
@@ -243,6 +244,10 @@
             throw new GeneralException("Cannot create the directory", e);
         }
     }
+    
+    public void createDirectories(String directory) throws GeneralException {
+        FileResourceUtil.createDirectories(this, directory);
+    }
 
     /**
      * Remove directory and its files if force = true. Else remove directory
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2006-10-18 20:55:03 UTC (rev 1013)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2006-10-18 20:56:11 UTC (rev 1014)
@@ -23,6 +23,7 @@
 import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
 import org.globus.cog.abstraction.impl.file.DirectoryNotFoundException;
 import org.globus.cog.abstraction.impl.file.FileNotFoundException;
+import org.globus.cog.abstraction.impl.file.FileResourceUtil;
 import org.globus.cog.abstraction.impl.file.GeneralException;
 import org.globus.cog.abstraction.impl.file.GridFileImpl;
 import org.globus.cog.abstraction.impl.file.IllegalHostException;
@@ -283,6 +284,10 @@
             throw new GeneralException("Cannot create the directory", e);
         }
     }
+    
+    public void createDirectories(String directory) throws GeneralException {
+        FileResourceUtil.createDirectories(this, directory);
+    }
 
     /**
      * Remove directory and its files if force = true. Else remove directory
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2008-02-01 18:37:42
       | 
| Revision: 1871
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1871&view=rev
Author:   hategan
Date:     2008-02-01 10:37:39 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
updated list() to reuse data channels
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-01-27 23:42:24 UTC (rev 1870)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-02-01 18:37:39 UTC (rev 1871)
@@ -1,3 +1,7 @@
+(02/01/2008)
+
+*** Missed some spots on the data channel reuse.
+
 (12/03/2007)
 
 *** Added data channel reuse mode for GridFTP if the server
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-01-27 23:42:24 UTC (rev 1870)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-02-01 18:37:39 UTC (rev 1871)
@@ -69,7 +69,7 @@
         }
         else {
             try {
-                this.getGridFTPClient().setPassiveMode(true);
+                initializeDataChannel();
                 Vector v = this.getGridFTPClient().mlsd();
                 ArrayList list = new ArrayList();
                 Iterator i = v.iterator();
@@ -126,7 +126,7 @@
         }
         else {
             try {
-                this.getGridFTPClient().setPassiveMode(true);
+                initializeDataChannel();
                 Vector v = this.getGridFTPClient().mlsd(directory);
                 ArrayList list = new ArrayList();
                 Iterator i = v.iterator();
@@ -155,7 +155,7 @@
              * It's twice as fast as doing a cwd
              */
             try {
-                this.getGridFTPClient().setPassiveMode(false);
+                initializeDataChannel();
                 MlsxEntry me = this.getGridFTPClient().mlst(dirName);
                 return me.get("type").endsWith("dir");
             }
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2008-01-27 23:42:24 UTC (rev 1870)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java	2008-02-01 18:37:39 UTC (rev 1871)
@@ -125,7 +125,7 @@
         }
     }
 
-    private void initializeDataChannel() throws ClientException,
+    protected void initializeDataChannel() throws ClientException,
             ServerException, IOException {
         if (!dataChannelInitialized || !dataChannelReuse) {
             gridFTPClient.setPassiveMode(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2008-02-11 19:27:45
       | 
| Revision: 1875
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1875&view=rev
Author:   hategan
Date:     2008-02-11 11:27:41 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
fixed some channel reuse issues
Modified Paths:
--------------
    trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
    trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-02-06 21:43:25 UTC (rev 1874)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt	2008-02-11 19:27:41 UTC (rev 1875)
@@ -1,3 +1,7 @@
+(02/11/2008)
+
+*** The last commit broke things (mlst seems picky).
+
 (02/01/2008)
 
 *** Missed some spots on the data channel reuse.
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-02-06 21:43:25 UTC (rev 1874)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/FileResourceImpl.java	2008-02-11 19:27:41 UTC (rev 1875)
@@ -24,6 +24,7 @@
 import org.globus.cog.abstraction.interfaces.GridFile;
 import org.globus.cog.abstraction.interfaces.SecurityContext;
 import org.globus.cog.abstraction.interfaces.ServiceContact;
+import org.globus.ftp.GridFTPSession;
 import org.globus.ftp.MlsxEntry;
 import org.globus.ftp.exception.ClientException;
 import org.globus.ftp.exception.ServerException;
@@ -155,7 +156,7 @@
              * It's twice as fast as doing a cwd
              */
             try {
-                initializeDataChannel();
+                this.getGridFTPClient().setPassiveMode(false);
                 MlsxEntry me = this.getGridFTPClient().mlst(dirName);
                 return me.get("type").endsWith("dir");
             }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |