Class FolderComputation<I extends TopLevelItem>
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- com.cloudbees.hudson.plugins.folder.computed.FolderComputation<I>
-
- All Implemented Interfaces:
ModelObject
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,Runnable
,Loadable
,ModelObjectWithContextMenu
public class FolderComputation<I extends TopLevelItem> extends Actionable implements Queue.Executable, Saveable, Loadable
A particular “run” ofComputedFolder
.- Since:
- 4.11-beta-1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static AlternativeUiTextProvider.Message<FolderComputation>
DISPLAY_NAME
Allow other code to override the display name forFolderComputation
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FolderComputation(ComputedFolder<I> folder, FolderComputation<I> previous)
-
Method Summary
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.model.Queue.Executable
getParentExecutable
-
-
-
-
Field Detail
-
DISPLAY_NAME
public static final AlternativeUiTextProvider.Message<FolderComputation> DISPLAY_NAME
Allow other code to override the display name forFolderComputation
.
-
-
Constructor Detail
-
FolderComputation
protected FolderComputation(@NonNull ComputedFolder<I> folder, @CheckForNull FolderComputation<I> previous)
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
-
save
public void save() throws IOException
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
-
load
public void load() throws IOException
- Specified by:
load
in interfaceLoadable
- Throws:
IOException
-
getLogFile
@NonNull public File getLogFile()
-
getEventsFile
@NonNull public File getEventsFile()
-
createEventsListener
@WithBridgeMethods(hudson.model.TaskListener.class) @NonNull public StreamTaskListener createEventsListener()
-
getDataFile
@NonNull protected XmlFile getDataFile()
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
getSearchUrl
public String getSearchUrl()
- Specified by:
getSearchUrl
in interfaceSearchItem
-
getParent
@NonNull public ComputedFolder<I> getParent()
- Specified by:
getParent
in interfaceQueue.Executable
-
getEstimatedDuration
public long getEstimatedDuration()
- Specified by:
getEstimatedDuration
in interfaceQueue.Executable
-
isBuilding
public boolean isBuilding()
-
isLogUpdated
public boolean isLogUpdated()
-
getLogText
@NonNull public AnnotatedLargeText<FolderComputation<I>> getLogText()
-
getEventsText
@NonNull public AnnotatedLargeText<FolderComputation<I>> getEventsText()
-
writeLogTo
public void writeLogTo(long offset, org.apache.commons.jelly.XMLOutput out) throws IOException
- Throws:
IOException
-
writeWholeLogTo
public void writeWholeLogTo(@NonNull OutputStream out) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
doConsoleText
public void doConsoleText(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Sends out the raw console output.- Parameters:
req
- the requestrsp
- the response.- Throws:
IOException
- if things go wrong.
-
doStop
public org.kohsuke.stapler.HttpResponse doStop() throws IOException, javax.servlet.ServletException
Stops this build if it's still going.- Returns:
- the Http response.
- Throws:
IOException
javax.servlet.ServletException
-
getLogInputStream
@NonNull public InputStream getLogInputStream() throws IOException
Returns an input stream that reads from the log file. It will use a gzip-compressed log file (log.gz) if that exists.- Returns:
- An input stream from the log file. If the log file does not exist, the error message will be returned to the output.
- Throws:
IOException
- if things go wrong
-
getResult
@CheckForNull public Result getResult()
-
getTimestamp
@NonNull public Calendar getTimestamp()
-
getDurationString
@NonNull public String getDurationString()
-
getUrl
@NonNull public String getUrl()
-
getPreviousResult
@CheckForNull public Result getPreviousResult()
-
getIconColor
@NonNull public BallColor getIconColor()
-
getBuildStatusIconClassName
public String getBuildStatusIconClassName()
-
toString
public String toString()
- Specified by:
toString
in interfaceQueue.Executable
- Overrides:
toString
in classObject
-
-