gov.nasa.pds.report.logs.pushpull
Class PDSPullImpl

java.lang.Object
  extended by gov.nasa.pds.report.logs.pushpull.PDSPullImpl
All Implemented Interfaces:
PDSPull

public class PDSPullImpl
extends Object
implements PDSPull

Utility that provides all SFTP connection functionality

Author:
jpadams

Field Summary
protected  String logDestBase
           
protected  com.jcraft.jsch.Session session
           
protected  com.jcraft.jsch.ChannelSftp sftpChannel
           
 
Constructor Summary
PDSPullImpl()
           
 
Method Summary
 boolean connect(String hostname, String username, String password, boolean encrypted)
          Connects to external machine using SFTP.
 void disconnect()
          Disconnect SFTP and the session
 void pull(String path, String destination)
          Retrieve the logs using the specified login information and host
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected com.jcraft.jsch.Session session

sftpChannel

protected com.jcraft.jsch.ChannelSftp sftpChannel

logDestBase

protected String logDestBase
Constructor Detail

PDSPullImpl

public PDSPullImpl()
Method Detail

connect

public boolean connect(String hostname,
                       String username,
                       String password,
                       boolean encrypted)
                throws PushPullException
Connects to external machine using SFTP. If encrypted, same encryption as PBEEncryptor expected.

Specified by:
connect in interface PDSPull
Parameters:
hostname -
username -
password - password to external machine
encrypted - tells whether or not the password is encrypted
Returns:
whether or not the connection was successful
Throws:
PushPullException
com.jcraft.jsch.JSchException

disconnect

public void disconnect()
Disconnect SFTP and the session

Specified by:
disconnect in interface PDSPull

pull

public final void pull(String path,
                       String destination)
                throws PushPullException
Retrieve the logs using the specified login information and host

Specified by:
pull in interface PDSPull
Throws:
PushPullException


Copyright © 2010–2014 Planetary Data System. All rights reserved.