All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pivotal.services.plugin.tasks.CfDeleteRouteTask Maven / Gradle / Ivy

There is a newer version: 2.3.0-rc.6
Show newest version
package io.pivotal.services.plugin.tasks;

import io.pivotal.services.plugin.CfProperties;
import io.pivotal.services.plugin.tasks.helper.CfDeleteRouteDelegate;
import org.cloudfoundry.operations.CloudFoundryOperations;
import org.gradle.api.tasks.TaskAction;
import reactor.core.publisher.Mono;

import java.time.Duration;

/**
 * Responsible for Deleting a route
 *
 * @author Biju Kunjummen
 */
public class CfDeleteRouteTask extends AbstractCfTask {

    private CfDeleteRouteDelegate deleteRouteDelegate;

    @TaskAction
    public void deleteRoute() {
        CloudFoundryOperations cfOperations = getCfOperations();
        CfProperties cfProperties = getCfProperties();

        Mono resp = deleteRouteDelegate.deleteRoute(cfOperations, cfProperties);

        resp.block(Duration.ofMillis(defaultWaitTimeout));
    }


    @Override
    public String getDescription() {
        return "Delete a route from Cloud Foundry";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy