package com.yihu.hos.arbiter.services;

import com.yihu.hos.arbiter.models.Endpoint;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @created Airhead 2016/8/23.
 */
@Service("healthCheckService")
public class HealthCheckService {
    public void check() {
        List<Endpoint> endpointList = getEndpointList();
        endpointList.forEach(this::remoteCheck);
    }

    /**
     * 返回所有拉取方式进行健康检测的Endpoint列表
     *
     * @return
     */
    private List<Endpoint> getEndpointList() {
        //TODO:
        return new ArrayList<>();
    }

    /**
     * 调用实际的检查地址
     *
     * @param endpoint
     */
    private void remoteCheck(Endpoint endpoint) {
        //TODO:
    }
}
