public class SwarmClient extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SwarmClient.Crumb |
protected static class |
SwarmClient.DefaultTrustManager |
| Constructor and Description |
|---|
SwarmClient(Options options) |
| Modifier and Type | Method and Description |
|---|---|
protected List<DatagramPacket> |
collectBroadcastResponses(DatagramSocket socket) |
protected void |
connect(Candidate target)
This method blocks while the swarm slave is serving as a slave.
|
protected org.apache.commons.httpclient.HttpClient |
createHttpClient(URL urlForAuth) |
protected void |
createSwarmSlave(Candidate target) |
Candidate |
discoverFromBroadcast() |
Candidate |
discoverFromMasterUrl() |
void |
exitWithStatus(int status) |
protected static String |
getChildElementString(Element parent,
String tagName) |
protected static SwarmClient.Crumb |
getCsrfCrumb(org.apache.commons.httpclient.HttpClient client,
Candidate target) |
static org.apache.commons.httpclient.HttpClient |
getGlobalHttpClient() |
String |
getHash() |
static String |
hash(File remoteFsRoot)
Returns a hash that should be consistent for any individual swarm client (as long as it has a persistent IP)
and should be unique to that client.
|
protected static String |
param(String name,
String value) |
protected static void |
postLabelAppend(String name,
String labels,
org.apache.commons.httpclient.HttpClient client,
Candidate target) |
protected static void |
postLabelRemove(String name,
String labels,
org.apache.commons.httpclient.HttpClient client,
Candidate target) |
protected void |
sendBroadcast(DatagramSocket socket) |
void |
sleepSeconds(int waitTime) |
protected void |
verifyThatUrlIsHudson(Candidate target) |
public SwarmClient(Options options)
public String getHash()
public Candidate discoverFromBroadcast() throws IOException, RetryException, ParserConfigurationException
protected void sendBroadcast(DatagramSocket socket) throws IOException
IOExceptionprotected List<DatagramPacket> collectBroadcastResponses(DatagramSocket socket) throws IOException, RetryException
IOExceptionRetryExceptionpublic Candidate discoverFromMasterUrl() throws IOException, ParserConfigurationException, RetryException
protected void connect(Candidate target) throws InterruptedException
target - candidateInterruptedExceptionpublic static org.apache.commons.httpclient.HttpClient getGlobalHttpClient()
protected org.apache.commons.httpclient.HttpClient createHttpClient(URL urlForAuth)
protected static SwarmClient.Crumb getCsrfCrumb(org.apache.commons.httpclient.HttpClient client, Candidate target) throws IOException
IOExceptionprotected void createSwarmSlave(Candidate target) throws IOException, RetryException
IOExceptionRetryExceptionprotected static void postLabelRemove(String name, String labels, org.apache.commons.httpclient.HttpClient client, Candidate target) throws IOException, RetryException
IOExceptionRetryExceptionprotected static void postLabelAppend(String name, String labels, org.apache.commons.httpclient.HttpClient client, Candidate target) throws RetryException, IOException
RetryExceptionIOExceptionprotected static String param(String name, String value) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected void verifyThatUrlIsHudson(Candidate target) throws RetryException
RetryExceptionpublic static String hash(File remoteFsRoot)
remoteFsRoot - the file system root should be part of the hash (to support multiple swarm clients from
the same machine)public void exitWithStatus(int status)
public void sleepSeconds(int waitTime)
throws InterruptedException
InterruptedExceptionCopyright © 2016–2018. All rights reserved.