// Path: src/main/java/com/soasta/jenkins/cloud/CloudStatus.java
// public enum CloudStatus
// {
//   TERMINATED,
//   READY,
//   FAILED
// }
// 
// Path: src/main/java/com/soasta/jenkins/cloud/postbuild/AbstractCloudCommandPostBuildDescriptor.java
// public abstract class AbstractCloudCommandPostBuildDescriptor extends BuildStepDescriptor<Publisher> {
//     @Inject
//     CloudTestServer.DescriptorImpl serverDescriptor;
// 
//     @Override
//     public boolean isApplicable(Class<? extends AbstractProject> jobType) {
//         return true;
//     }
//     
//     /**
//      * Called automatically by Jenkins whenever the "Name"
//      * field is modified by the user.
//      */
//     public FormValidation doCheckName(@QueryParameter String value) 
//     {
//         if (value == null || value.trim().isEmpty()) 
//         {
//             return FormValidation.error("Name is Required");
//         } 
//         else 
//         {
//             return FormValidation.ok();
//         }
//     }
// 
//     public ListBoxModel doFillCloudTestServerIDItems() {
//         ListBoxModel r = new ListBoxModel();
//         for (CloudTestServer s : serverDescriptor.getServers()) {
//             r.add(s.getName(), s.getId());
//         }
//         return r;
//     }
// 
//     protected FormValidation validateFileMask(AbstractProject project, String value) throws IOException {
//         if (value.contains("${")) {
//             // if the value contains a variable reference, bail out from the check because we can end up
//             // warning a file that actually resolves correctly at the runtime
//             // the same change is made in FilePath.validateFileMask independently, and in the future
//             // we can remove this check from here
//             return FormValidation.ok();
//         }
// 
//         // Make sure the file exists.
//         return FilePath.validateFileMask(project.getSomeWorkspace(), value);
//     }
// }


import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import com.soasta.jenkins.cloud.CloudStatus;
import com.soasta.jenkins.cloud.postbuild.AbstractCloudCommandPostBuildDescriptor;
/*
 * Copyright (c) 2015, CloudBees, Inc., SOASTA, Inc.
 * All Rights Reserved.
 */
package com.soasta.jenkins.cloud.postbuild;




public class StartGrid extends CloudCommandBasePostBuild
{
  @DataBoundConstructor
  public StartGrid(String url, String cloudTestServerID, String name, int timeOut)
  {
    super(url, cloudTestServerID, name, timeOut);
  }
  
  @Extension
  @Symbol("startGrid")
  public static class DescriptorImpl extends AbstractCloudCommandPostBuildDescriptor
  {
      @Override
      public String getDisplayName()
      {
          return "Start Grid";
      }
  }
  
  @Override
  public String getCommand()
  {
    return "start-grid";
  }
  
  @Override
  public int getDefaultTimeout() 
  {
    return 600;
  }

  @Override
// Path: src/main/java/com/soasta/jenkins/cloud/CloudStatus.java
// public enum CloudStatus
// {
//   TERMINATED,
//   READY,
//   FAILED
// }
// 
// Path: src/main/java/com/soasta/jenkins/cloud/postbuild/AbstractCloudCommandPostBuildDescriptor.java
// public abstract class AbstractCloudCommandPostBuildDescriptor extends BuildStepDescriptor<Publisher> {
//     @Inject
//     CloudTestServer.DescriptorImpl serverDescriptor;
// 
//     @Override
//     public boolean isApplicable(Class<? extends AbstractProject> jobType) {
//         return true;
//     }
//     
//     /**
//      * Called automatically by Jenkins whenever the "Name"
//      * field is modified by the user.
//      */
//     public FormValidation doCheckName(@QueryParameter String value) 
//     {
//         if (value == null || value.trim().isEmpty()) 
//         {
//             return FormValidation.error("Name is Required");
//         } 
//         else 
//         {
//             return FormValidation.ok();
//         }
//     }
// 
//     public ListBoxModel doFillCloudTestServerIDItems() {
//         ListBoxModel r = new ListBoxModel();
//         for (CloudTestServer s : serverDescriptor.getServers()) {
//             r.add(s.getName(), s.getId());
//         }
//         return r;
//     }
// 
//     protected FormValidation validateFileMask(AbstractProject project, String value) throws IOException {
//         if (value.contains("${")) {
//             // if the value contains a variable reference, bail out from the check because we can end up
//             // warning a file that actually resolves correctly at the runtime
//             // the same change is made in FilePath.validateFileMask independently, and in the future
//             // we can remove this check from here
//             return FormValidation.ok();
//         }
// 
//         // Make sure the file exists.
//         return FilePath.validateFileMask(project.getSomeWorkspace(), value);
//     }
// }


// Path: src/main/java/com/soasta/jenkins/cloud/postbuild/StartGrid.java
import hudson.Extension;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import com.soasta.jenkins.cloud.CloudStatus;
import com.soasta.jenkins.cloud.postbuild.AbstractCloudCommandPostBuildDescriptor;

/*
 * Copyright (c) 2015, CloudBees, Inc., SOASTA, Inc.
 * All Rights Reserved.
 */
package com.soasta.jenkins.cloud.postbuild;




public class StartGrid extends CloudCommandBasePostBuild
{
  @DataBoundConstructor
  public StartGrid(String url, String cloudTestServerID, String name, int timeOut)
  {
    super(url, cloudTestServerID, name, timeOut);
  }
  
  @Extension
  @Symbol("startGrid")
  public static class DescriptorImpl extends AbstractCloudCommandPostBuildDescriptor
  {
      @Override
      public String getDisplayName()
      {
          return "Start Grid";
      }
  }
  
  @Override
  public String getCommand()
  {
    return "start-grid";
  }
  
  @Override
  public int getDefaultTimeout() 
  {
    return 600;
  }

  @Override
  public CloudStatus getSuccessStatus()