hudson.cli
Class CLI

java.lang.Object
  extended by hudson.cli.CLI

public class CLI
extends Object

CLI entry point to Jenkins.

Author:
Kohsuke Kawaguchi

Constructor Summary
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
 
Method Summary
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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLI

public CLI(URL jenkins)
    throws IOException,
           InterruptedException
Throws:
IOException
InterruptedException

CLI

public CLI(URL jenkins,
           ExecutorService exec)
    throws IOException,
           InterruptedException
Deprecated. Use CLIConnectionFactory to create CLI

Throws:
IOException
InterruptedException

CLI

public CLI(URL jenkins,
           ExecutorService exec,
           String httpsProxyTunnel)
    throws IOException,
           InterruptedException
Deprecated. Use CLIConnectionFactory to create CLI

Throws:
IOException
InterruptedException
Method Detail

close

public void close()
           throws IOException,
                  InterruptedException
Shuts down the channel and closes the underlying connection.

Throws:
IOException
InterruptedException

execute

public int execute(List<String> args,
                   InputStream stdin,
                   OutputStream stdout,
                   OutputStream stderr)

execute

public int execute(List<String> args)

execute

public int execute(String... args)

hasCommand

public boolean hasCommand(String name)
Returns true if the named command exists.


getChannel

public hudson.remoting.Channel getChannel()
Accesses the underlying communication channel.

Since:
1.419

upgrade

public void upgrade()
Attempts to lift the security restriction on the underlying channel. This requires the administer privilege on the server.

Throws:
SecurityException - If we fail to upgrade the connection.

main

public static void main(String[] _args)
                 throws Exception
Throws:
Exception

_main

public static int _main(String[] _args)
                 throws Exception
Throws:
Exception

loadKey

public static KeyPair loadKey(File f,
                              String passwd)
                       throws IOException,
                              GeneralSecurityException
Loads RSA/DSA private key in a PEM format into KeyPair.

Throws:
IOException
GeneralSecurityException

loadKey

public static KeyPair loadKey(File f)
                       throws IOException,
                              GeneralSecurityException
Throws:
IOException
GeneralSecurityException

loadKey

public static KeyPair loadKey(String pemString,
                              String passwd)
                       throws IOException,
                              GeneralSecurityException
Loads RSA/DSA private key in a PEM format into KeyPair.

Throws:
IOException
GeneralSecurityException

loadKey

public static KeyPair loadKey(String pemString)
                       throws IOException,
                              GeneralSecurityException
Throws:
IOException
GeneralSecurityException

authenticate

public PublicKey authenticate(Iterable<KeyPair> privateKeys)
                       throws IOException,
                              GeneralSecurityException
Authenticate ourselves against the server.

Returns:
identity of the server represented as a public key.
Throws:
IOException
GeneralSecurityException

authenticate

public PublicKey authenticate(KeyPair key)
                       throws IOException,
                              GeneralSecurityException
Throws:
IOException
GeneralSecurityException


Copyright © 2004-2013. All Rights Reserved.