File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\jenkins\model\ModifiableTopLevelItemGroup.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2011, CloudBees, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24 package jenkins.model;
25
26 import hudson.model.ModifiableItemGroup;
27 import hudson.model.TopLevelItem;
28 import hudson.model.TopLevelItemDescriptor;
29
30 import java.io.IOException;
31 import java.io.InputStream;
32
33 /**
34 * A {@link hudson.model.ModifiableItemGroup} to manage {@link hudson.model.TopLevelItem},
35 * including copying, creating from descriptor and from XML.
36 *
37 * @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
38 * @since 1.480
39 */
40 public interface ModifiableTopLevelItemGroup extends ModifiableItemGroup<TopLevelItem> {
41
42 /**
43 * Copys a job.
44 *
45 * @param src
46 * A {@link TopLevelItem} to be copied.
47 * @param name
48 * Name of the newly created project.
49 * @return
50 * Newly created {@link TopLevelItem}.
51 */
52 <T extends TopLevelItem> T copy(T src, String name) throws IOException;
53
54 /**
55 * /**
56 * Creates a new job from its configuration XML. The type of the job created will be determined by
57 * what's in this XML.
58 * @param name
59 * Name of the newly created project.
60 * @param xml
61 * Item configuration as xml
62 * @return
63 * Newly created {@link TopLevelItem}.
64 */
65 TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException;
66
67 /**
68 * Creates a new job.
69 * @param type Descriptor for job type
70 * @param name Name for job
71 * @param notify Whether to fire onCreated method for all ItemListeners
72 * @throws IllegalArgumentException
73 * if a project of the give name already exists.
74 */
75 TopLevelItem createProject(TopLevelItemDescriptor type, String name, boolean notify) throws IOException;
76 }
77