|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Item
Basic configuration unit in Hudson.
Every Item
is hosted in an ItemGroup
called "parent",
and some Item
s are ItemGroup
s. This form a tree
structure, which is rooted at Jenkins
.
Unlike file systems, where a file can be moved from one directory
to another, Item
inherently belongs to a single ItemGroup
and that relationship will not change.
Think of
Windows device manager
— an HDD always show up under 'Disk drives' and it can never be moved to another parent.
Similarly, ItemGroup
is not a generic container. Each subclass
of ItemGroup
can usually only host a certain limited kinds of
Item
s.
Item
s have unique name
s that distinguish themselves
among their siblings uniquely. The names can be combined by '/' to form an
item full name, which uniquely identifies an Item
inside the whole Jenkins
.
Items
,
ItemVisitor
Field Summary | |
---|---|
static Permission |
BUILD
|
static Permission |
CANCEL
|
static Permission |
CONFIGURE
|
static Permission |
CREATE
|
static Permission |
DELETE
|
static Permission |
DISCOVER
|
static Permission |
EXTENDED_READ
|
static PermissionGroup |
PERMISSIONS
|
static Permission |
READ
|
static Permission |
WIPEOUT
|
static Permission |
WORKSPACE
|
Fields inherited from interface hudson.model.Saveable |
---|
NOOP |
Method Summary | |
---|---|
void |
delete()
Deletes this item. |
String |
getAbsoluteUrl()
Deprecated. This method shall NEVER be used during HTML page rendering, as it won't work with network set up like Apache reverse proxy. This method is only intended for the remote API clients who cannot resolve relative references (even this won't work for the same reason, which should be fixed.) |
Collection<? extends Job> |
getAllJobs()
Gets all the jobs that this Item contains as descendants. |
String |
getDisplayName()
Gets the human readable short name of this item. |
String |
getFullDisplayName()
Works like getDisplayName() but return
the full path that includes all the display names
of the ancestors. |
String |
getFullName()
Gets the full name of this item, like "abc/def/ghi". |
String |
getName()
Gets the name of the item. |
ItemGroup<? extends Item> |
getParent()
Gets the parent that contains this item. |
String |
getRelativeNameFrom(Item item)
Short for getRelativeNameFrom(item.getParent()) |
String |
getRelativeNameFrom(ItemGroup g)
Gets the relative name to this item from the specified group. |
String |
getShortUrl()
Returns the URL of this item relative to the parent ItemGroup . |
String |
getUrl()
Returns the URL of this item relative to the context root of the application. |
void |
onCopiedFrom(Item src)
When a Item is copied from existing one,
the files are first copied on the file system,
then it will be loaded, then this method will be invoked
to perform any implementation-specific work. |
void |
onCreatedFromScratch()
When an item is created from scratch (instead of copied), this method will be invoked. |
void |
onLoad(ItemGroup<? extends Item> parent,
String name)
Called right after when a Item is loaded from disk. |
void |
save()
Save the settings to a file. |
Methods inherited from interface hudson.model.PersistenceRoot |
---|
getRootDir |
Methods inherited from interface hudson.search.SearchableModelObject |
---|
getSearch |
Methods inherited from interface hudson.search.SearchItem |
---|
getSearchIndex, getSearchName, getSearchUrl |
Methods inherited from interface hudson.security.AccessControlled |
---|
checkPermission, getACL, hasPermission |
Field Detail |
---|
static final PermissionGroup PERMISSIONS
static final Permission CREATE
static final Permission DELETE
static final Permission CONFIGURE
static final Permission READ
static final Permission DISCOVER
static final Permission EXTENDED_READ
static final Permission BUILD
static final Permission WORKSPACE
static final Permission WIPEOUT
static final Permission CANCEL
Method Detail |
---|
ItemGroup<? extends Item> getParent()
Collection<? extends Job> getAllJobs()
Item
contains as descendants.
String getName()
The name must be unique among other Item
s that belong
to the same parent.
This name is also used for directory name, so it cannot contain any character that's not allowed on the file system.
getFullName()
String getFullName()
Full name consists of name
s of Item
s
that lead from the root Jenkins
to this Item
,
separated by '/'. This is the unique name that identifies this
Item
inside the whole Jenkins
.
Jenkins.getItemByFullName(String,Class)
String getDisplayName()
This method should try to return a short concise human readable string that describes this item. The string need not be unique.
The returned string should not include the display names
of ancestor items
.
getDisplayName
in interface ModelObject
String getFullDisplayName()
getDisplayName()
but return
the full path that includes all the display names
of the ancestors.
String getRelativeNameFrom(ItemGroup g)
String getRelativeNameFrom(Item item)
getRelativeNameFrom(item.getParent())
String getUrl()
for how to implement this.
String getShortUrl()
ItemGroup
.
for how to implement this.
String getAbsoluteUrl()
StaplerRequest
to figure out what the host name is,
so can be used only during processing client requests.
IllegalStateException
- if the method is invoked outside the HTTP request processing.void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Item
is loaded from disk.
This is an opporunity to do a post load processing.
name
- Name of the directory (not a path --- just the name portion) from
which the configuration was loaded. This usually becomes the
name
of this item.
IOException
void onCopiedFrom(Item src)
Item
is copied from existing one,
the files are first copied on the file system,
then it will be loaded, then this method will be invoked
to perform any implementation-specific work.
void onCreatedFromScratch()
void save() throws IOException
Items.getConfigFile(Item)
or AbstractItem.getConfigFile()
to obtain the file
to save the data.
save
in interface Saveable
IOException
- if the persistence failed.void delete() throws IOException, InterruptedException
IOException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |