public abstract class ChildObserver<I extends TopLevelItem> extends Object implements AutoCloseable
ComputedFolder
. Methods may be called only inside the scope of
ComputedFolder.computeChildren(com.cloudbees.hudson.plugins.folder.computed.ChildObserver<I>, hudson.model.TaskListener)
or an out-of-band event handler.Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes the
ChildObserver completing any observations that were not completed(String) . |
abstract void |
completed(String name)
Notify the observer that you have completed with the named child and other threads are now permitted to proceed
with observations of the
Item.getName() . |
abstract void |
created(I child)
Notify the observer that you did create a new child.
|
abstract boolean |
mayCreate(String name)
Checks whether we may create a new child of the given name.
|
abstract Set<String> |
observed()
Returns a copy of the item names that have been observed.
|
abstract Map<String,I> |
orphaned()
Returns a copy of the map of orphaned items keyed by name.
|
abstract I |
shouldUpdate(String name)
Checks whether there is an existing child which should be updated.
|
@CheckForNull public abstract I shouldUpdate(String name) throws InterruptedException
completed(String)
after completion of processing the proposed Item.getName()
as otherwise
no other ChildObserver
will be able to proceed with this Item.getName()
.name
- a proposed Item.getName()
null
, in which case continue by checking mayCreate(java.lang.String)
InterruptedException
- if interrupted.public abstract boolean mayCreate(String name)
name
- a proposed Item.getName()
created(I)
(though you are not obliged to do so); false
if you may notpublic abstract void created(I child)
child
- a newly constructed child item; do not call Item.onCreatedFromScratch()
and try to avoid
calls to Item.save()
public abstract void completed(String name)
Item.getName()
.name
- the Item.getName()
.public abstract Set<String> observed()
public abstract Map<String,I> orphaned()
public abstract void close()
ChildObserver
completing any observations that were not completed(String)
.
This method is idempotent.close
in interface AutoCloseable
Copyright © 2016–2020. All rights reserved.