本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例9: getLabelSet
import hudson.model.Label; //导入方法依赖的package包/类
public Set<LabelAtom> getLabelSet() {
return Label.parse(label);
}
示例10: setLabelString
import hudson.model.Label; //导入方法依赖的package包/类
@DataBoundSetter
public void setLabelString(String labelString) {
super.setLabelString(labelString);
this.labelSet = Label.parse(labelString);
}
示例11: readResolve
import hudson.model.Label; //导入方法依赖的package包/类
protected Object readResolve() {
labelSet = Label.parse(labels);
return this;
}