当前位置: 首页>>代码示例>>Java>>正文


Java StaplerRequest类代码示例

本文整理汇总了Java中org.kohsuke.stapler.StaplerRequest的典型用法代码示例。如果您正苦于以下问题:Java StaplerRequest类的具体用法?Java StaplerRequest怎么用?Java StaplerRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StaplerRequest类属于org.kohsuke.stapler包,在下文中一共展示了StaplerRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException
{
    useSummarize = formData.getBoolean("useSummarize");
    save();
    return super.configure(req, formData); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:ranorex,项目名称:Jenkins-Ranorex-Plugin,代码行数:8,代码来源:RanorexRunnerBuilder.java

示例2: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public synchronized boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
   wait = formData.getString("wait");
   waitUnit = ITimedMicrocksPlugin.TimeoutUnit.normalize(formData.getString("waitUnit"));
   if (wait == null || wait.isEmpty()) {
      // If someone clears the value, go back to default and use seconds
      wait = "" + getStaticDefaultWaitTime() / ITimedMicrocksPlugin.TimeoutUnit.SECONDS.multiplier;
      waitUnit = ITimedMicrocksPlugin.TimeoutUnit.SECONDS.name;
   }
   wait = wait.trim();
   save();
   return true;
}
 
开发者ID:microcks,项目名称:microcks-jenkins-plugin,代码行数:14,代码来源:TimedBuildStepDescriptor.java

示例3: doPost

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
public HttpResponse doPost(StaplerRequest request) throws IOException {
    if (!request.getMethod().equals("POST")) {
        return HttpResponses
                .error(HttpServletResponse.SC_BAD_REQUEST,
                        "Only POST requests are supported, this was a " + request.getMethod() + " request");
    }
    if (!"application/json".equals(request.getContentType())) {
        return HttpResponses
                .error(HttpServletResponse.SC_BAD_REQUEST,
                        "Only application/json content is supported, this was " + request.getContentType());
    }
    String type = request.getHeader("X-Gitea-Event");
    if (StringUtils.isBlank(type)) {
        return HttpResponses.error(HttpServletResponse.SC_BAD_REQUEST,
                "Expecting a Gitea event, missing expected X-Gitea-Event header");
    }
    String origin = SCMEvent.originOf(request);
    boolean processed = false;
    for (GiteaWebhookHandler<?, ?> h : ExtensionList.lookup(GiteaWebhookHandler.class)) {
        if (h.matches(type)) {
            h.process(request.getInputStream(), origin);
            processed = true;
        }
    }
    return HttpResponses.plainText(processed ? "Processed" : "Ignored");
}
 
开发者ID:jenkinsci,项目名称:gitea-plugin,代码行数:27,代码来源:GiteaWebhookAction.java

示例4: newInstance

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public ResourceSelector newInstance(StaplerRequest req,
        JSONObject formData) throws FormException {
    ResourceSelector s = super.newInstance(req, formData);

    String selectionType = formData.getString("selectionType");
    System.out.println("parms2: " + selectionType);

    if (SELECT_BY_KIND.equals(selectionType)) {
        s.names = null;
    }
    if (SELECT_BY_NAMES.equals(selectionType)) {
        s.kind = null;
        s.labels = null;
    }
    return s;
}
 
开发者ID:openshift,项目名称:jenkins-client-plugin,代码行数:18,代码来源:ResourceSelector.java

示例5: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    // To persist global configuration information,
    // set that to properties and call save().
    useDefault = formData.getBoolean("useDefault");
    exePath = formData.getString("exePath");
    // ^Can also use req.bindJSON(this, formData);
    //  (easier when there are many fields; need set* methods for this, like setUseDefault)
    save();
    return super.configure(req, formData);
}
 
开发者ID:TommyLin,项目名称:cppchecker,代码行数:12,代码来源:Cppchecker.java

示例6: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(StaplerRequest staplerRequest, JSONObject json) throws FormException {
    // to persist global configuration information,
    // set that to properties and call save().
    //System.out.println(json.toString());
    if(json.containsKey("logPollingFreq")) {
        logPollingFreq = json.getInt("logPollingFreq");
    }
    else {
        logPollingFreq = 15;
    }
    save();
    return true; // indicate that everything is good so far
}
 
开发者ID:nfultz,项目名称:aws-batch,代码行数:15,代码来源:AwsBatchBuilder.java

