com.redhat.parodos.examples.complex.task.LoadBalancerWorkFlowTask Maven / Gradle / Ivy
package com.redhat.parodos.examples.complex.task;
import java.util.List;
import com.redhat.parodos.workflow.parameter.WorkParameter;
import com.redhat.parodos.workflow.parameter.WorkParameterType;
import com.redhat.parodos.workflow.task.enums.WorkFlowTaskOutput;
import com.redhat.parodos.workflow.task.infrastructure.BaseInfrastructureWorkFlowTask;
import com.redhat.parodos.workflows.work.DefaultWorkReport;
import com.redhat.parodos.workflows.work.WorkContext;
import com.redhat.parodos.workflows.work.WorkReport;
import com.redhat.parodos.workflows.work.WorkStatus;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class LoadBalancerWorkFlowTask extends BaseInfrastructureWorkFlowTask {
@Override
public WorkReport execute(WorkContext workContext) {
log.info("LoadBalancerWorkFlowTask");
return new DefaultWorkReport(WorkStatus.COMPLETED, workContext);
}
@Override
public List getWorkFlowTaskParameters() {
return List.of(
WorkParameter.builder().key("hostname").description("The hostname").type(WorkParameterType.URL)
.optional(false).build(),
WorkParameter.builder().key("appId").description("The app id").type(WorkParameterType.TEXT)
.optional(false).build());
}
@Override
public List getWorkFlowTaskOutputs() {
return List.of(WorkFlowTaskOutput.HTTP2XX);
}
}