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 description
           
 int executors
           
 boolean help
           
 List<String> labels
           
 String master
           
 String name
           
 String password
           
 File remoteFsRoot
           
protected  DatagramSocket socket
          Used to discover the server.
protected  hudson.plugins.swarm.Client.Candidate target
          The Jenkins that we are trying to connect to.
 String username
           
 
Constructor Summary
Client()
           
 
Method Summary
protected  void connect()
           
protected  void createSwarmSlave()
           
protected  List<DatagramPacket> discover()
          Discovers Jenkins running nearby.
static void main(String... args)
           
 void run()
          Finds a Jenkins master that supports swarming, and join it.
protected  void sendBroadcast()
           
protected  void verifyThatUrlIsHudson()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected final DatagramSocket socket
Used to discover the server.


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

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

discover

protected List<DatagramPacket> discover()
                                 throws IOException,
                                        InterruptedException,
                                        RetryException
Discovers Jenkins running nearby. To give every nearby Jenkins a fair chance, wait for some time until we hear all the responses.

Throws:
IOException
InterruptedException
RetryException

sendBroadcast

protected void sendBroadcast()
                      throws IOException
Throws:
IOException

connect

protected void connect()
                throws InterruptedException
Throws:
InterruptedException

createSwarmSlave

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

verifyThatUrlIsHudson

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


Copyright © 2004-2011. All Rights Reserved.