示例7: newInstance

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override public Step newInstance(StaplerRequest req, JSONObject formData) throws FormException {
    String overridesS = formData.getString("overrides");
    List<String> overrides = new ArrayList<>();
    for (String line : overridesS.split("\r?\n")) {
        line = line.trim();
        if (!line.isEmpty()) {
            overrides.add(line);
        }
    }
    return new EnvStep(overrides);
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:12,代码来源:EnvStep.java

示例8: doEndOfflineAgentJobs

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
public void doEndOfflineAgentJobs(final StaplerRequest request, final StaplerResponse response) {

		Jenkins j;
		if ((j = Jenkins.getInstance()) != null) {
			Queue queue = j.getQueue();
			if (queue != null) {
				for (Item job : queue.getItems()) {
					if (job.getCauseOfBlockage() instanceof BecauseNodeIsOffline
							|| job.getCauseOfBlockage() instanceof BecauseLabelIsOffline) {
						queue.cancel(job);
					}
				}
			}
		}

		try {
			response.sendRedirect2(request.getRootPath());
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
开发者ID:jenkinsci,项目名称:no-agent-job-purge-plugin,代码行数:22,代码来源:PurgeNoAgentJobs.java

示例9: newInstance

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public Trigger newInstance(StaplerRequest req, @Nonnull JSONObject jsonObject) throws FormException {
    if (jsonObject.has("subscribeInternalScm")) {
        jsonObject.put("subscribeInternalScm", Boolean.TRUE);
    }
    return super.newInstance(req, jsonObject);
}
 
开发者ID:riboseinc,项目名称:aws-codecommit-trigger-plugin,代码行数:8,代码来源:SQSTrigger.java

示例10: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(final StaplerRequest req, final JSONObject json) throws FormException {
    Object sqsQueues = json.get("sqsQueues");
    if (json.size() == 1) {
        String key = json.keys().next().toString();
        sqsQueues = json.getJSONObject(key).get("sqsQueues");
    }
    this.sqsQueues = req.bindJSONToList(SQSTriggerQueue.class, sqsQueues);
    this.initQueueMap();

    this.save();

    EventBroker.getInstance().post(new ConfigurationChangedEvent());
    return true;
}
 
开发者ID:riboseinc,项目名称:aws-codecommit-trigger-plugin,代码行数:16,代码来源:SQSTrigger.java

示例11: newInstance

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public SQSScmConfig newInstance(StaplerRequest req, @Nonnull JSONObject jsonObject) throws FormException {
    JSONObject json = jsonObject.getJSONObject("type");
    json.put("type", json.getString("value"));
    json.remove("value");
    return super.newInstance(req, json);//req.bindJSON(SQSScmConfig.class, json);
}
 
开发者ID:riboseinc,项目名称:aws-codecommit-trigger-plugin,代码行数:8,代码来源:SQSScmConfig.java

示例12: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws hudson.model.Descriptor.FormException {
	json = json.getJSONObject("keycloak");
	keycloakJson = json.getString("keycloakJson");
	save();
	return true;
}
 
开发者ID:devlauer,项目名称:jenkins-keycloak-plugin,代码行数:8,代码来源:KeycloakSecurityRealm.java

示例13: configure

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    json = json.getJSONObject("config");
    webhookSecret = json.getString("webhookSecret");
    save();
    return true;
}
 
开发者ID:codeclou,项目名称:jenkins-github-webhook-build-trigger-plugin,代码行数:8,代码来源:GithubWebhookBuildTriggerPluginBuilder.java

示例14: doTestIcon

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
/**
    * Serves the testCoverage badge image. TO DO
    * @param req
    * @param rsp
    * @param job
    * @return
    */
   @SuppressWarnings("rawtypes")
public HttpResponse doTestIcon(StaplerRequest req, StaplerResponse rsp, @QueryParameter String job) {
       Job<?, ?> project = getProject(job);
       Integer testPass = null;
       Integer testTotal = null;

       if (project.getLastCompletedBuild() != null) {
       	AbstractTestResultAction testAction =  project.getLastCompletedBuild().getAction(AbstractTestResultAction.class);
		if(testAction != null){
			int total = testAction.getTotalCount();
			int pass = total - testAction.getFailCount() - testAction.getSkipCount();
			
			testTotal = total;
			testPass = pass;
		}
       }
       return iconResolver.getTestResultImage(testPass, testTotal);
   }
 
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:26,代码来源:PublicBadgeAction.java

示例15: doBuildDescriptionIcon

import org.kohsuke.stapler.StaplerRequest; //导入依赖的package包/类
/**
 * Serves the Build Description badge image.
 * @param req
 * @param rsp
 * @param job
 * @return
 */
public HttpResponse doBuildDescriptionIcon(StaplerRequest req, StaplerResponse rsp, @QueryParameter String job) {
    Job<?, ?> project = getProject(job);
    String buildDescription = null;
    
    /*if (project.getLastSuccessfulBuild() != null) {
        buildDescription = project.getLastSuccessfulBuild().getDescription();
    }*/
    
    /*if (project.getLastBuild() != null) {
        buildDescription = project.getLastBuild().getDescription();
    }*/
    
    if (project.getLastCompletedBuild() != null) {
        buildDescription = project.getLastCompletedBuild().getDescription();
    }
    
    return iconResolver.getBuildDescriptionImage(buildDescription);
}
 
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:26,代码来源:PublicBadgeAction.java


注:本文中的org.kohsuke.stapler.StaplerRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。