public class CLI extends Object
| Constructor and Description |
|---|
CLI(URL jenkins) |
CLI(URL jenkins,
ExecutorService exec)
Deprecated.
Use
CLIConnectionFactory to create CLI |
CLI(URL jenkins,
ExecutorService exec,
String httpsProxyTunnel)
Deprecated.
Use
CLIConnectionFactory to create CLI |
| Modifier and Type | Method and Description |
|---|---|
static int |
_main(String[] _args) |
PublicKey |
authenticate(Iterable<KeyPair> privateKeys)
Authenticate ourselves against the server.
|
PublicKey |
authenticate(KeyPair key) |
void |
close()
Shuts down the channel and closes the underlying connection.
|
int |
execute(List<String> args) |
int |
execute(List<String> args,
InputStream stdin,
OutputStream stdout,
OutputStream stderr) |
int |
execute(String... args) |
hudson.remoting.Channel |
getChannel()
Accesses the underlying communication channel.
|
protected hudson.cli.CliPort |
getCliTcpPort(String url)
If the server advertises CLI endpoint, returns its location.
|
boolean |
hasCommand(String name)
Returns true if the named command exists.
|
static KeyPair |
loadKey(File f) |
static KeyPair |
loadKey(File f,
String passwd)
Loads RSA/DSA private key in a PEM format into
KeyPair. |
static KeyPair |
loadKey(String pemString) |
static KeyPair |
loadKey(String pemString,
String passwd)
Loads RSA/DSA private key in a PEM format into
KeyPair. |
static void |
main(String[] _args) |
void |
upgrade()
Attempts to lift the security restriction on the underlying channel.
|
public CLI(URL jenkins) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic CLI(URL jenkins, ExecutorService exec) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic CLI(URL jenkins, ExecutorService exec, String httpsProxyTunnel) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected hudson.cli.CliPort getCliTcpPort(String url) throws IOException
IOExceptionpublic void close()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic int execute(List<String> args, InputStream stdin, OutputStream stdout, OutputStream stderr)
public int execute(String... args)
public boolean hasCommand(String name)
public hudson.remoting.Channel getChannel()
public void upgrade()
SecurityException - If we fail to upgrade the connection.public static KeyPair loadKey(File f, String passwd) throws IOException, GeneralSecurityException
KeyPair.IOExceptionGeneralSecurityExceptionpublic static KeyPair loadKey(File f) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException
KeyPair.IOExceptionGeneralSecurityExceptionpublic static KeyPair loadKey(String pemString) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic PublicKey authenticate(Iterable<KeyPair> privateKeys) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic PublicKey authenticate(KeyPair key) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionCopyright © 2004-2015. All Rights Reserved.