package com.friday.custody.context;

import com.friday.custody.service.trustService.OutsourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 *
 */
@Slf4j
@Service
public class OutsourceServiceContext {
    private final Map<String, OutsourceService> outsourceStrategyMap = new ConcurrentHashMap<>();

    @Autowired
    public void dpStrategyContext(Map<String, OutsourceService> strategyMap) {
        strategyMap.forEach(this.outsourceStrategyMap::put);
    }

    public void PullRemoteDataFirstQueueJob() {
        outsourceStrategyMap.forEach((key, value) -> {
            value.PullRemoteDataFirstQueueJob();
        });
    }
}
