com.saucelabs.ci
Class SauceLibraryManager

java.lang.Object
  extended by com.saucelabs.ci.SauceLibraryManager
Direct Known Subclasses:
HudsonSauceLibraryManager

public abstract class SauceLibraryManager
extends Object

Author:
Ross Rowe

Constructor Summary
SauceLibraryManager()
           
 
Method Summary
 void addFileToJar(File pluginJarFile, de.schlichtherle.truezip.file.TFile updatedSauceConnectJarFile)
          Adds the updatedSauceConnectJarFile to the pluginJarFile.
 boolean checkForLaterVersion()
          Performs a REST request to https://saucelabs.com/versions.json to retrieve the list of sauce connect version information.
 SauceFactory getSauceAPIFactory()
           
 File retrieveNewVersion(String response)
          Performs a HTTP GET to retrieve the contents of the download url (assumed to be a zip file), then unzips the zip file to the file system.
 void triggerReload()
          Performs a REST request to https://saucelabs.com/versions.json to retrieve the download url to be used to retrieve the latest version of Sauce Connect, then updates the Bamboo Sauce plugin jar to include this jar.
abstract  void updatePluginJar(File jarFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SauceLibraryManager

public SauceLibraryManager()
Method Detail

checkForLaterVersion

public boolean checkForLaterVersion()
                             throws IOException,
                                    org.json.JSONException,
                                    URISyntaxException
Performs a REST request to https://saucelabs.com/versions.json to retrieve the list of sauce connect version information. If the version information in the response is later than the current version, then return true.

Returns:
boolean indicating whether an updated sauce connect jar is available
Throws:
IOException
org.json.JSONException - thrown if an error occurs during the parsing of the JSON response
URISyntaxException

triggerReload

public void triggerReload()
                   throws org.json.JSONException,
                          IOException,
                          URISyntaxException
Performs a REST request to https://saucelabs.com/versions.json to retrieve the download url to be used to retrieve the latest version of Sauce Connect, then updates the Bamboo Sauce plugin jar to include this jar.

Throws:
org.json.JSONException - thrown if an error occurs during the parsing of the JSON response
IOException
URISyntaxException

getSauceAPIFactory

public SauceFactory getSauceAPIFactory()

updatePluginJar

public abstract void updatePluginJar(File jarFile)
                              throws IOException,
                                     URISyntaxException
Throws:
IOException
URISyntaxException

retrieveNewVersion

public File retrieveNewVersion(String response)
                        throws org.json.JSONException,
                               IOException
Performs a HTTP GET to retrieve the contents of the download url (assumed to be a zip file), then unzips the zip file to the file system.

Parameters:
response -
Returns:
Throws:
org.json.JSONException
IOException

addFileToJar

public void addFileToJar(File pluginJarFile,
                         de.schlichtherle.truezip.file.TFile updatedSauceConnectJarFile)
                  throws IOException
Adds the updatedSauceConnectJarFile to the pluginJarFile.

Parameters:
pluginJarFile -
updatedSauceConnectJarFile -
Throws:
IOException


Copyright © 2004-2011. All Rights Reserved.