Class ReferenceBuild
java.lang.Object
io.jenkins.plugins.forensics.reference.ReferenceBuild
- All Implemented Interfaces:
Action
,ModelObject
,Serializable
,RunAction2
,org.kohsuke.stapler.StaplerProxy
public class ReferenceBuild
extends Object
implements RunAction2, Serializable, org.kohsuke.stapler.StaplerProxy
Stores the selected reference build for a given build. The reference build is a build in a different (or same)
Jenkins job that can be used to compute delta reports.
- Author:
- Ullrich Hafner
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Indicates that no reference build has been found. -
Constructor Summary
ConstructorsConstructorDescriptionReferenceBuild
(Run<?, ?> owner, List<String> messages) Deprecated.ReferenceBuild
(Run<?, ?> owner, List<String> messages, Result requiredResult) Creates a new instance ofReferenceBuild
that indicates that no reference build has been found.ReferenceBuild
(Run<?, ?> owner, List<String> messages, Result requiredResult, Run<?, ?> referenceBuild) Creates a new instance ofReferenceBuild
that points to the specified reference build.ReferenceBuild
(Run<?, ?> owner, List<String> messages, Run<?, ?> referenceBuild) Deprecated.useReferenceBuild(Run, List, Result, Run)
instead -
Method Summary
Modifier and TypeMethodDescriptionRun
<?, ?> getOwner()
Returns the actual reference build.Returns the ID of the reference build.static String
getReferenceBuildLink
(String referenceBuildId) Returns a link that can be used in Jelly views to navigate to the reference build.Returns a link that can be used in Jelly views to navigate to the reference build.Returns the required build result of the chosen reference build.Returns the detail view for the messages captured during the computation of the reference build.boolean
Determines if a reference build has been recorded or not.void
onAttached
(Run<?, ?> run) void
protected Object
Called after deserialization to retain backward compatibility.
-
Field Details
-
NO_REFERENCE_BUILD
Indicates that no reference build has been found. Note that this value is not used when the build has been found initially but has been deleted afterward.- See Also:
-
-
Constructor Details
-
ReferenceBuild
Creates a new instance ofReferenceBuild
that indicates that no reference build has been found.- Parameters:
owner
- the current run as the owner of this actionmessages
- messages that show the steps the resolution processrequiredResult
- the required build result of the chosen reference build
-
ReferenceBuild
public ReferenceBuild(Run<?, ?> owner, List<String> messages, Result requiredResult, Run<?, ?> referenceBuild) Creates a new instance ofReferenceBuild
that points to the specified reference build.- Parameters:
owner
- the current build as the owner of this actionmessages
- messages that show the steps of the resolution processrequiredResult
- the required build result of the chosen reference buildreferenceBuild
- the found reference build
-
ReferenceBuild
Deprecated.useReferenceBuild(Run, List, Result)
insteadCreates a new instance ofReferenceBuild
that indicates that no reference build has been found.- Parameters:
owner
- the current run as the owner of this actionmessages
- messages that show the steps the resolution process
-
ReferenceBuild
Deprecated.useReferenceBuild(Run, List, Result, Run)
insteadCreates a new instance ofReferenceBuild
that points to the specified reference build.- Parameters:
owner
- the current build as the owner of this actionmessages
- messages that show the steps of the resolution processreferenceBuild
- the found reference build
-
-
Method Details
-
getReferenceBuildLink
Returns a link that can be used in Jelly views to navigate to the reference build.- Parameters:
referenceBuildId
- ID of the reference build- Returns:
- the link
-
readResolve
Called after deserialization to retain backward compatibility.- Returns:
- this
-
onAttached
- Specified by:
onAttached
in interfaceRunAction2
-
onLoad
- Specified by:
onLoad
in interfaceRunAction2
-
getOwner
-
getMessages
-
getReferenceLink
Returns a link that can be used in Jelly views to navigate to the reference build.- Returns:
- the link
-
hasReferenceBuild
public boolean hasReferenceBuild()Determines if a reference build has been recorded or not.- Returns:
true
if a reference build has been recorded,false
if not
-
getReferenceBuildId
Returns the ID of the reference build. If no reference build is available, then the constant stringNO_REFERENCE_BUILD
will be returned.- Returns:
- the ID of the reference build
-
getReferenceBuild
Returns the actual reference build. Note that a reference build might be not available anymore, because it has been deleted in the meantime.- Returns:
- the reference build, if still available
-
getRequiredResult
Returns the required build result of the chosen reference build.- Returns:
- the required build result
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-
getTarget
Returns the detail view for the messages captured during the computation of the reference build.- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
- Returns:
- the detail view for the messages
-
ReferenceBuild(Run, List, Result)
instead