org.jclouds.tools.ant.taskdefs.sshjava
Class SSHJava

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.Java
              extended by org.jclouds.tools.ant.taskdefs.sshjava.SSHJava
All Implemented Interfaces:
Cloneable

public class SSHJava
extends org.apache.tools.ant.taskdefs.Java

Version of the Java task that executes over ssh.

Author:
Adrian Cole

Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.Java
redirector, redirectorElement
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
SSHJava()
           
SSHJava(org.apache.tools.ant.Task owner)
           
 
Method Summary
 void addEnv(org.apache.tools.ant.types.Environment.Variable var)
           
 void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysp)
           
 int executeJava()
           
 void setDescription(String description)
           
 void setDir(File localDir)
          Note that if the dir property is set, this will be copied recursively to the remote host.
 void setFork(boolean fork)
           
 void setHost(String host)
          Remote host, either DNS name or IP.
 void setId(String id)
           
 void setKeyfile(String keyfile)
          Sets the keyfile for the user.
 void setKnownhosts(String knownHosts)
          Sets the path to the file that has the identities of all known hosts.
 void setLocation(org.apache.tools.ant.Location location)
           
 void setOwningTarget(org.apache.tools.ant.Target target)
           
 void setPassphrase(String passphrase)
          Sets the passphrase for the users key.
 void setPassword(String password)
          Sets the password for the user.
 void setPort(int port)
          Changes the port used to connect to the remote host.
 void setProject(org.apache.tools.ant.Project project)
           
 void setRemotebase(File remotebase)
          All files transfered to the host will be relative to this.
 void setTaskName(String taskName)
           
 void setTaskType(String type)
           
 void setTimeout(long timeout)
          The connection can be dropped after a specified number of milliseconds.
 void setTrust(boolean yesOrNo)
          Setting this to true trusts hosts whose identity is unknown.
 void setUsername(String username)
          Username known to remote host.
 String toString()
           
 
Methods inherited from class org.apache.tools.ant.taskdefs.Java
addAssertions, addConfiguredRedirector, addSyspropertyset, checkConfiguration, clearArgs, createArg, createBootclasspath, createClasspath, createJvmarg, createPermissions, createWatchdog, execute, executeJava, getCommandLine, getSysProperties, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setAppend, setArgs, setClassname, setClasspath, setClasspathRef, setCloneVm, setError, setErrorProperty, setFailonerror, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setNewenvironment, setOutput, setOutputproperty, setResultProperty, setSpawn, setTimeout, setupRedirector
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setRuntimeConfigurableWrapper
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSHJava

public SSHJava()

SSHJava

public SSHJava(org.apache.tools.ant.Task owner)
Method Detail

setId

public void setId(String id)

executeJava

public int executeJava()
                throws org.apache.tools.ant.BuildException
Overrides:
executeJava in class org.apache.tools.ant.taskdefs.Java
Throws:
org.apache.tools.ant.BuildException

addEnv

public void addEnv(org.apache.tools.ant.types.Environment.Variable var)
Overrides:
addEnv in class org.apache.tools.ant.taskdefs.Java

setDir

public void setDir(File localDir)
Note that if the dir property is set, this will be copied recursively to the remote host.

Overrides:
setDir in class org.apache.tools.ant.taskdefs.Java

setRemotebase

public void setRemotebase(File remotebase)
All files transfered to the host will be relative to this. The java process itself will be at this path/id.


setFork

public void setFork(boolean fork)
Overrides:
setFork in class org.apache.tools.ant.taskdefs.Java

setHost

public void setHost(String host)
Remote host, either DNS name or IP.

Parameters:
host - The new host value

setUsername

public void setUsername(String username)
Username known to remote host.

Parameters:
username - The new username value

setPassword

public void setPassword(String password)
Sets the password for the user.

Parameters:
password - The new password value

setKeyfile

public void setKeyfile(String keyfile)
Sets the keyfile for the user.

Parameters:
keyfile - The new keyfile value

setPassphrase

public void setPassphrase(String passphrase)
Sets the passphrase for the users key.

Parameters:
passphrase - The new passphrase value

setKnownhosts

public void setKnownhosts(String knownHosts)
Sets the path to the file that has the identities of all known hosts. This is used by SSH protocol to validate the identity of the host. The default is ${user.home}/.ssh/known_hosts.

Parameters:
knownHosts - a path to the known hosts file.

setTrust

public void setTrust(boolean yesOrNo)
Setting this to true trusts hosts whose identity is unknown.

Parameters:
yesOrNo - if true trust the identity of unknown hosts.

setPort

public void setPort(int port)
Changes the port used to connect to the remote host.

Parameters:
port - port number of remote host.

setTimeout

public void setTimeout(long timeout)
The connection can be dropped after a specified number of milliseconds. This is sometimes useful when a connection may be flaky. Default is 0, which means "wait forever".

Parameters:
timeout - The new timeout value in seconds

setProject

public void setProject(org.apache.tools.ant.Project project)
Overrides:
setProject in class org.apache.tools.ant.ProjectComponent

setOwningTarget

public void setOwningTarget(org.apache.tools.ant.Target target)
Overrides:
setOwningTarget in class org.apache.tools.ant.Task

setTaskName

public void setTaskName(String taskName)
Overrides:
setTaskName in class org.apache.tools.ant.Task

setDescription

public void setDescription(String description)
Overrides:
setDescription in class org.apache.tools.ant.ProjectComponent

setLocation

public void setLocation(org.apache.tools.ant.Location location)
Overrides:
setLocation in class org.apache.tools.ant.ProjectComponent

setTaskType

public void setTaskType(String type)
Overrides:
setTaskType in class org.apache.tools.ant.Task

toString

public String toString()
Overrides:
toString in class Object

addSysproperty

public void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysp)
Overrides:
addSysproperty in class org.apache.tools.ant.taskdefs.Java


Copyright © 2009-2011 jclouds. All Rights Reserved.