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

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
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 hudson.model;
25
26 import java.io.IOException;
27 import java.util.Collection;
28 import java.io.File;
29
30 /**
31 * Represents a grouping inherent to a kind of {@link Item}s.
32 *
33 * @author Kohsuke Kawaguchi
34 * @see ItemGroupMixIn
35 */
36 public interface ItemGroup<T extends Item> extends PersistenceRoot, ModelObject {
37 /**
38 * Gets the full name of this {@link ItemGroup}.
39 *
40 * @see Item#getFullName()
41 */
42 String getFullName();
43
44 /**
45 * @see Item#getFullDisplayName()
46 */
47 String getFullDisplayName();
48
49 /**
50 * Gets all the items in this collection in a read-only view.
51 */
52 Collection<T> getItems();
53
54 /**
55 * Returns the path relative to the context root,
56 * like "foo/bar/zot/". Note no leading slash but trailing slash.
57 */
58 String getUrl();
59
60 /**
61 * Gets the URL token that prefixes the URLs for child {@link Item}s.
62 * Like "job", "item", etc.
63 */
64 String getUrlChildPrefix();
65
66 /**
67 * Gets the {@link Item} inside this group that has a given name.
68 */
69 T getItem(String name);
70
71 /**
72 * Assigns the {@link Item#getRootDir() root directory} for children.
73 */
74 File getRootDirFor(T child);
75
76 /**
77 * Internal method. Called by {@link Item}s when they are renamed by users.
78 */
79 void onRenamed(T item, String oldName, String newName) throws IOException;
80
81 /**
82 * Internal method. Called by {@link Item}s when they are deleted by users.
83 */
84 void onDeleted(T item) throws IOException;
85 }
86