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 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
IOException
InterruptedException
@Deprecated public CLI(URL jenkins, ExecutorService exec) throws IOException, InterruptedException
CLIConnectionFactory
to create CLI
IOException
InterruptedException
@Deprecated public CLI(URL jenkins, ExecutorService exec, String httpsProxyTunnel) throws IOException, InterruptedException
CLIConnectionFactory
to create CLI
IOException
InterruptedException
protected CliPort getCliTcpPort(String url) throws IOException
IOException
public void close() throws IOException, InterruptedException
IOException
InterruptedException
public 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
.IOException
GeneralSecurityException
public static KeyPair loadKey(File f) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException
KeyPair
.IOException
GeneralSecurityException
public static KeyPair loadKey(String pemString) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public PublicKey authenticate(Iterable<KeyPair> privateKeys) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public PublicKey authenticate(KeyPair key) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
Copyright © 2017. All rights reserved.