com.heroku
Class ScaleProcess

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by com.heroku.ScaleProcess
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Builder>, hudson.tasks.BuildStep

public class ScaleProcess
extends hudson.tasks.Builder

Author:
Ryan Brainard

Nested Class Summary
static class AbstractHerokuBuildStep.AbstractHerokuBuildStepDescriptor
           
static class ScaleProcess.ScaleProcessDescriptor
           
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
ScaleProcess(String apiKey, String appName, String processType, int quantity)
           
 
Method Summary
 String getApiKey()
          Not for use by tasks needing the API key.
 String getAppName()
           
 ScaleProcess.ScaleProcessDescriptor getDescriptor()
           
protected  String getEffectiveApiKey()
          If an API key is not explicitly defined for this specific build step, the default key from HerokuPlugin is used.
protected  com.heroku.api.App getOrCreateApp(hudson.model.BuildListener listener, com.heroku.api.HerokuAPI api)
           
 String getProcessType()
           
 int getQuantity()
           
 boolean perform(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
protected  boolean perform(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener, com.heroku.api.HerokuAPI api, com.heroku.api.App app)
          Subclasses should override this to get access to the Heroku API with the context of an app
 
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
 

Constructor Detail

ScaleProcess

@DataBoundConstructor
public ScaleProcess(String apiKey,
                                         String appName,
                                         String processType,
                                         int quantity)
Method Detail

getAppName

public String getAppName()

getApiKey

public String getApiKey()
Not for use by tasks needing the API key. You probably want to use getEffectiveApiKey() instead.

Returns:
API key explicitly set for this build step

getProcessType

public String getProcessType()

getQuantity

public int getQuantity()

perform

protected boolean perform(hudson.model.AbstractBuild build,
                          hudson.Launcher launcher,
                          hudson.model.BuildListener listener,
                          com.heroku.api.HerokuAPI api,
                          com.heroku.api.App app)
                   throws IOException,
                          InterruptedException
Subclasses should override this to get access to the Heroku API with the context of an app

Throws:
IOException
InterruptedException

getDescriptor

public ScaleProcess.ScaleProcessDescriptor getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Builder>

getEffectiveApiKey

protected String getEffectiveApiKey()
If an API key is not explicitly defined for this specific build step, the default key from HerokuPlugin is used.

Returns:
API key tasks should use

getOrCreateApp

protected com.heroku.api.App getOrCreateApp(hudson.model.BuildListener listener,
                                            com.heroku.api.HerokuAPI api)

perform

public boolean perform(hudson.model.AbstractBuild build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws IOException,
                       InterruptedException
Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Throws:
IOException
InterruptedException


Copyright © 2004-2012. All Rights Reserved.