@Extension public static final class Fingerprint.ProjectRenameListener extends ItemListener
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
ProjectRenameListener() |
Modifier and Type | Method and Description |
---|---|
void |
onLocationChanged(Item item,
String oldName,
String newName)
Called after an item’s fully-qualified location has changed.
|
all, checkBeforeCopy, fireLocationChange, fireOnCopied, fireOnCreated, fireOnDeleted, fireOnUpdated, onBeforeShutdown, onCheckCopy, onCopied, onCreated, onDeleted, onLoaded, onRenamed, onUpdated, register
public void onLocationChanged(Item item, String oldName, String newName)
ItemListener
ItemListener.onRenamed(hudson.model.Item, java.lang.String, java.lang.String)
will already have been called on this item or an ancestor.
And where applicable, ItemListener.onLocationChanged(hudson.model.Item, java.lang.String, java.lang.String)
will already have been called on its ancestors.
This method should be used (instead of ItemListener.onRenamed(hudson.model.Item, java.lang.String, java.lang.String)
) by any code
which seeks to keep (absolute) references to items up to date:
if a persisted reference matches oldFullName
, replace it with newFullName
.
onLocationChanged
in class ItemListener
item
- an item whose absolute position is now differentoldName
- the former Item.getFullName()
newName
- the current Item.getFullName()
Items.computeRelativeNamesAfterRenaming(java.lang.String, java.lang.String, java.lang.String, hudson.model.ItemGroup)
Copyright © 2004–2021. All rights reserved.