I
- the child item typepublic abstract class ComputedFolder<I extends TopLevelItem> extends AbstractFolder<I> implements BuildableItem, Queue.FlyweightTask
Item.CONFIGURE
to anyone.AbstractFolder.ItemListenerImpl, AbstractFolder.RunListenerImpl
ExtensionPoint.LegacyInstancesAreScopedToHudson
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem
items
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
Modifier | Constructor and Description |
---|---|
protected |
ComputedFolder(ItemGroup parent,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
addTrigger(Trigger trigger)
Update an existing trigger or add a new one.
|
void |
checkAbortPermission() |
protected void |
checkRename(String newName) |
protected abstract void |
computeChildren(ChildObserver<I> observer,
TaskListener listener)
Called to (re-)compute the set of children of this folder.
|
protected FolderComputation<I> |
createComputation(FolderComputation<I> previous) |
protected ChildObserver<I> |
createEventsChildObserver()
Deprecated.
|
FolderComputation<I> |
createExecutable() |
org.kohsuke.stapler.HttpResponse |
doBuild(TimeDuration delay) |
void |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
List<Action> |
getActions() |
Label |
getAssignedLabel() |
CauseOfBlockage |
getCauseOfBlockage() |
FolderComputation<I> |
getComputation()
URL binding and other purposes.
|
protected File |
getComputationDir() |
org.acegisecurity.Authentication |
getDefaultAuthentication() |
org.acegisecurity.Authentication |
getDefaultAuthentication(Queue.Item item) |
long |
getEstimatedDuration() |
Node |
getLastBuiltOn() |
PseudoRun<I> |
getLastFailedBuild() |
PseudoRun<I> |
getLastStableBuild() |
PseudoRun<I> |
getLastSuccessfulBuild() |
OrphanedItemStrategy |
getOrphanedItemStrategy() |
List<OrphanedItemStrategyDescriptor> |
getOrphanedItemStrategyDescriptors()
Gets the
OrphanedItemStrategyDescriptor s applicable to this folder. |
Queue.Task |
getOwnerTask() |
ResourceList |
getResourceList() |
Object |
getSameNodeConstraint() |
Collection<? extends SubTask> |
getSubTasks() |
protected String |
getSuccessfulDestination()
Where user will be redirected after creating or reconfiguring a
AbstractFolder . |
List<TriggerDescriptor> |
getTriggerDescriptors() |
Map<TriggerDescriptor,Trigger<?>> |
getTriggers() |
String |
getWhyBlocked()
Deprecated.
|
boolean |
hasAbortPermission() |
protected void |
init() |
boolean |
isBuildable()
Whether it is permissible to recompute this folder at this time.
|
boolean |
isBuildBlocked() |
boolean |
isConcurrentBuild() |
boolean |
isDisabled()
Is this folder disabled.
|
boolean |
isHasEvents()
Identifies if this
ComputedFolder has a separate out of band events log. |
void |
onCreatedFromScratch() |
void |
onLoad(ItemGroup<? extends Item> parent,
String name) |
protected ChildObserver<I> |
openEventsChildObserver()
Opens a new
ChildObserver that subclasses can use when handling events that might create new / update
existing child items. |
protected Collection<I> |
orphanedItems(Collection<I> orphaned,
TaskListener listener)
Hook called when some items are no longer in the list.
|
protected void |
recalculateAfterSubmitted(boolean recalculate)
Method for child classes to use if they want to suppress/confirm the automatic recalculation provided in
doConfigSubmit(StaplerRequest, StaplerResponse) . |
void |
removeTrigger(Trigger trigger)
Remove an existing trigger.
|
boolean |
scheduleBuild() |
boolean |
scheduleBuild(Cause c) |
boolean |
scheduleBuild(int quietPeriod) |
boolean |
scheduleBuild(int quietPeriod,
Cause c) |
Queue.Item |
scheduleBuild2(int quietPeriod,
Action... actions)
|
protected void |
setDisabled(boolean disabled)
Sets the folder as disabled.
|
void |
setOrphanedItemStrategy(OrphanedItemStrategy strategy) |
protected void |
submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
boolean |
supportsMakeDisabled()
Determines whether the folder supports being made disabled.
|
addProperty, addView, canDelete, delete, deleteView, doChildrenContextMenu, doCreateView, doDisable, doEnable, doLastBuild, doSubmitDescription, doViewExistsCheck, getAllJobs, getBuildHealth, getBuildHealthReports, getDescriptor, getFolderViews, getHealthMetrics, getIcon, getIconColor, getItem, getItemGroup, getItems, getItems, getJob, getJobsDir, getOverrides, getPrimaryView, getPronoun, getProperties, getRootDirFor, getRootDirFor, getStaplerFallback, getUrlChildPrefix, getView, getViewActions, getViews, getViewsTabBar, hasVisibleItems, initViews, invalidateBuildHealthReports, isNameEditable, itemsPut, loadChildren, loadJobTotal, makeDisabled, makeSearchIndex, newDefaultFolderIcon, newDefaultViewsTabBar, newFolderViewHolder, onDeleted, onRenamed, onViewRenamed, renameBlocker, renameTo, resetFolderViews, save, setIcon, setPrimaryView
delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSetName, getAbsoluteUrl, getACL, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, movedTo, onCopiedFrom, performDelete, resolveForCLI, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, save
getRootDir
getSearch
getSearchIndex, getSearchName, getSearchUrl
checkPermission, getACL, hasPermission, hasPermission
getAffinityKey, getFullDisplayName, getName, getUrl
getDisplayName
allItems, allItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getUrl
getAllViews, getUrl
getDescriptorByName
protected void init()
init
in class AbstractFolder<I extends TopLevelItem>
public void onCreatedFromScratch()
onCreatedFromScratch
in interface Item
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
AbstractFolder
onLoad
in interface Item
onLoad
in class AbstractFolder<I extends TopLevelItem>
IOException
protected abstract void computeChildren(ChildObserver<I> observer, TaskListener listener) throws IOException, InterruptedException
Thread.interrupted()
status and throws a InterruptedException
if set at least once every 5
seconds to allow the user to interrupt a computation..observer
- how to indicate which children should be seenlistener
- a way to report progressIOException
- if there was an IOException
during the computation.InterruptedException
- if the computation was interrupted.protected Collection<I> orphanedItems(Collection<I> orphaned, TaskListener listener) throws IOException, InterruptedException
Item.delete()
or ItemGroup.onDeleted(T)
or ItemListener.fireOnDeleted(hudson.model.Item)
yourself.
By default, uses getOrphanedItemStrategy()
.orphaned
- a nonempty set of items which no longer are supposed to be herelistener
- the listener to report decisions to.orphaned
, representing those children which ought to be removed from the folder
now; items not listed will be left alone for the timeIOException
- if there was an I/O issue processing the items.InterruptedException
- if interrupted while processing the items.public void setOrphanedItemStrategy(@Nonnull OrphanedItemStrategy strategy)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) protected final ChildObserver<I> createEventsChildObserver()
openEventsChildObserver()
ChildObserver
that subclasses can use when handling events that might create new / update
existing child items. The handling of orphaned items is a responsibility of the OrphanedItemStrategy
which is only applied as part of a full computation.ChildObserver
for event handling.protected final ChildObserver<I> openEventsChildObserver()
ChildObserver
that subclasses can use when handling events that might create new / update
existing child items. The handling of orphaned items is a responsibility of the OrphanedItemStrategy
which is only applied as part of a full computation.ChildObserver
for event handling. The caller must ChildObserver.close()
when done.public boolean isDisabled()
isDisabled
in class AbstractFolder<I extends TopLevelItem>
true
if and only if the folder is disabled.FolderJobQueueDecisionHandler
protected void setDisabled(boolean disabled)
setDisabled
in class AbstractFolder<I extends TopLevelItem>
disabled
- true
if and only if the folder is to be disabled.public boolean supportsMakeDisabled()
supportsMakeDisabled
in class AbstractFolder<I extends TopLevelItem>
true
if and only if AbstractFolder.setDisabled(boolean)
is implementedpublic void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException
doConfigSubmit
in class AbstractFolder<I extends TopLevelItem>
IOException
javax.servlet.ServletException
Descriptor.FormException
protected final void recalculateAfterSubmitted(boolean recalculate)
doConfigSubmit(StaplerRequest, StaplerResponse)
. This method should only be called from
submit(StaplerRequest, StaplerResponse)
. If called multiple times from
submit(StaplerRequest, StaplerResponse)
then all calls must be with the false
parameter
to suppress recalculation.recalculate
- true
to require recalculation, false
to suppress recalculation.submit(StaplerRequest, StaplerResponse)
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException
submit
in class AbstractFolder<I extends TopLevelItem>
IOException
javax.servlet.ServletException
Descriptor.FormException
recalculateAfterSubmitted(boolean)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @Nonnull protected final String getSuccessfulDestination()
AbstractFolder
.getSuccessfulDestination
in class AbstractFolder<I extends TopLevelItem>
HttpServletResponse.sendRedirect(String)
public Map<TriggerDescriptor,Trigger<?>> getTriggers()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<TriggerDescriptor> getTriggerDescriptors()
public void addTrigger(Trigger trigger)
trigger
- Target trigger instance.public void removeTrigger(Trigger trigger)
trigger
- Target trigger instance.public List<Action> getActions()
getActions
in class Actionable
public boolean isBuildable()
true
if this folder can currently be recomputed.public org.kohsuke.stapler.HttpResponse doBuild(@QueryParameter TimeDuration delay)
@CheckForNull public Queue.Item scheduleBuild2(int quietPeriod, Action... actions)
quietPeriod
- seconds to wait before starting (normally 0)actions
- various actions to associate with the scheduling, such as ParametersAction
or
CauseAction
public boolean scheduleBuild()
scheduleBuild
in interface BuildableItem
public boolean scheduleBuild(Cause c)
scheduleBuild
in interface BuildableItem
public boolean scheduleBuild(int quietPeriod)
scheduleBuild
in interface BuildableItem
public boolean scheduleBuild(int quietPeriod, Cause c)
scheduleBuild
in interface BuildableItem
public boolean isBuildBlocked()
isBuildBlocked
in interface Queue.Task
@Deprecated public String getWhyBlocked()
getWhyBlocked
in interface Queue.Task
public CauseOfBlockage getCauseOfBlockage()
getCauseOfBlockage
in interface Queue.Task
public void checkAbortPermission()
checkAbortPermission
in interface Queue.Task
public boolean hasAbortPermission()
hasAbortPermission
in interface Queue.Task
public boolean isConcurrentBuild()
isConcurrentBuild
in interface Queue.Task
public Collection<? extends SubTask> getSubTasks()
getSubTasks
in interface Queue.Task
public org.acegisecurity.Authentication getDefaultAuthentication()
getDefaultAuthentication
in interface Queue.Task
public org.acegisecurity.Authentication getDefaultAuthentication(Queue.Item item)
getDefaultAuthentication
in interface Queue.Task
public Label getAssignedLabel()
getAssignedLabel
in interface SubTask
public Node getLastBuiltOn()
getLastBuiltOn
in interface SubTask
public long getEstimatedDuration()
getEstimatedDuration
in interface SubTask
public final FolderComputation<I> createExecutable() throws IOException
createExecutable
in interface SubTask
IOException
@Nonnull protected FolderComputation<I> createComputation(@CheckForNull FolderComputation<I> previous)
public Queue.Task getOwnerTask()
getOwnerTask
in interface SubTask
public Object getSameNodeConstraint()
getSameNodeConstraint
in interface SubTask
public ResourceList getResourceList()
getResourceList
in interface ResourceActivity
protected File getComputationDir()
public boolean isHasEvents()
ComputedFolder
has a separate out of band events log. Default implementation
just checks if the events log has content. Subclasses can override this method to force the events log
always present in the UI.true
if this ComputedFolder
has a separate out of band events log.@Nonnull public FolderComputation<I> getComputation()
null
temporarily inside the constructor, so beware if you extend this class.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public PseudoRun<I> getLastSuccessfulBuild()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public PseudoRun<I> getLastStableBuild()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public PseudoRun<I> getLastFailedBuild()
protected void checkRename(String newName)
checkRename
in class AbstractFolder<I extends TopLevelItem>
@NonNull public OrphanedItemStrategy getOrphanedItemStrategy()
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @NonNull public List<OrphanedItemStrategyDescriptor> getOrphanedItemStrategyDescriptors()
OrphanedItemStrategyDescriptor
s applicable to this folder.OrphanedItemStrategyDescriptor
s applicable to this folder.Copyright © 2016–2020. All rights reserved.