Class LockedResourcesBuildAction
java.lang.Object
org.jenkins.plugins.lockableresources.actions.LockedResourcesBuildAction
- All Implemented Interfaces:
Action,ModelObject
@ExportedBean
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class LockedResourcesBuildAction
extends Object
implements Action
BuildAction for lockable resources.
Shows usage of resources in the build page.
url: jobUrl/buildNr/locked-resources/
Remote API: jobUrl/buildNr/locked-resources/api/json
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidstatic voidAsaddLog(Run, List, String, String), recording the share id of the lock block.voidvoidvoidaddUsedResources(List<String> resourceNames) static LockedResourcesBuildActionfindAndInitAction(Run<?, ?> build) getApi()Exposes this page through the Jenkins remote API.voidremoveUsedResources(List<String> resourceNames) protected ObjectEnsure iteration during XStream marshalling is also synchronized, otherwise we tend to getConcurrentModificationException.
The recommended approach is to copy-on-write the properties so a snapshot can always be scraped consistently.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Action
getDescription, getEvent, getGroup, getSemantic, isVisibleInContextMenu
-
Constructor Details
-
LockedResourcesBuildAction
public LockedResourcesBuildAction()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
getApi
Exposes this page through the Jenkins remote API. Present only on builds that locked a resource; other builds have no such action. -
getCurrentUsedResourceNames
-
addUsedResources
-
removeUsedResources
-
findAndInitAction
-
addLog
-
addLog
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void addLog(Run<?, ?> build, List<String> resourceNames, String step, String action, @CheckForNull String shareId) AsaddLog(Run, List, String, String), recording the share id of the lock block.- Parameters:
shareId- share id of the lock block, ornullwhen the block has none
-
addLog
-
addLog
-
addLog
-
getReadOnlyLogs
@Exported(name="logs") @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<LockedResourcesBuildAction.LogEntry> getReadOnlyLogs() -
getReadOnlyResourcesInUse
-
writeReplace
Ensure iteration during XStream marshalling is also synchronized, otherwise we tend to getConcurrentModificationException.
The recommended approach is to copy-on-write the properties so a snapshot can always be scraped consistently. But this can be costly at run-time, so we use the next-best option: produce a consistent replica of the current object for actual saving only on demand.
This method is found by XStream via reflection.
-