/** * */ package com.napa.pulse.service.impl; import com.napa.pulse.dao.interfaces.AdHocRefreshDAO; import com.napa.pulse.dto.AdhocRefreshStatus; import com.napa.pulse.entity.security.User; import com.napa.pulse.exception.PulseException; import com.napa.pulse.service.interfaces.AdHocRefreshService; import com.napa.pulse.utils.informatica.InformaticaServiceClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; /** * @author Tathagata */ @Service public class AdHocRefreshServiceImpl implements AdHocRefreshService { private static final Logger LOGGER = LoggerFactory.getLogger(AdHocRefreshServiceImpl.class); @Autowired AdHocRefreshDAO dao; @Lazy @Autowired InformaticaServiceClient informaticaServiceClient; /* (non-Javadoc) * @see com.napa.pulse.service.interfaces.AdHocRefreshService#runAdHocRefresh(com.napa.pulse.entity.security.User, * java.lang.Integer[], java.lang.Integer, java.lang.String, java.lang.Integer, java.util.Date) */ @Override public void runAdHocRefresh(User user, Integer[] sites, Integer reasonId, String environment, Integer requestorId) throws PulseException { Integer requestId = dao.runAdHocRefresh(user, sites, reasonId, environment, requestorId); if (requestId != null) { informaticaServiceClient. (requestId); } } @Override public boolean startAdhocWorkflow(int reqLogId) { try { informaticaServiceClient.startWorkflowAdhoc(reqLogId); return true; } catch (Exception e) { return false; } } /* (non-Javadoc) * @see com.napa.pulse.service.interfaces.AdHocRefreshService#getStateOfQueue() */ @Override public List> getStateOfQueue(User user) throws PulseException { return dao.getStateOfQueue(user); } /* (non-Javadoc) * @see com.napa.pulse.service.interfaces.AdHocRefreshService#restrictedWindow() */ @Override public Boolean restrictedWindow() throws PulseException { return dao.restrictedWindow(); } /* (non-Javadoc) * @see com.napa.pulse.service.interfaces.AdHocRefreshService#getRefreshStatus() */ @Override public AdhocRefreshStatus getRefreshStatus(int siteCount) throws PulseException { return dao.getRefreshStatus(siteCount); } @Override public void clearAdHocQueue ( )throws PulseException { dao.clearAdHocQueue(); } }