View Javadoc

1   /*
2    * Copyright 2012 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.ci.maven.mojo;
17  
18  import de.smartics.ci.comm.CiController;
19  import de.smartics.ci.comm.command.CommandException;
20  
21  /**
22   * Delete job hudson ci mojo.
23   *
24   * @goal deleteJobs
25   * @requiresProject
26   * @description deletes an exiting job within a running hudson server.
27   */
28  public class DeleteJobHudsonCiMojo extends AbstractConfigChoiceHudsonCiMojo
29  {
30    // ********************************* Fields *********************************
31  
32    // --- constants ------------------------------------------------------------
33  
34    // --- members --------------------------------------------------------------
35  
36    // ****************************** Initializer *******************************
37  
38    // ****************************** Constructors ******************************
39  
40    // ****************************** Inner Classes *****************************
41  
42    // ********************************* Methods ********************************
43  
44    // --- init -----------------------------------------------------------------
45  
46    // --- get&set --------------------------------------------------------------
47  
48    // --- business -------------------------------------------------------------
49  
50    /**
51     * {@inheritDoc}
52     *
53     * @throws CommandException
54     */
55    public final void executeCommand(final String jobName,
56        final String jobConfigString, final CiController controller)
57      throws CommandException
58    {
59      deleteJob(controller, jobName);
60    }
61  
62    private void deleteJob(final CiController controller, final String jobName)
63      throws CommandException
64    {
65      controller.deleteJob(jobName);
66    }
67  
68    // --- object basics --------------------------------------------------------
69  
70  }