Search in sources :

Example 1 with VSphereCloudRetentionStrategy

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");
}
Also used : RunOnceCloudRetentionStrategy(org.jenkinsci.plugins.vsphere.RunOnceCloudRetentionStrategy) VSphereCloudRetentionStrategy(org.jenkinsci.plugins.vsphere.VSphereCloudRetentionStrategy)

Aggregations

RunOnceCloudRetentionStrategy (org.jenkinsci.plugins.vsphere.RunOnceCloudRetentionStrategy)1 VSphereCloudRetentionStrategy (org.jenkinsci.plugins.vsphere.VSphereCloudRetentionStrategy)1