/*
 * Copyright 2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.cloud.dataflow.core;

import java.util.List;

/**
 * For a given platform, Cloud Foundry, Kubernetes, etc, associate a list of Task Launchers.
 *
 * @author Donovan Muller
 * @author David Turanski
 */
public class TaskPlatform {

	private String name;

	private boolean primary;

	private List<Launcher> launchers;

	public TaskPlatform(String name, List<Launcher> launchers) {
		this.name = name;
		this.launchers = launchers;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Launcher> getLaunchers() {
		return launchers;
	}

	public void setLaunchers(List<Launcher> launchers) {
		this.launchers = launchers;
	}

	/**
	 * If true, identifies which Platform the Data Flow Server is running on.  This information is used to select
	 * the TaskPlatform used by Scheduler.  @see SchedulerConfiguration.
	 * @return true if the TaskPlatform is the same as where the Data Flow Server is running.
	 */
	public boolean isPrimary() {
		return primary;
	}

	public void setPrimary(boolean primary) {
		this.primary = primary;
	}
}

