Package jenkins.model

Examples of jenkins.model.Jenkins


    public String getShortDescription() {
        return Messages.InstallToolCommand_ShortDescription();
    }

    protected int run() throws Exception {
        Jenkins h = Jenkins.getInstance();
        h.checkPermission(Jenkins.READ);

        // where is this build running?
        BuildIDs id = checkChannel().call(new BuildIDs());

        if (!id.isComplete())
View Full Code Here


    public static List<Descriptor<CrumbIssuer>> getCrumbIssuerDescriptors() {
        return CrumbIssuer.all();
    }

    public static String getCrumb(StaplerRequest req) {
        Jenkins h = Jenkins.getInstance();
        CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
        return issuer != null ? issuer.getCrumb(req) : "";
    }
View Full Code Here

        CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
        return issuer != null ? issuer.getCrumb(req) : "";
    }

    public static String getCrumbRequestField() {
        Jenkins h = Jenkins.getInstance();
        CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
        return issuer != null ? issuer.getDescriptor().getCrumbRequestField() : "";
    }
View Full Code Here

    public Set<Node> getNodes() {
        Set<Node> nodes = this.nodes;
        if(nodes!=null) return nodes;

        Set<Node> r = new HashSet<Node>();
        Jenkins h = Jenkins.getInstance();
        if(this.matches(h))
            r.add(h);
        for (Node n : h.getNodes()) {
            if(this.matches(n))
                r.add(n);
        }
        return this.nodes = Collections.unmodifiableSet(r);
    }
View Full Code Here

     */
    @Exported
    public Set<Cloud> getClouds() {
        if(clouds==null) {
            Set<Cloud> r = new HashSet<Cloud>();
            Jenkins h = Jenkins.getInstance();
            for (Cloud c : h.clouds) {
                if(c.canProvision(this))
                    r.add(c);
            }
            clouds = Collections.unmodifiableSet(r);
View Full Code Here

        log.getLogger().println("Downloading JDK from "+primary.filepath);

        HttpClient hc = new HttpClient();
        hc.getParams().setParameter("http.useragent","Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)");
        Jenkins j = Jenkins.getInstance();
        ProxyConfiguration jpc = j!=null ? j.proxy : null;
        if(jpc != null) {
            hc.getHostConfiguration().setProxy(jpc.name, jpc.port);
            if(jpc.getUserName() != null)
                hc.getState().setProxyCredentials(AuthScope.ANY,new UsernamePasswordCredentials(jpc.getUserName(),jpc.getPassword()));
View Full Code Here

    }

    @Override
    @Exported
    public Executor getExecutor() {
        Jenkins jenkins = Jenkins.getInstance();
        if (jenkins == null) {
            return null;
        }
        for (Computer computer : jenkins.getComputers()) {
            for (Executor executor : computer.getExecutors()) {
                if (isCurrent(executor)) {
                    return executor;
                }
            }
View Full Code Here

     * Because servlet containers generally don't specify the ordering of the initialization
     * (and different implementations indeed do this differently --- See HUDSON-3878),
     * we cannot use Hudson to the CrumbIssuer into CrumbFilter eagerly.
     */
    public CrumbIssuer getCrumbIssuer() {
        Jenkins h = Jenkins.getInstance();
        if(h==null)     return null;    // before Jenkins is initialized?
        return h.getCrumbIssuer();
    }
View Full Code Here

@Extension(ordinal=195) // immediately after the security setting
public class GlobalCrumbIssuerConfiguration extends GlobalConfiguration {
    @Override
    public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
        // for compatibility reasons, the actual value is stored in Jenkins
        Jenkins j = Jenkins.getInstance();
        if (json.has("csrf")) {
            JSONObject csrf = json.getJSONObject("csrf");
            j.setCrumbIssuer(CrumbIssuer.all().newInstanceFromRadioList(csrf, "issuer"));
        } else {
            j.setCrumbIssuer(null);
        }

        return true;
    }
View Full Code Here

        if (url.startsWith("/")) {
            StaplerRequest req = Stapler.getCurrentRequest();
            if (req != null) {
                url = req.getContextPath() + url;
            } else {
                Jenkins j = Jenkins.getInstance();
                if (j != null) {
                    String rootUrl = j.getRootUrl();
                    if (rootUrl != null) {
                        url = rootUrl + url.substring(1);
                    } else {
                        LOGGER.warning("You need to define the root URL of Jenkins");
                        // hope that / works, i.e., that there is no context path
View Full Code Here

TOP

Related Classes of jenkins.model.Jenkins

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.