hudson.plugins.sauce_ondemand
Class SauceOnDemandBuildAction

java.lang.Object
  extended by hudson.plugins.sauce_ondemand.AbstractAction
      extended by hudson.plugins.sauce_ondemand.SauceOnDemandBuildAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.ModelObject

public class SauceOnDemandBuildAction
extends AbstractAction

Presents the links to the Sauce OnDemand jobs on the build summary page.

Author:
Ross Rowe

Nested Class Summary
 class SauceOnDemandBuildAction.ById
           
 
Field Summary
static String JOB_DETAILS_URL
           
 
Constructor Summary
SauceOnDemandBuildAction(hudson.model.AbstractBuild<?,?> build, String username, String accessKey)
           
 
Method Summary
 String calcHMAC(String username, String accessKey, String jobId)
           
 void doJobReport(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 String getAccessKey()
           
 hudson.model.AbstractBuild<?,?> getBuild()
           
 SauceOnDemandBuildAction.ById getById(String id)
           
 List<com.saucelabs.ci.JobInformation> getJobs()
           
 String getUsername()
           
 boolean hasSauceOnDemandResults()
           
 List<com.saucelabs.ci.JobInformation> retrieveJobIdsFromSauce()
          Invokes the Sauce REST API to retrieve the details for the jobs the user has access to.
 
Methods inherited from class hudson.plugins.sauce_ondemand.AbstractAction
getDisplayName, getIconFileName, getUrlName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOB_DETAILS_URL

public static final String JOB_DETAILS_URL
See Also:
Constant Field Values
Constructor Detail

SauceOnDemandBuildAction

public SauceOnDemandBuildAction(hudson.model.AbstractBuild<?,?> build,
                                String username,
                                String accessKey)
Method Detail

getAccessKey

public String getAccessKey()

getUsername

public String getUsername()

getBuild

public hudson.model.AbstractBuild<?,?> getBuild()

hasSauceOnDemandResults

public boolean hasSauceOnDemandResults()

getJobs

public List<com.saucelabs.ci.JobInformation> getJobs()

retrieveJobIdsFromSauce

public List<com.saucelabs.ci.JobInformation> retrieveJobIdsFromSauce()
                                                              throws IOException,
                                                                     org.json.JSONException,
                                                                     InvalidKeyException,
                                                                     NoSuchAlgorithmException
Invokes the Sauce REST API to retrieve the details for the jobs the user has access to. Iterates over the jobs and attempts to find the job that has a 'build' field matching the build key/number.

Throws:
Exception
IOException
org.json.JSONException
InvalidKeyException
NoSuchAlgorithmException

doJobReport

public void doJobReport(org.kohsuke.stapler.StaplerRequest req,
                        org.kohsuke.stapler.StaplerResponse rsp)
                 throws IOException
Throws:
IOException

calcHMAC

public String calcHMAC(String username,
                       String accessKey,
                       String jobId)
                throws NoSuchAlgorithmException,
                       InvalidKeyException,
                       UnsupportedEncodingException
Throws:
NoSuchAlgorithmException
InvalidKeyException
UnsupportedEncodingException

getById

public SauceOnDemandBuildAction.ById getById(String id)


Copyright © 2004-2013. All Rights Reserved.