org.nees.util.grid
Class GridFTPFacade

java.lang.Object
  extended byorg.nees.util.TransferFacade
      extended byorg.nees.util.grid.FTPFacade
          extended byorg.nees.util.grid.GridFTPFacade

public class GridFTPFacade
extends FTPFacade

Provides a simplified GridFTP API. This manages authentication, the creation and destruction of client sessions, and the setting of various options.

Typical Usage:

Used to transfer files to and from a GridFTP server. The credentials to authenticate with are passed into the constructor, or default credentials are assumed. Then, the client can either call getClient() to get an authenticated GridFTP client, or can use convenience methods like put() and get() to set up an authenticated session, transfer a file, and close the session.

Life Cycle:

Created based on the server's host and port. Destroyed when no more transfers are desired.


Field Summary
 
Fields inherited from class org.nees.util.grid.FTPFacade
_password, _userID, host, port
 
Constructor Summary
GridFTPFacade(java.lang.String h, int p)
          Create a facade for the given GridFTP server, with the default credential.
GridFTPFacade(java.lang.String h, int p, org.ietf.jgss.GSSCredential cred)
          Create a facade for the given GridFTP server, with the given credential.
 
Method Summary
static void debug(java.lang.Object o)
           
 org.globus.ftp.FTPClient getClient()
          Get a client authenticated to this server.
 org.ietf.jgss.GSSCredential getCredential()
          Get the credential used for authentication.
static void main(java.lang.String[] args)
          main method is for debugging or testing only.
 void setCredential(org.ietf.jgss.GSSCredential cred)
          Set the credential used to authenticate.
 void setDefaultCredential()
          Set to use the default credential when authenticating.
 
Methods inherited from class org.nees.util.grid.FTPFacade
append, append, append, get, get, get, put, put, put, setASCIITransferType, setBinaryTransferType, setTransferType
 
Methods inherited from class org.nees.util.TransferFacade
splitPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridFTPFacade

public GridFTPFacade(java.lang.String h,
                     int p)
              throws java.lang.Exception
Create a facade for the given GridFTP server, with the default credential.

Parameters:
h - the server host
p - the server port

GridFTPFacade

public GridFTPFacade(java.lang.String h,
                     int p,
                     org.ietf.jgss.GSSCredential cred)
              throws java.lang.Exception
Create a facade for the given GridFTP server, with the given credential.

Parameters:
h - the server host
p - the server port
cred - the credential
Method Detail

setCredential

public void setCredential(org.ietf.jgss.GSSCredential cred)
Set the credential used to authenticate.

Parameters:
cred - the credential.

setDefaultCredential

public void setDefaultCredential()
                          throws java.lang.Exception
Set to use the default credential when authenticating.

Throws:
java.lang.Exception

getCredential

public org.ietf.jgss.GSSCredential getCredential()
Get the credential used for authentication.

Returns:
the credential.

getClient

public org.globus.ftp.FTPClient getClient()
                                   throws java.lang.Exception
Get a client authenticated to this server.

Overrides:
getClient in class FTPFacade
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main method is for debugging or testing only.

Throws:
java.lang.Exception

debug

public static void debug(java.lang.Object o)