use of org.jenkinsci.plugins.vsphere.VSphereCloudRetentionStrategy in project vsphere-cloud-plugin by jenkinsci.
the class vSphereCloudSlaveTemplate method determineRetention.
private RetentionStrategy<?> determineRetention() {
if (retentionStrategy instanceof RunOnceCloudRetentionStrategy) {
final RunOnceCloudRetentionStrategy templateStrategy = (RunOnceCloudRetentionStrategy) retentionStrategy;
final RunOnceCloudRetentionStrategy cloneStrategy = new RunOnceCloudRetentionStrategy(templateStrategy.getIdleMinutes());
return cloneStrategy;
}
if (retentionStrategy instanceof VSphereCloudRetentionStrategy) {
final VSphereCloudRetentionStrategy templateStrategy = (VSphereCloudRetentionStrategy) retentionStrategy;
final VSphereCloudRetentionStrategy cloneStrategy = new VSphereCloudRetentionStrategy(templateStrategy.getIdleMinutes());
return cloneStrategy;
}
throw new IllegalStateException("Unsupported retentionStrategy (" + retentionStrategy + ") in template configuration");
}
Aggregations