本文整理汇总了Java中org.kohsuke.stapler.export.Exported类的典型用法代码示例。如果您正苦于以下问题:Java Exported类的具体用法?Java Exported怎么用?Java Exported使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Exported类属于org.kohsuke.stapler.export包,在下文中一共展示了Exported类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatus
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported(name="status",visibility=9) // because stapler notices suffix 's' and remove it
public Status getStatus() {
if (skipped) {
return Status.SKIPPED;
}
FlakyCaseResult pr = getPreviousResult();
if(pr==null) {
return isPassed() ? Status.PASSED : Status.FAILED;
}
if(pr.isPassed()) {
return isPassed() ? Status.PASSED : Status.REGRESSION;
} else {
return isPassed() ? Status.FIXED : Status.FAILED;
}
}
示例2: isOneClickDeployValid
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
/**
* Returns {@code true} if and only if a one click deployment is valid. In other words
* {@link #isOneClickDeployPossible()} says there are artifacts for deployment. {@link #isOneClickDeployValid()}
* says the configured one click deploy is fully defined and {@link #isOneClickDeploy()} says that the user
* has enabled one click deploy for the project.
*
* @return {@code true} if and only if a one click deployment is valid.
*/
@SuppressWarnings("unused") // used by stapler
@Exported(name = "oneClickDeployValid", visibility = 2)
public boolean isOneClickDeployValid() {
if (owner != null && owner.hasPermission(DEPLOY)) {
DeployNowJobProperty property = owner.getProperty(DeployNowJobProperty.class);
if (property != null) {
if (property.isOneClickDeploy()) {
if (owner.hasPermission(OWN_AUTH) && DeployHost.isValid(property.getHosts(), owner,
Hudson.getAuthentication())) {
return true;
}
if (owner.hasPermission(JOB_AUTH) && DeployHost.isValid(property.getHosts(), owner,
ACL.SYSTEM)) {
return true;
}
}
}
}
return false;
}
示例3: isOneClickDeployValid
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported(name = "oneClickDeployValid", visibility = 2)
public boolean isOneClickDeployValid() {
if (owner != null && owner.getParent().hasPermission(DEPLOY)) {
DeployNowJobProperty property = owner.getParent().getProperty(DeployNowJobProperty.class);
if (property != null) {
if (property.isOneClickDeploy()) {
List<? extends DeployHost<?, ?>> sets = property.getHosts();
if (owner.getParent().hasPermission(OWN_AUTH) && DeployHost
.isValid(sets, owner, Hudson.getAuthentication())) {
return true;
}
if (owner.getParent().hasPermission(JOB_AUTH) && DeployHost.isValid(sets, owner, ACL.SYSTEM)) {
return true;
}
}
}
}
return false;
}
示例4: getChoices
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported
public List<String> getChoices()
{
String def = defaultValue;
try
{
AbstractProject project = CurrentProject.getCurrentProject(this);
AbstractBuild build = (successfulOnly ? (AbstractBuild)project.getLastSuccessfulBuild() : project.getLastBuild());
def = build.getBuildVariables().get(getName()).toString();
}
catch(Exception ex)
{
}
if(def != null && choices.indexOf(def) != 0)
{
List<String> c = new ArrayList<String>(choices);
c.remove(def);
c.add(0, def);
return c;
}
return choices;
}
开发者ID:jenkinsci,项目名称:persistent-parameter-plugin,代码行数:25,代码来源:PersistentChoiceParameterDefinition.java
示例5: getExecutor
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Override
@Exported
public Executor getExecutor() {
final Jenkins jenkins = Jenkins.getInstance();
if (jenkins == null) {
return null;
}
for (final Computer computer : jenkins.getComputers()) {
for (final Executor executor : computer.getExecutors()) {
if (isCurrent(executor)) {
return executor;
}
}
}
return null;
}
示例6: getAxisList
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported
public Iterable<Map> getAxisList() {
final Iterable<Combination> layoutList = this.build.getLayouter().list();
final Iterable<Map> subBuildInfo = Iterables.transform(layoutList, new Function<Combination, Map>() {
@Override
public Map apply(@Nullable final Combination combination) {
final HashMap subBuild = new HashMap();
subBuild.putAll(combination);
final hudson.model.Build run = ProcessedBuild.this.build.getRun(combination);
subBuild.putAll(getSubBuildInfo((DbBackedBuild) run));
return subBuild;
}
});
final ArrayList<Map> subBuilds = Iterables.size(layoutList) > 1 ? Lists.newArrayList(subBuildInfo) : new ArrayList<>();
subBuilds.add(getMainBuildInfo(this.build));
return subBuilds;
}
示例7: getSession
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported
public Session getSession() {
if (sessionId == null || sessionId.isEmpty() || run == null) {
return null;
}
BuildWrapperItem<BrowserStackBuildWrapper> wrapperItem = BrowserStackBuildWrapper.findBrowserStackBuildWrapper(run.getParent());
if (wrapperItem == null || wrapperItem.buildWrapper == null) {
return null;
}
BrowserStackCredentials credentials = BrowserStackCredentials.getCredentials(wrapperItem.buildItem, wrapperItem.buildWrapper.getCredentialsId());
if (credentials == null) {
return null;
}
AutomateClient automateClient = new AutomateClient(credentials.getUsername(), credentials.getDecryptedAccesskey());
Session activeSession = null;
try {
activeSession = automateClient.getSession(this.sessionId);
Analytics.trackIframeRequest();
} catch (AutomateException aex) {
lastException = aex;
return null;
} catch (SessionNotFound snfEx) {
lastException = snfEx;
return null;
}
return activeSession;
}
示例8: getAccessToken
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported
public String getAccessToken() {
MaidsafeJenkinsBuilder.DescriptorImpl descriptor;
descriptor = (MaidsafeJenkinsBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(
MaidsafeJenkinsBuilder.class);
return descriptor.getGithubToken();
}
示例9: getUsages
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported(visibility = 999)
public Hashtable<String, RangeSet> getUsages() {
Hashtable<String, RangeSet> res = new Hashtable<String, RangeSet>(fingerprint.getUsages().size());
for (Map.Entry<String, Fingerprint.RangeSet> set : fingerprint.getUsages().entrySet()) {
res.put(set.getKey(), new RangeSet(set.getValue()));
}
return res;
}
示例10: records
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported
public synchronized @Nonnull List<DockerAPIReport> records() {
if (containerIDs == null) {
return Collections.emptyList();
}
final List<DockerAPIReport> res = new ArrayList<DockerAPIReport>(containerIDs.size());
for (String containerId : containerIDs) {
DockerAPIReport apiReport = DockerAPIReport.forContainer(containerId);
if (apiReport != null) {
res.add(apiReport);
}
}
return res;
}
示例11: getStderr
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
/**
* 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();
}
示例12: getName
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported(visibility = 999)
public String getName() {
int idx = className.lastIndexOf('.');
if (idx < 0) {
return className;
} else {
return className.substring(idx + 1);
}
}
示例13: getFailCount
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
@Exported(visibility=999)
@Override
public int getFailCount() {
if(failedTests==null)
return 0;
else
return failedTests.size();
}
示例14: getLastSuccessfulBuild
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
/**
* Returns the last successful build, if any. Otherwise null. A successful build would include
* either {@link Result#SUCCESS} or {@link Result#UNSTABLE}.
*
* @return the build or null
* @see #getLastStableBuild()
*/
@SuppressWarnings(UNUSED)
@CheckForNull
@Exported
public Run getLastSuccessfulBuild() {
Run retVal = null;
for (Job job : getAllJobs()) {
retVal = takeLast(retVal, job.getLastSuccessfulBuild());
}
return retVal;
}
示例15: getLastUnsuccessfulBuild
import org.kohsuke.stapler.export.Exported; //导入依赖的package包/类
/**
* Returns the last build that was anything but stable, if any. Otherwise null.
*
* @return the build or null
* @see #getLastSuccessfulBuild
*/
@SuppressWarnings(UNUSED)
@CheckForNull
@Exported
public Run getLastUnsuccessfulBuild() {
Run retVal = null;
for (Job job : getAllJobs()) {
retVal = takeLast(retVal, job.getLastUnsuccessfulBuild());
}
return retVal;
}