Class StandardHandler
- java.lang.Object
-
- com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
-
- com.cloudbees.hudson.plugins.folder.relocate.StandardHandler
-
- All Implemented Interfaces:
ExtensionPoint
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension(ordinal=-1000.0) public final class StandardHandler extends RelocationHandler
Handler which can move items which are bothAbstractItem
andTopLevelItem
into aDirectlyModifiableTopLevelItemGroup
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
RelocationHandler.HandlingMode
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description StandardHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelocationHandler.HandlingMode
applicability(Item item)
Checks quickly whether this handler might be able to move a given item.org.kohsuke.stapler.HttpResponse
handle(Item item, ItemGroup<?> destination, AtomicReference<Item> newItem, List<? extends RelocationHandler> chain)
Possibly handles redirecting an item.boolean
hasValidDestination(Item item)
List<? extends ItemGroup<?>>
validDestinations(Item item)
Gathers a list of possible destinations to which an item may be moved.
-
-
-
Method Detail
-
applicability
public RelocationHandler.HandlingMode applicability(Item item)
Description copied from class:RelocationHandler
Checks quickly whether this handler might be able to move a given item.- Specified by:
applicability
in classRelocationHandler
- Parameters:
item
- an item which the user wishes to move- Returns:
- how this handler might handle the given item
-
handle
public org.kohsuke.stapler.HttpResponse handle(Item item, ItemGroup<?> destination, AtomicReference<Item> newItem, List<? extends RelocationHandler> chain) throws IOException, InterruptedException
Description copied from class:RelocationHandler
Possibly handles redirecting an item.- Specified by:
handle
in classRelocationHandler
- Parameters:
item
- an item which the user wishes to movedestination
- the location the user wishes to move it tonewItem
- if moving succeeds, set this to the new item (typically same object asitem
)chain
- zero or more remaining handlers which could be delegated to (may call this method on the first and pass in the rest of the chain)- Returns:
Failure
if the move is known to not be able to proceed, or a custom response such as a redirect, or a delegated response from the first handler in the chain, or null if no HTTP response is warranted or possible- Throws:
IOException
- if the move was attempted but failedInterruptedException
- if the move was attempted but was interrupted
-
hasValidDestination
public boolean hasValidDestination(Item item)
-
validDestinations
public List<? extends ItemGroup<?>> validDestinations(Item item)
Description copied from class:RelocationHandler
Gathers a list of possible destinations to which an item may be moved. The union of all destinations from various handlers is used.- Specified by:
validDestinations
in classRelocationHandler
- Parameters:
item
- an item which the user wishes to move- Returns:
- potential destinations (may be empty if this handler does not need to add new kinds of destinations)
-
-