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


Java Label.parse方法代码示例

本文整理汇总了Java中hudson.model.Label.parse方法的典型用法代码示例。如果您正苦于以下问题:Java Label.parse方法的具体用法?Java Label.parse怎么用?Java Label.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Label的用法示例。


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

示例1: NomadSlaveTemplate

import hudson.model.Label; //导入方法依赖的package包/类
@DataBoundConstructor
public NomadSlaveTemplate(
        String cpu,
        String memory,
        String disk,
        String labels,
        String remoteFs,
        String idleTerminationInMinutes,
        String region,
        String priority,
        String image
        ) {
    this.cpu = Integer.parseInt(cpu);
    this.memory = Integer.parseInt(memory);
    this.disk = Integer.parseInt(disk);
    this.priority = Integer.parseInt(priority);
    this.idleTerminationInMinutes = Integer.parseInt(idleTerminationInMinutes);
    this.remoteFs = remoteFs;
    this.labels = Util.fixNull(labels);
    this.labelSet = Label.parse(labels);
    this.region = region;
    this.image = image;

    readResolve();
}
 
开发者ID:iverberk,项目名称:jenkins-nomad,代码行数:26,代码来源:NomadSlaveTemplate.java

示例2: readResolve

import hudson.model.Label; //导入方法依赖的package包/类
/**
 * Initializes data structure that we don't persist.
 */
