hudson.plugins.swarm
Class Client

java.lang.Object
  extended by hudson.plugins.swarm.Client

public class Client
extends Object

Swarm client.

Discovers nearby Jenkins via UDP broadcast, and pick eligible one randomly and joins it.

Author:
Kohsuke Kawaguchi

Field Summary
 String autoDiscoveryAddress
           
 String description
           
 boolean disableSslVerification
           
 int executors
           
 boolean help
           
 List<String> labels
           
 String master
           
 String mode
           
 String name
           
 String password
           
 File remoteFsRoot
           
protected  hudson.plugins.swarm.Client.Candidate target
          The Jenkins that we are trying to connect to.
 String username
           
 
Constructor Summary
Client()
           
 
Method Summary
protected  List<DatagramPacket> collectBroadcastResponses(DatagramSocket socket)
           
protected  void connect()
          This method blocks while the swarm slave is serving as a slave.
protected  org.apache.commons.httpclient.HttpClient createHttpClient(URL urlForAuth)
           
protected  void createSwarmSlave()
           
protected  hudson.plugins.swarm.Client.Candidate discoverFromBroadcast()
           
static void main(String... args)
           
 void run()
          Finds a Jenkins master that supports swarming, and join it.
protected  void sendBroadcast(DatagramSocket socket)
           
protected  void verifyThatUrlIsHudson()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected hudson.plugins.swarm.Client.Candidate target
The Jenkins that we are trying to connect to.


name

public String name

description

public String description

labels

public List<String> labels

remoteFsRoot

public File remoteFsRoot

executors

public int executors

master

public String master

autoDiscoveryAddress

public String autoDiscoveryAddress

disableSslVerification

public boolean disableSslVerification

mode

public String mode

username

public String username

password

public String password

help

public boolean help
Constructor Detail

Client

public Client()
       throws IOException
Throws:
IOException
Method Detail

main

public static void main(String... args)
                 throws InterruptedException,
                        IOException
Throws:
InterruptedException
IOException

run

public void run()
         throws InterruptedException
Finds a Jenkins master that supports swarming, and join it.

This method never returns.

Throws:
InterruptedException

discoverFromBroadcast

protected hudson.plugins.swarm.Client.Candidate discoverFromBroadcast()
                                                               throws IOException,
                                                                      InterruptedException,
                                                                      RetryException,
                                                                      ParserConfigurationException
Throws:
IOException
InterruptedException
RetryException
ParserConfigurationException

sendBroadcast

protected void sendBroadcast(DatagramSocket socket)
                      throws IOException
Throws:
IOException

collectBroadcastResponses

protected List<DatagramPacket> collectBroadcastResponses(DatagramSocket socket)
                                                  throws IOException,
                                                         RetryException
Throws:
IOException
RetryException

connect

protected void connect()
                throws InterruptedException
This method blocks while the swarm slave is serving as a slave.

Interrupt the thread to abort it and return.

Throws:
InterruptedException

createHttpClient

protected org.apache.commons.httpclient.HttpClient createHttpClient(URL urlForAuth)

createSwarmSlave

protected void createSwarmSlave()
                         throws IOException,
                                InterruptedException,
                                RetryException
Throws:
IOException
InterruptedException
RetryException

verifyThatUrlIsHudson

protected void verifyThatUrlIsHudson()
                              throws InterruptedException,
                                     RetryException
Throws:
InterruptedException
RetryException


Copyright © 2004-2014. All Rights Reserved.