Rev 3390 | Rev 5168 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/****/package in.shop2020.crm.handler;import in.shop2020.crm.domain.Agent;import in.shop2020.crm.domain.SearchFilter;import in.shop2020.crm.persistence.AgentMapper;import java.util.Date;import java.util.List;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;/*** Handler for read and update operations on agents in database.** @author mandeep*/@Servicepublic class AgentHandler {@Autowiredprivate AgentMapper agentMapper;public List<String> getRoleNamesForAgent(String agentEmailId) {return agentMapper.getRoleNamesForAgent(agentEmailId);}public List<String> getPermissionsForRoleName(String roleName) {return agentMapper.getPermissionsForRoleName(roleName);}public void updatePasswordForAgent(String agentEmailId, String password) {agentMapper.updatePasswordForAgent(agentEmailId, password);}public Date getLastEmailProcessedTimestamp() {return agentMapper.getLastEmailProcessedTimestamp();}public void updateLastEmailProcessedTimestamp(Date timestamp) {agentMapper.updateLastEmailProcessedTimestamp(timestamp);}public List<Agent> getAgents(SearchFilter searchFilter) {return agentMapper.getAgents(searchFilter);}public void changeAgentStatus(boolean status, String emailId) {agentMapper.changeAgentStatus(status, emailId);}public void insertAgent(in.shop2020.crm.domain.Agent agent, List<String> roles){agentMapper.insertAgent(agent);for (String agentRole : roles) {agentMapper.insertAgentRole(agent.getId(), agentRole);}}}