@SuppressWarnings("unused")
public Object readResolve() {
    if (configVersion < 1) {
        if (isNull(nodeProperties)) nodeProperties = new ArrayList<>();
        nodeProperties.add(new DockerNodeProperty("DOCKER_CONTAINER_ID", "JENKINS_CLOUD_ID", "DOCKER_HOST"));
        configVersion = 1;
    }

    // real @Nonnull
    if (mode == null) {
        mode = Node.Mode.NORMAL;
    }

    if (retentionStrategy == null) {
        retentionStrategy = new DockerOnceRetentionStrategy(10);
    }

    try {
        labelSet = Label.parse(getLabelString()); // fails sometimes under debugger
    } catch (Throwable t) {
        LOG.error("Can't parse labels: {}", t);
    }

    return this;
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:29,代码来源:DockerSlaveTemplate.java

示例3: readResolve

import hudson.model.Label; //导入方法依赖的package包/类
/**
 * Initializes data structure that we don't persist.
 */
protected Object readResolve() {
    labelSet = Label.parse(labels);
    securityGroupSet = parseSecurityGroups();

    /**
     * In releases of this plugin prior to 1.18, template-specific instance caps could be configured
     * but were not enforced. As a result, it was possible to have the instance cap for a template
     * be configured to 0 (zero) with no ill effects. Starting with version 1.18, template-specific
     * instance caps are enforced, so if a configuration has a cap of zero for a template, no instances
     * will be launched from that template. Since there is no practical value of intentionally setting
     * the cap to zero, this block will override such a setting to a value that means 'no cap'.
     */
    if (instanceCap == 0) {
        instanceCap = Integer.MAX_VALUE;
    }

    if (amiType == null) {
    	amiType = new UnixData(rootCommandPrefix, sshPort);
    }
    return this;
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:25,代码来源:SlaveTemplate.java

示例4: RavelloSlaveBlueprint

import hudson.model.Label; //导入方法依赖的package包/类
@DataBoundConstructor
public RavelloSlaveBlueprint(String blueprintName, int blueprintId, String slaveName, String remoteFS, String nodeDescription, RetentionStrategy retentionStrategy, int port, String credentialsId,
                                String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd,
                                Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, String labelString){
	super(blueprintName, blueprintId);
       this.slaveName = slaveName;
       this.remoteFS = remoteFS;
       this.nodeDescription = nodeDescription;
       this.retentionStrategy = retentionStrategy;
       this.port = port;
       this.credentialsId = credentialsId;
       this.jvmOptions = jvmOptions;
       this.javaPath = javaPath;
       this.prefixStartSlaveCmd = prefixStartSlaveCmd;
       this.suffixStartSlaveCmd = suffixStartSlaveCmd;
       this.launchTimeoutSeconds = launchTimeoutSeconds;
       this.maxNumRetries = maxNumRetries;
       this.retryWaitTime = retryWaitTime;
       this.labelString = labelString;

       labelSet = Label.parse(labelString);
   }
 
开发者ID:ravello,项目名称:ravello-jenkins-plugin,代码行数:23,代码来源:RavelloSlaveBlueprint.java

示例5: DockerTemplate

import hudson.model.Label; //导入方法依赖的package包/类
@DataBoundConstructor
public DockerTemplate(@Nonnull DockerTemplateBase dockerTemplateBase,
                      DockerComputerConnector connector,
                      String labelString,
                      String remoteFs,
                      String instanceCapStr
) {
    this.dockerTemplateBase = dockerTemplateBase;
    this.connector = connector;
    this.labelString = Util.fixNull(labelString);
    this.remoteFs = Strings.isNullOrEmpty(remoteFs) ? "/home/jenkins" : remoteFs;

    if (instanceCapStr.equals("")) {
        this.instanceCap = Integer.MAX_VALUE;
    } else {
        this.instanceCap = Integer.parseInt(instanceCapStr);
    }

    labelSet = Label.parse(labelString);
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:21,代码来源:DockerTemplate.java

示例6: getLabels

import hudson.model.Label; //导入方法依赖的package包/类
public Set<LabelAtom> getLabels() {
    if (_labels == null) {
        // Do not do this in readResolve as it can result in a recursive dependency load that
        // makes jenkins startup slow and unstable.
        _labels = Label.parse(this.labelString);
    }

    return _labels;
}
 
开发者ID:dump247,项目名称:jenkins-docker-build-plugin,代码行数:10,代码来源:LabeledDockerImage.java

示例7: doCheckLabelString

import hudson.model.Label; //导入方法依赖的package包/类
public FormValidation doCheckLabelString(@QueryParameter String value) {
    value = nullToEmpty(value).trim();

    if (value.length() == 0) {
        return FormValidation.error("Required");
    }

    try {
        Label.parse(value);
        return FormValidation.ok();
    } catch (Throwable ex) {
        return FormValidation.error("Invalid labels: %s", ex.getMessage());
    }
}
 
开发者ID:dump247,项目名称:jenkins-docker-build-plugin,代码行数:15,代码来源:LabeledDockerImage.java

示例8: doCheckRequiredLabelString

import hudson.model.Label; //导入方法依赖的package包/类
public FormValidation doCheckRequiredLabelString(@QueryParameter String value) {
    if (isNullOrEmpty(value)) {
        return FormValidation.ok();
    }

    try {
        Label.parse(value);
        return FormValidation.ok();
    } catch (Throwable ex) {
        return FormValidation.error(ex.getMessage());
    }
}
 
开发者ID:dump247,项目名称:jenkins-docker-build-plugin,代码行数:13,代码来源:DockerJobCloud.java

示例9: getLabelSet

import hudson.model.Label; //导入方法依赖的package包/类
public Set<LabelAtom> getLabelSet() {
    return Label.parse(label);
}
 
开发者ID:cloudbees,项目名称:amazon-ecs-plugin,代码行数:4,代码来源:ECSTaskTemplate.java

示例10: setLabelString

import hudson.model.Label; //导入方法依赖的package包/类
@DataBoundSetter
public void setLabelString(String labelString) {
    super.setLabelString(labelString);
    this.labelSet = Label.parse(labelString);
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:6,代码来源:DockerSlaveTemplate.java

示例11: readResolve

import hudson.model.Label; //导入方法依赖的package包/类
protected Object readResolve() {
    labelSet = Label.parse(labels);
    return this;
}
 
开发者ID:pulse00,项目名称:digitalocean-plugin,代码行数:5,代码来源:SlaveTemplate.java


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