org.kohsuke.stapler.export.Exported Java Examples

The following examples show how to use org.kohsuke.stapler.export.Exported. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KubernetesComputer.java    From kubernetes-plugin with Apache License 2.0 6 votes vote down vote up
@Exported
public List<Container> getContainers() throws KubernetesAuthException, IOException {
    if(!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
        LOGGER.log(Level.FINE, " Computer {0} getContainers, lack of admin permission, returning empty list", this);
        return Collections.emptyList();
    }

    KubernetesSlave slave = getNode();
    if(slave == null) {
        return Collections.emptyList();
    }

    KubernetesCloud cloud = slave.getKubernetesCloud();
    KubernetesClient client = cloud.connect();

    String namespace = StringUtils.defaultIfBlank(slave.getNamespace(), client.getNamespace());
    Pod pod = client.pods().inNamespace(namespace).withName(getName()).get();

    return pod.getSpec().getContainers();
}
 
Example #2
Source File: SuiteResult.java    From junit-plugin with MIT License 5 votes vote down vote up
/**
 * The possibly-empty list of {@link FlowNode#id}s for enclosing blocks within which this suite was generated.
 *
 * @since 1.22
 */
@Exported(visibility=9)
@Nonnull
public List<String> getEnclosingBlocks() {
    if (enclosingBlocks != null) {
        return Collections.unmodifiableList(enclosingBlocks);
    } else {
        return Collections.emptyList();
    }
}
 
Example #3
Source File: FlakyCaseResult.java    From flaky-test-handler-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * The stderr of this test.
 *
 * @see #getStdout()
 * @since 1.294
 */
@Exported
public String getStderr() {
  if(stderr!=null)    return stderr;
  FlakySuiteResult sr = getSuiteResult();
  if (sr==null) return "";
  return getSuiteResult().getStderr();
}
 
Example #4
Source File: ExportedDescribableModel.java    From blueocean-plugin with MIT License 5 votes vote down vote up
/**
 * Properties the describable supports
 * See {@link DescribableModel#getParameters()}
 */
@Exported
public List<ExportedDescribableParameter> getParameters() {
    List<ExportedDescribableParameter> params = new ArrayList<>();

    for (DescribableParameter p : model.getParameters()) {
        params.add(new ExportedDescribableParameter(p));
    }
    return params;
}
 
Example #5
Source File: CaseResult.java    From junit-plugin with MIT License 5 votes vote down vote up
/**
 * Gets the number of consecutive builds (including this)
 * that this test case has been failing.
 *
 * @return the number of consecutive failing builds.
 */
@Exported(visibility=9)
public int getAge() {
    if(isPassed())
        return 0;
    else if (getRun() != null) {
        return getRun().getNumber()-getFailedSince()+1;
    } else {
        LOGGER.fine("Trying to get age of a CaseResult without an owner");
        return 0; 
}
}
 
Example #6
Source File: FlakyTestResult.java    From flaky-test-handler-plugin with Apache License 2.0 5 votes vote down vote up
@Exported(visibility=999)
@Override
public int getPassCount() {
  if(passedTests==null)
    return 0;
  else
    return passedTests.size();
}
 
Example #7
Source File: TemplateDrivenMultiBranchProject.java    From multi-branch-project-plugin with MIT License 5 votes vote down vote up
/**
 * Returns the last stable build, if any. Otherwise null.
 *
 * @return the build or null
 * @see #getLastSuccessfulBuild
 */
@SuppressWarnings(UNUSED)
@CheckForNull
@Exported
public Run getLastStableBuild() {
    Run retVal = null;
    for (Job job : getAllJobs()) {
        retVal = takeLast(retVal, job.getLastStableBuild());
    }
    return retVal;
}
 
Example #8
Source File: AbstractRunImpl.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Override
@Exported(inline = true)
public Container<BlueChangeSetEntry> getChangeSet() {
    return new ChangeSetContainerImpl(organization, this, run);
}
 
