com.saucelabs.ci
Class BrowserFactory

java.lang.Object
  extended by com.saucelabs.ci.BrowserFactory

public class BrowserFactory
extends Object

Handles invoking the Sauce REST API to retrieve the list of valid Browsers. The list of browser is cached for an hour.

Author:
Ross Rowe

Field Summary
static String BROWSER_URL
           
protected  Timestamp lastLookup
           
 
Constructor Summary
BrowserFactory()
           
 
Method Summary
 Browser forKey(String key)
           
 List<Browser> getBrowserListFromJson(String browserListJson)
          Parses the JSON response and constructs a List of Browser instances.
static BrowserFactory getInstance()
          Returns a singleton instance of SauceFactory.
 SauceFactory getSauceAPIFactory()
           
 boolean shouldRetrieveBrowsers()
           
 List<Browser> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROWSER_URL

public static final String BROWSER_URL
See Also:
Constant Field Values

lastLookup

protected Timestamp lastLookup
Constructor Detail

BrowserFactory

public BrowserFactory()
Method Detail

values

public List<Browser> values()
                     throws IOException,
                            org.json.JSONException
Throws:
IOException
org.json.JSONException

shouldRetrieveBrowsers

public boolean shouldRetrieveBrowsers()

getSauceAPIFactory

public SauceFactory getSauceAPIFactory()

getBrowserListFromJson

public List<Browser> getBrowserListFromJson(String browserListJson)
                                     throws org.json.JSONException
Parses the JSON response and constructs a List of Browser instances.

Parameters:
browserListJson -
Returns:
Throws:
org.json.JSONException

forKey

public Browser forKey(String key)

getInstance

public static BrowserFactory getInstance()
Returns a singleton instance of SauceFactory. This is required because remote agents don't have the Bamboo component plugin available, so the Spring auto-wiring doesn't work.

Returns:


Copyright © 2004-2011. All Rights Reserved.