Package jenkins.model
Interface DirectlyModifiableTopLevelItemGroup
-
- All Superinterfaces:
ItemGroup<TopLevelItem>
,ModelObject
,ModifiableItemGroup<TopLevelItem>
,ModifiableTopLevelItemGroup
,PersistenceRoot
,Saveable
public interface DirectlyModifiableTopLevelItemGroup extends ModifiableTopLevelItemGroup
Item group which supports items being directly moved in or out of it.- Since:
- 1.548
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <I extends TopLevelItem>
Iadd(I item, String name)
Adds an item to this group.boolean
canAdd(TopLevelItem item)
Returns true if a particular item may be added to this group.void
remove(TopLevelItem item)
Removes an item from this group.-
Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItem, getItems, getItems, getItemsStream, getItemsStream, getRootDirFor, getUrl, getUrlChildPrefix, onDeleted, onRenamed
-
Methods inherited from interface hudson.model.ModelObject
getDisplayName
-
Methods inherited from interface hudson.model.ModifiableItemGroup
doCreateItem
-
Methods inherited from interface jenkins.model.ModifiableTopLevelItemGroup
copy, createProject, createProjectFromXML
-
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
-
-
-
Method Detail
-
canAdd
boolean canAdd(TopLevelItem item)
Returns true if a particular item may be added to this group.- Parameters:
item
- an item currently elsewhere- Returns:
- true if
add(I, java.lang.String)
may be called with this item
-
add
<I extends TopLevelItem> I add(I item, String name) throws IOException, IllegalArgumentException
Adds an item to this group. UnlikeJenkins.putItem(hudson.model.TopLevelItem)
this does not try to callItem.delete()
on an existing item, nor does it fireItemListener.onCreated(hudson.model.Item)
, nor check permissions. Normally you would callItem.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
after calling this method (the implementation is not expected to do so).- Type Parameters:
I
- the kind of item- Parameters:
item
- an item to add which is currently elsewherename
- the desired item name in this group (might simply be the originalItem.getName()
)- Returns:
- normally the same
item
, but might be a new copy if necessary - Throws:
IOException
- if adding failsIllegalArgumentException
- ifcanAdd(hudson.model.TopLevelItem)
is false, or an item with this name already exists, or this item is as yet unnamed
-
remove
void remove(TopLevelItem item) throws IOException, IllegalArgumentException
Removes an item from this group. UnlikeItemGroup.onDeleted(T)
this is not expected to fire any events.- Parameters:
item
- an item which was part of this group- Throws:
IOException
- if removing failsIllegalArgumentException
- if this was not part of the group to begin with
-
-