hudson.model.Job.getAction()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中hudson.model.Job.getAction()方法的一些代码示例,展示了Job.getAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getAction()方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:getAction

Job.getAction介绍

暂无

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/disk-usage

/**
 * @return DiskUsage for given project (shortcut for the view). Never null.
 */
public ProjectDiskUsageAction getDiskUsage(Job project) {
  ProjectDiskUsageAction action = project.getAction(ProjectDiskUsageAction.class);
  return action;
}

代码示例来源:origin: jenkinsci/promoted-builds-plugin

public PromotedProjectAction getAction(Job job) {
  PromotedProjectAction action = job.getAction(PromotedProjectAction.class);
  return action;
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public <T extends Action> T superGetAction(Class<T> type) {
  return super.getAction(type);
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public Action superGetAction(int index) {
  return super.getAction(index);
}

代码示例来源:origin: KostyaSha/github-integration-plugin

@CheckForNull
public static GitHubBranchRepository getBranchRepositoryFor(Item item) {
  if (item instanceof Job) {
    Job<?, ?> job = (Job) item;
    return job.getAction(GitHubBranchRepository.class);
  }
  return null;
}

代码示例来源:origin: KostyaSha/github-integration-plugin

@CheckForNull
  public static GitHubPRRepository getPRRepositoryFor(Item item) {
    if (item instanceof Job) {
      Job<?, ?> job = (Job) item;
      return job.getAction(GitHubPRRepository.class);
    }

    return null;
  }
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
 * Selects the action to show the results from. This default implementation
 * simply returns the first action that matches the given type.
 *
 * @param job
 *            the job to get the action from
 * @return the action
 */
protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) {
  return job.getAction(getAction());
}

代码示例来源:origin: jenkinsci/cobertura-plugin

private CoberturaBuildAction getAction(final Job<?, ?> project) {
  CoberturaProjectAction action = project.getAction(CoberturaProjectAction.class);
  if (action != null) {
    return action.getLastResult();
  }
  return null;
}

代码示例来源:origin: jenkinsci/analysis-core-plugin

/**
 * Selects the action to show the results from. This default implementation
 * simply returns the first action that matches the given type.
 *
 * @param job
 *            the job to get the action from
 * @return the action
 */
protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) {
  return job.getAction(getAction());
}

代码示例来源:origin: jenkinsci/analysis-core-plugin

private T getProjectAction(final Job<?, ?> project) {
  return project.getAction(getProjectAction());
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
   * Selects the action to show the results from. This default implementation
   * simply returns the first action that matches the given type.
   *
   * @param job
   *            the job to get the action from
   * @return the action
   */
  @CheckForNull
  protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) {
    if (job == null) {
      return null;
    }
    else {
      return job.getAction(getAction());
    }
  }
}

代码示例来源:origin: jenkinsci/analysis-core-plugin

/**
   * Selects the action to show the results from. This default implementation
   * simply returns the first action that matches the given type.
   *
   * @param job
   *            the job to get the action from
   * @return the action
   */
  @CheckForNull
  protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) {
    if (job == null) {
      return null;
    }
    else {
      return job.getAction(getAction());
    }
  }
}

代码示例来源:origin: Argelbargel/gitlab-branch-source-plugin

private GitLabSCMHeadMetadataAction getMetadataAction(Run<?, ?> build) {
    GitLabSCMHeadMetadataAction metadata = build.getAction(GitLabSCMHeadMetadataAction.class);
    if (metadata == null) {
      metadata = build.getParent().getAction(GitLabSCMHeadMetadataAction.class);
    }

    return metadata;
  }
}

代码示例来源:origin: org.hudsonci.plugins/disk-usage

/**
 * @return DiskUsage for given project (shortcut for the view). Never null.
 */
public static DiskUsage getDiskUsage(Job project) {
  ProjectDiskUsageAction action = project.getAction(ProjectDiskUsageAction.class);
  if (action != null) {
    return action.getDiskUsage();
  }
  
  return new DiskUsage(0, 0);
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public <T extends Action> T getAction(Class<T> type) {
  initPython();
  if (pexec.isImplemented(105)) {
    return (T) pexec.execPython("get_action", type);
  } else {
    return super.getAction(type);
  }
}

代码示例来源:origin: Argelbargel/gitlab-branch-source-plugin

@Override
public void onCompleted(Run<?, ?> build, @Nonnull TaskListener listener) {
  GitLabSCMHeadMetadataAction metadata = getMetadataAction(build);
  GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class);
  if (metadata != null && publishAction != null) {
    publishAction.publishResult(build, metadata);
  }
  if (build.getResult() == SUCCESS) {
    GitLabSCMAcceptMergeRequestAction acceptAction = build.getParent().getAction(GitLabSCMAcceptMergeRequestAction.class);
    if (acceptAction != null) {
      acceptAction.acceptMergeRequest(build, listener);
    }
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public Action getAction(int index) {
  initPython();
  if (pexec.isImplemented(104)) {
    return (Action) pexec.execPython("get_action", DataConvertor.fromInt(index));
  } else {
    return super.getAction(index);
  }
}

代码示例来源:origin: Argelbargel/gitlab-branch-source-plugin

@Override
public void onStarted(Run<?, ?> build, TaskListener listener) {
  GitLabSCMHeadMetadataAction metadata = getMetadataAction(build);
  GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class);
  if (metadata != null && publishAction != null) {
    GitLabSCMCauseAction cause = build.getAction(GitLabSCMCauseAction.class);
    String description = (cause != null) ? cause.getDescription() : "";
    publishAction.updateBuildDescription(build, description, listener);
    publishAction.publishStarted(build, metadata, description);
  }
}

代码示例来源:origin: jenkinsci/cobertura-plugin

CoberturaProjectAction action = project.getAction(CoberturaProjectAction.class);

代码示例来源:origin: org.jvnet.hudson.plugins/dashboard-view

TestResultProjectAction testResults = job.getAction(TestResultProjectAction.class);

相关文章

微信公众号

最新文章

更多

Job类方法