cct.ssh
Class SSHServiceProvider

java.lang.Object
  extended by cct.ssh.SSHServiceProvider
All Implemented Interfaces:
GridProviderInterface

public class SSHServiceProvider
extends java.lang.Object
implements GridProviderInterface

Title: SSH Service Provider

Description: How to use SSH Service Provider

Could be customized using custom.properties file: cct.ssh.SSHServiceProvider@jobKillCommand = bash --login -c 'qdel -F %s' cct.ssh.SSHServiceProvider@jobSubmitCommand = bash --login -c 'qsub %s' cct.ssh.SSHServiceProvider@jobStatusCommand = bash --login -c 'qstat -f %s'

Copyright: Copyright (c) 2006

Company: ANU


Field Summary
(package private) static java.lang.String CUSTOM_PROPERTY_FILE
           
(package private) static java.lang.String DIVIDER
           
(package private) static java.lang.String JOB_KILL_COMMAND
           
(package private) static java.lang.String JOB_STATUS_COMMAND
           
(package private) static java.lang.String JOB_SUBMIT_COMMAND
           
(package private) static java.lang.String jobKillCommand
           
(package private) static java.lang.String jobStatusCommand
           
(package private) static java.lang.String jobSubmitCommand
           
protected  SSHPanel nativeDialog
           
(package private)  java.util.prefs.Preferences prefs
           
(package private) static java.lang.String SSH2_HOST
           
(package private) static java.lang.String SSH2_PORT
           
(package private) static java.lang.String SSH2_USER_NAME
           
 
Constructor Summary
SSHServiceProvider()
           
 
Method Summary
static void addHost(java.lang.String host, SFTPBrowser sftp)
           
 java.lang.String[] executeCommand(SFTPBrowser sftp, java.lang.String command)
           
 java.lang.String getCommandsAsString()
           
static SFTPBrowser getConnection(java.lang.String host)
           
 java.lang.String getGatekeeper()
           
 java.lang.String getJobHandle()
          Returns job handle of a submitted job (in the case of success)
 java.lang.String getJobStatus(CheckPoint chkp)
          Returns current job status of a job
 java.lang.String getName()
           
 OperationalSystems getOS()
           
 FileChooserInterface getRemoteFileChooser()
           
 java.lang.String getRemoteHost()
           
 java.awt.Component getVisualComponent()
           
 boolean isPassOptionsToScheduler()
           
 boolean isRemoteDirectorySelectable()
           
 void killJob(CheckPoint chkp)
           
 CheckPointInterface setCheckPoint(CheckPointInterface checkp)
           
 void submitJob(JobDescription job)
          Submits job using ssh
 java.lang.String submitTask(JobDescription job)
           
 boolean transferFile(java.lang.String source, java.lang.String destination, CheckPoint chkp)
          Transfers file assuming that "source" is a remote file while "destination" is a local
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM_PROPERTY_FILE

static final java.lang.String CUSTOM_PROPERTY_FILE
See Also:
Constant Field Values

SSH2_HOST

static final java.lang.String SSH2_HOST
See Also:
Constant Field Values

SSH2_PORT

static final java.lang.String SSH2_PORT
See Also:
Constant Field Values

SSH2_USER_NAME

static final java.lang.String SSH2_USER_NAME
See Also:
Constant Field Values

DIVIDER

static final java.lang.String DIVIDER
See Also:
Constant Field Values

JOB_KILL_COMMAND

static final java.lang.String JOB_KILL_COMMAND
See Also:
Constant Field Values

JOB_SUBMIT_COMMAND

static final java.lang.String JOB_SUBMIT_COMMAND
See Also:
Constant Field Values

JOB_STATUS_COMMAND

static final java.lang.String JOB_STATUS_COMMAND
See Also:
Constant Field Values

prefs

java.util.prefs.Preferences prefs

nativeDialog

protected SSHPanel nativeDialog

jobKillCommand

static java.lang.String jobKillCommand

jobSubmitCommand

static java.lang.String jobSubmitCommand

jobStatusCommand

static java.lang.String jobStatusCommand
Constructor Detail

SSHServiceProvider

public SSHServiceProvider()
Method Detail

submitJob

public void submitJob(JobDescription job)
               throws java.lang.Exception
Submits job using ssh

Parameters:
job - JobDescription
Throws:
java.lang.Exception - in case of any error(s)

getJobHandle

public java.lang.String getJobHandle()
Returns job handle of a submitted job (in the case of success)

Returns:
String

getJobStatus

public java.lang.String getJobStatus(CheckPoint chkp)
                              throws java.lang.Exception
Returns current job status of a job

Specified by:
getJobStatus in interface GridProviderInterface
Parameters:
chkp - CheckPoint
Returns:
String
Throws:
java.lang.Exception

transferFile

public boolean transferFile(java.lang.String source,
                            java.lang.String destination,
                            CheckPoint chkp)
                     throws java.lang.Exception
Transfers file assuming that "source" is a remote file while "destination" is a local

Specified by:
transferFile in interface GridProviderInterface
Parameters:
source - String
destination - String
chkp - CheckPoint
Returns:
boolean
Throws:
java.lang.Exception

getConnection

public static SFTPBrowser getConnection(java.lang.String host)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

killJob

public void killJob(CheckPoint chkp)
             throws java.lang.Exception
Specified by:
killJob in interface GridProviderInterface
Throws:
java.lang.Exception

addHost

public static void addHost(java.lang.String host,
                           SFTPBrowser sftp)

executeCommand

public java.lang.String[] executeCommand(SFTPBrowser sftp,
                                         java.lang.String command)
                                  throws java.lang.Exception
Parameters:
sftp - SFTPBrowser
command - String
Returns:
String[]
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Specified by:
getName in interface GridProviderInterface

getVisualComponent

public java.awt.Component getVisualComponent()
Specified by:
getVisualComponent in interface GridProviderInterface

getRemoteFileChooser

public FileChooserInterface getRemoteFileChooser()
Specified by:
getRemoteFileChooser in interface GridProviderInterface

getRemoteHost

public java.lang.String getRemoteHost()
Specified by:
getRemoteHost in interface GridProviderInterface

isPassOptionsToScheduler

public boolean isPassOptionsToScheduler()
Specified by:
isPassOptionsToScheduler in interface GridProviderInterface

submitTask

public java.lang.String submitTask(JobDescription job)
                            throws java.lang.Exception
Specified by:
submitTask in interface GridProviderInterface
Throws:
java.lang.Exception

getCommandsAsString

public java.lang.String getCommandsAsString()
Specified by:
getCommandsAsString in interface GridProviderInterface

getOS

public OperationalSystems getOS()
Specified by:
getOS in interface GridProviderInterface

getGatekeeper

public java.lang.String getGatekeeper()
Specified by:
getGatekeeper in interface GridProviderInterface

isRemoteDirectorySelectable

public boolean isRemoteDirectorySelectable()
Specified by:
isRemoteDirectorySelectable in interface GridProviderInterface

setCheckPoint

public CheckPointInterface setCheckPoint(CheckPointInterface checkp)
Specified by:
setCheckPoint in interface GridProviderInterface