Example #9
Source File: MattermostNotifier.java    From jenkins-mattermost-plugin with MIT License 4 votes vote down vote up
@Exported
public boolean includeTestSummary() {
  return includeTestSummary;
}
 
Example #10
Source File: TemplateImplementationProperty.java    From ez-templates with Apache License 2.0 4 votes vote down vote up
@Exported
public String getTemplateJobName() {
    return templateJobName;
}
 
Example #11
Source File: FlakyClassResult.java    From flaky-test-handler-plugin with Apache License 2.0 4 votes vote down vote up
@Exported
public int getFlakeCount() {
  return flakeCount;
}
 
Example #12
Source File: PackageResult.java    From junit-plugin with MIT License 4 votes vote down vote up
@Exported
@Override
public int getFailCount() {
    return failCount;
}
 
Example #13
Source File: CauseData.java    From gitlab-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Exported
public String getTargetRepoSshUrl() {
    return targetRepoSshUrl;
}
 
Example #14
Source File: DockerAPIReport.java    From docker-traceability-plugin with MIT License 4 votes vote down vote up
@Exported(visibility = 999)
public String getTimestamp() {
    return DockerTraceabilityHelper.formatDate(fingerprint.getTimestamp());
}
 
Example #15
Source File: DockerJobTemplateProperty.java    From docker-plugin with MIT License 4 votes vote down vote up
@Exported
public String getCloudname() {
    return cloudname;
}
 
Example #16
Source File: DynamicProjectApi.java    From DotCi with MIT License 4 votes vote down vote up
@Exported
public JobInfo getInfo() {
    return new JobInfo(this.dynamicProject);
}
 
Example #17
Source File: TestResult.java    From junit-plugin with MIT License 4 votes vote down vote up
@Exported(inline=true,visibility=9)
public Collection<SuiteResult> getSuites() {
    return suites;
}
 
Example #18
Source File: BlueJUnitTrend.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported(name = SKIPPED)
public long getSkipped() {
    return summary.getSkippedTotal();
}
 
Example #19
Source File: ModelTest.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported
public String getShouldBeNull(){
    return null;
}
 
Example #20
Source File: AnalysisResultApi.java    From warnings-ng-plugin with MIT License 4 votes vote down vote up
@Exported
public int getFixedSize() {
    return result.getFixedSize();
}
 
Example #21
Source File: GitContent.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported(name = "commitId", skipNull = true)
public String getCommitId() {
    return commitId;
}
 
Example #22
Source File: ExportedToolDescriptor.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported
public String getName() {
    return name;
}
 
Example #23
Source File: LineChart.java    From DotCi with MIT License 4 votes vote down vote up
@Exported(inline = true)
public String getPointHighlightStroke() {
    return pointHighlightStroke;
}
 
Example #24
Source File: MultiBranchPipelineImpl.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported(
    name = "scriptPath"
)
public String getScriptPath() {
    return scriptPath;
}
 
Example #25
Source File: PullRequestSCMRevision.java    From github-branch-source-plugin with MIT License 4 votes vote down vote up
/**
 * The commit hash of the head of the pull request branch.
 *
 * @return The commit hash of the head of the pull request branch
 */
@Exported
@NonNull
public String getPullHash() {
    return pullHash;
}
 
Example #26
Source File: CauseData.java    From gitlab-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Exported
public ActionType getActionType() {
    return actionType;
}
 
Example #27
Source File: BlueItemRun.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported(name = "name")
String getName();
 
Example #28
Source File: GitLabPushCauseData.java    From gitlab-branch-source-plugin with MIT License 4 votes vote down vote up
@Exported
public Map<String, String> getBuildVariables() {
    return variables;
}
 
Example #29
Source File: BlueTestResult.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported(name = ID)
public final String getId() {
    return rawEncode(this.getClass().getName()) + ":" + rawEncode(getUniqueId());
}
 
Example #30
Source File: PipelineScmTest.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Exported
public String getData() {
    return data;
}