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

com.capitalone.dashboard.service.TeamInventoryServiceImpl Maven / Gradle / Ivy

There is a newer version: 3.4.53
Show newest version
package com.capitalone.dashboard.service;

import com.capitalone.dashboard.model.Collector;
import com.capitalone.dashboard.model.DataResponse;
import com.capitalone.dashboard.model.TeamInventory;
import com.capitalone.dashboard.repository.CollectorRepository;
import com.capitalone.dashboard.repository.TeamInventoryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TeamInventoryServiceImpl implements TeamInventoryService {

	private final TeamInventoryRepository teamInventoryRepository;
	private final CollectorRepository collectorRepository;

	@Autowired
	public TeamInventoryServiceImpl(TeamInventoryRepository teamInventoryRepository,
                          CollectorRepository collectorRepository) {
		this.collectorRepository = collectorRepository;
		this.teamInventoryRepository = teamInventoryRepository;
	}


	@Override
	public DataResponse getTeamData(String teamName, String teamId) {
		TeamInventory teamInventory = teamInventoryRepository.findByNameAndTeamId(teamName,teamId);
		Collector collector = collectorRepository.findOne(teamInventory.getCollectorId());
		return new DataResponse<>(teamInventory, collector.getLastExecuted());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy