congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Queue$Item.getWhy
Code IndexAdd Tabnine to your IDE (free)

How to use
getWhy
method
in
hudson.model.Queue$Item

Best Java code snippets using hudson.model.Queue$Item.getWhy (Showing top 20 results out of 315)

origin: jenkinsci/docker-slaves-plugin

  @Override public void run() {
    Queue.Item item = Queue.getInstance().getItem(task);
    if (item != null) {
      PrintStream logger;
      try {
        logger = listener.getLogger();
      } catch (Exception x) { // IOException, InterruptedException
        LOGGER.log(WARNING, null, x);
        return;
      }
      logger.println("Still waiting to schedule task");
      String why = item.getWhy();
      if (why != null) {
        logger.println(why);
      }
    }
  }
}, 15, TimeUnit.SECONDS);
origin: io.jenkins.plugins/docker-slaves

  @Override public void run() {
    Queue.Item item = Queue.getInstance().getItem(task);
    if (item != null) {
      PrintStream logger;
      try {
        logger = listener.getLogger();
      } catch (Exception x) { // IOException, InterruptedException
        LOGGER.log(WARNING, null, x);
        return;
      }
      logger.println("Still waiting to schedule task");
      String why = item.getWhy();
      if (why != null) {
        logger.println(why);
      }
    }
  }
}, 15, TimeUnit.SECONDS);
origin: groupon/DotCi

@Override
public BuildCause.CommitInfo getCommit() {
  final String[] buildParams = StringUtils.split(this.item.getParams(), "\n");
  String branch = "";
  for (final String buildParam : buildParams) {
    if (buildParam.startsWith("BRANCH=")) {
      branch = StringUtils.split(buildParam, "=")[1];
    }
  }
  return new BuildCause.CommitInfo("Queued: " + this.item.getWhy(), this.item.getInQueueForString(), branch);
}
origin: org.eclipse.hudson/hudson-core

String why = qi.getWhy();
if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) {
  listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
origin: org.jvnet.hudson.main/hudson-core

String why = qi.getWhy();
if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) {
  listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
origin: org.jenkins-ci.plugins/matrix-project

String why = qi.getWhy();
if(why != null && !why.equals(whyInQueue) && System.currentTimeMillis()-startTime>5000) {
origin: hudson/hudson-2.x

String why = qi.getWhy();
if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) {
  listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
origin: org.jenkins-ci.plugins/pipeline-build-step

@Override public String getStatus() {
  for (Queue.Item i : Queue.getInstance().getItems()) {
    for (BuildTriggerAction.Trigger trigger : BuildTriggerAction.triggersFor(i)) {
      if (trigger.context.equals(getContext())) {
        return "waiting to schedule " + i.task.getFullDisplayName() + "; blocked: " + i.getWhy();
      }
    }
  }
  for (Computer c : Jenkins.getActiveInstance().getComputers()) {
    for (Executor e : c.getExecutors()) {
      String r = running(e);
      if (r != null) {
        return r;
      }
    }
    for (Executor e : c.getOneOffExecutors()) {
      String r = running(e);
      if (r != null) {
        return r;
      }
    }
  }
  // TODO QueueTaskFuture does not allow us to record the queue item ID
  return "unsure what happened to downstream build";
}
private @CheckForNull String running(@Nonnull Executor e) {
origin: jenkinsci/instant-messaging-plugin

public void executeCommand(Bot bot, IMChat chat, IMMessage message,
              Sender sender, String[] args) throws IMException {
  Queue queue = Hudson.getInstance().getQueue();
  Item[] items = queue.getItems();
  String reply;
  if (items.length > 0) {
    StringBuffer msg = new StringBuffer();
    msg.append("Build queue:");
    for (Item item : queue.getItems()) {
      msg.append("\n- ")
      .append(item.task.getFullDisplayName())
      .append(": ").append(item.getWhy());
    }
    reply = msg.toString();
  } else {
    reply = "build queue is empty";
  }
  
  chat.sendMessage(reply);
}
origin: org.jenkins-ci.plugins.workflow/workflow-durable-task-step

@Override public String getStatus() {
  // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable?
  for (Queue.Item item : Queue.getInstance().getItems()) {
    if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) {
      return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy();
    }
  }
  Jenkins j = Jenkins.getInstance();
  if (j != null) {
    COMPUTERS: for (Computer c : j.getComputers()) {
      for (Executor e : c.getExecutors()) {
        Queue.Executable exec = e.getCurrentExecutable();
        if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) {
          return "running on " + c.getName();
        }
      }
    }
  }
  return "node block appears to be neither running nor scheduled";
}
origin: org.jenkins-ci.plugins/matrix-project

  /**
   * Gets a tooltip from the item.
   * @return Tooltip or null if it cannot be retrieved.
   */
  public @CheckForNull String getTooltip() {
    MatrixRun r = getRun();
    if (r!=null) {
      return r.getIconColor().getDescription();
    }
    
    final Jenkins jenkins = Jenkins.getInstance();
    if (jenkins == null) {
      return null;
    }
    Queue.Item item = jenkins.getQueue().getItem(getParent().getItem(combination));
    if(item!=null)
      return item.getWhy();
    return null;    // fall back
  }
}
origin: io.jenkins.plugins/docker-slaves

