]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/jsch/SshTarget.java
Introduce filtered resources
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.simple / src / main / java / org / argeo / slc / jsch / SshTarget.java
index 17f0426518f2870c1ea94cf13d30b2f31289ba33..2f768894569606edcdfc7fc4e89ca1748ceaa2e2 100644 (file)
@@ -2,6 +2,7 @@ package org.argeo.slc.jsch;
 
 import java.io.File;
 
+import com.jcraft.jsch.Session;
 import com.jcraft.jsch.UserInfo;
 
 public class SshTarget {
@@ -14,6 +15,9 @@ public class SshTarget {
        private File localPrivateKey = new File(System.getProperty("user.home")
                        + File.separator + ".ssh" + File.separator + "id_rsa");
 
+       /** cached session */
+       private Session session;
+
        public String getHost() {
                return host;
        }
@@ -63,6 +67,14 @@ public class SshTarget {
        }
 
        public String toString() {
-               return "ssh:" + getUser() + "@" + getHost() + ":" + getPort();
+               return getUser() + "@" + getHost() + ":" + getPort();
+       }
+
+       public Session getSession() {
+               return session;
+       }
+
+       public void setSession(Session session) {
+               this.session = session;
        }
 }