Class PipelineNodeUtil

java.lang.Object
io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeUtil

public class PipelineNodeUtil extends Object
Author:
Vivek Pandey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    convertLogToString(AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode> log)
     
    static String
    convertLogToString(AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode> log, Long startByte, boolean html)
     
    static String
    getArgumentsAsString(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static String
    getCauseOfBlockage(org.jenkinsci.plugins.workflow.graph.FlowNode stage, org.jenkinsci.plugins.workflow.graph.FlowNode nodeBlock)
    Gives cause of block for declarative style plugin where agent (node block) is declared inside a stage.
    static String
    getDisplayName(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static String
    getExceptionText(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode>
    getLogText(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static org.jenkinsci.plugins.workflow.actions.TagsAction
    getSyntheticStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isAgentStart(org.jenkinsci.plugins.workflow.graph.FlowNode node)
    Determine if the given FlowNode is the initial StepStartNode for an ExecutorStep.
    static boolean
     
    protected static boolean
    isParallelBlock(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isParallelBranch(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isPaused(org.jenkinsci.plugins.workflow.graph.FlowNode step)
     
    static boolean
    isPausedForInputStep(org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode step, org.jenkinsci.plugins.workflow.support.steps.input.InputAction inputAction)
     
    static boolean
    isPostSyntheticStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isPreSyntheticStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isSkippedStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isSyntheticStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     
    static boolean
    isUnhandledException(org.jenkinsci.plugins.workflow.graph.FlowNode node)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • isLoggable

      public static final com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isLoggable
  • Constructor Details

    • PipelineNodeUtil

      public PipelineNodeUtil()
  • Method Details

    • getDisplayName

      public static String getDisplayName(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isStage

      public static boolean isStage(org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isSyntheticStage

      public static boolean isSyntheticStage(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • getSyntheticStage

      @CheckForNull public static org.jenkinsci.plugins.workflow.actions.TagsAction getSyntheticStage(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isPostSyntheticStage

      public static boolean isPostSyntheticStage(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isSkippedStage

      public static boolean isSkippedStage(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isPreSyntheticStage

      public static boolean isPreSyntheticStage(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isParallelBranch

      public static boolean isParallelBranch(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isUnhandledException

      public static boolean isUnhandledException(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • getArgumentsAsString

      public static String getArgumentsAsString(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • getCauseOfBlockage

      @CheckForNull public static String getCauseOfBlockage(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode stage, @Nullable org.jenkinsci.plugins.workflow.graph.FlowNode nodeBlock)
      Gives cause of block for declarative style plugin where agent (node block) is declared inside a stage.
          pipeline {
            agent none
            stages {
                stage ('first') {
                    agent {
                        label 'first'
                    }
                    steps{
                        sh 'echo "from first"'
                    }
                }
            }
          }
       
      Parameters:
      stage - stage's FlowNode
      nodeBlock - agent or node block's FlowNode
      Returns:
      cause of block if present, nul otherwise
    • isPausedForInputStep

      public static boolean isPausedForInputStep(@NonNull org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode step, @Nullable org.jenkinsci.plugins.workflow.support.steps.input.InputAction inputAction)
    • isPaused

      public static boolean isPaused(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode step)
    • isParallelBlock

      protected static boolean isParallelBlock(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isAgentStart

      public static boolean isAgentStart(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
      Determine if the given FlowNode is the initial StepStartNode for an ExecutorStep.
      Parameters:
      node - a possibly null FlowNode
      Returns:
      true if node is the non-body start of the agent execution.
    • getLogText

      public static AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode> getLogText(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • convertLogToString

      public static String convertLogToString(AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode> log) throws IOException
      Throws:
      IOException
    • convertLogToString

      public static String convertLogToString(AnnotatedLargeText<? extends org.jenkinsci.plugins.workflow.graph.FlowNode> log, Long startByte, boolean html) throws IOException
      Throws:
      IOException
    • getExceptionText

      public static String getExceptionText(@Nullable org.jenkinsci.plugins.workflow.graph.FlowNode node)
    • isJenkinsFailureException

      public static boolean isJenkinsFailureException(Throwable exception)