@Override public String getStatus() {
  // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable?
  for (Queue.Item item : Queue.getInstance().getItems()) {
    if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) {
      return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy();
    }
  }
  Jenkins j = Jenkins.getInstance();
  if (j != null) {
    COMPUTERS: for (Computer c : j.getComputers()) {
      for (Executor e : c.getExecutors()) {
        Queue.Executable exec = e.getCurrentExecutable();
        if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) {
          return "running on " + c.getName();
        }
      }
    }
  }
  return "node block appears to be neither running nor scheduled";
}
origin: org.hudsonci.plugins/instant-messaging

public void executeCommand(Bot bot, IMChat chat, IMMessage message,
              Sender sender, String[] args) throws IMException {
  Queue queue = Hudson.getInstance().getQueue();
  Item[] items = queue.getItems();
  String reply;
  if (items.length > 0) {
    StringBuffer msg = new StringBuffer();
    msg.append("Build queue:");
    for (Item item : queue.getItems()) {
      msg.append("\n- ")
      .append(item.task.getFullDisplayName())
      .append(": ").append(item.getWhy());
    }
    reply = msg.toString();
  } else {
    reply = "build queue is empty";
  }
  
  chat.sendMessage(reply);
}
origin: jenkinsci/docker-slaves-plugin

@Override public String getStatus() {
  // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable?
  for (Queue.Item item : Queue.getInstance().getItems()) {
    if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) {
      return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy();
    }
  }
  Jenkins j = Jenkins.getInstance();
  if (j != null) {
    COMPUTERS: for (Computer c : j.getComputers()) {
      for (Executor e : c.getExecutors()) {
        Queue.Executable exec = e.getCurrentExecutable();
        if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) {
          return "running on " + c.getName();
        }
      }
    }
  }
  return "node block appears to be neither running nor scheduled";
}
origin: org.jenkins-ci.plugins.workflow/workflow-durable-task-step

  @Override public void run() {
    Queue.Item item = Queue.getInstance().getItem(task);
    if (item != null) {
      PrintStream logger;
      try {
        logger = getContext().get(TaskListener.class).getLogger();
      } catch (Exception x) { // IOException, InterruptedException
        LOGGER.log(WARNING, null, x);
        return;
      }
      logger.println("Still waiting to schedule task");
      String why = item.getWhy();
      if (why != null) {
        logger.println(why);
      }
    }
  }
}, 15, TimeUnit.SECONDS);
origin: hudson/hudson-2.x

public String getTooltip() {
  MatrixRun r = getRun();
  if (r != null) {
    return r.getIconColor().getDescription();
  }
  Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination));
  if (item != null) {
    return item.getWhy();
  }
  return null;    // fall back
}
origin: org.eclipse.hudson.main/hudson-core

public String getTooltip() {
  MatrixRun r = getRun();
  if (r != null) {
    return r.getIconColor().getDescription();
  }
  Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination));
  if (item != null) {
    return item.getWhy();
  }
  return null;    // fall back
}
origin: org.eclipse.hudson/hudson-core

public String getTooltip() {
  MatrixRun r = getRun();
  if (r != null) {
    return r.getIconColor().getDescription();
  }
  Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination));
  if (item != null) {
    return item.getWhy();
  }
  return null;    // fall back
}
origin: org.jvnet.hudson.main/hudson-core

public String getTooltip() {
  MatrixRun r = getRun();
  if (r != null) {
    return r.getIconColor().getDescription();
  }
  Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination));
  if (item != null) {
    return item.getWhy();
  }
  return null;    // fall back
}
origin: groupon/DotCi

  public String getTooltip() {
    final Build r = getRun();
    if (r != null) {
      return r.getIconColor().getDescription();
    }
    final Queue.Item item = Jenkins.getInstance().getQueue().getItem(this.dynamicBuild.getParent().getItem(this.combination));
    if (item != null) {
      return item.getWhy();
    }
    return null; // fall back
  }
}
hudson.modelQueue$ItemgetWhy

Javadoc

Gets a human-readable status message describing why it's in the queue.

Popular methods of Queue$Item

  • getAction
  • getCauses
    Convenience method that returns a read only view of the Causes associated with this item in the queu
  • getId
    Unique ID (per master) that tracks the Task as it moves through different stages in the queue (each
  • getFuture
    Can be used to wait for the completion (either normal, abnormal, or cancellation) of the Task. Just
  • getActions
  • getCauseOfBlockage
    Gets an object that describes why this item is in the queue.
  • addAction
  • getUrl
    Returns the URL of this Item relative to the context path of Jenkins
  • getInQueueSince
    Since when is this item in the queue.
  • onCancelled
    Participates in the cancellation logic to set the #future accordingly.
  • getAllActions
  • getInQueueForString
    Returns a human readable presentation of how long this item is already in the queue. E.g. something
  • getAllActions,
  • getInQueueForString,
  • isBlocked,
  • isBuildable,
  • addOrReplaceAction,
  • cancel,
  • enter,
  • getAssignedLabel,
  • getAssignedLabelFor

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Collectors (java.util.stream)
  • JTable (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now