<commit_before>/**
 * 
 */
package com.servinglynk.hmis.warehouse.base.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.servinglynk.hmis.warehouse.base.util.DedupHelper;
import com.servinglynk.hmis.warehouse.client.MessageSender;
import com.servinglynk.hmis.warehouse.model.AMQEvent;
import com.servinglynk.hmis.warehouse.model.base.ProjectGroupEntity;


public class ClientDaoImpl extends BaseDaoImpl implements ClientDao {
	
	private static final Logger logger = LoggerFactory
			.getLogger(ClientDaoImpl.class);
	@Autowired
	DedupHelper dedupHelper;
	
	@Autowired
	BaseDaoFactory daoFactory;
	
//	@Autowired MessageSender messageSender;

	@Override
	public com.servinglynk.hmis.warehouse.model.base.Client createClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			client.setId(UUID.randomUUID());
			insert(client);
		return client;
	}


	@Override
	public com.servinglynk.hmis.warehouse.model.base.Client updateClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			update(client);
		return client;
	}


	@Override
	public void deleteClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			delete(client);
			
			// creating active mq request
			AMQEvent amqEvent = new AMQEvent();

			amqEvent.setEventType("client.delete");
			Map<String, Object> data = new HashMap<String, Object>();
			data.put("clientId", client.getId());
			data.put("dedupClientId", client.getDedupClientId());
			data.put("projectGroupCode", client.getProjectGroupCode());
//			data.put("userId",Securit);
			amqEvent.setPayload(data);
			amqEvent.setModule("hmis");
			amqEvent.setSubsystem("clientapi");
//			messageSender.sendAmqMessage(amqEvent);	
		
	}

<commit_msg>Make sure pub/sub is getting called when deleting a client:<commit_after>/**
 * 
 */
package com.servinglynk.hmis.warehouse.base.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.servinglynk.hmis.warehouse.base.util.DedupHelper;
import com.servinglynk.hmis.warehouse.client.MessageSender;
import com.servinglynk.hmis.warehouse.model.AMQEvent;
import com.servinglynk.hmis.warehouse.model.base.ProjectGroupEntity;


public class ClientDaoImpl extends BaseDaoImpl implements ClientDao {
	
	private static final Logger logger = LoggerFactory
			.getLogger(ClientDaoImpl.class);
	@Autowired
	DedupHelper dedupHelper;
	
	@Autowired
	BaseDaoFactory daoFactory;
	
	@Autowired MessageSender messageSender;

	@Override
	public com.servinglynk.hmis.warehouse.model.base.Client createClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			client.setId(UUID.randomUUID());
			insert(client);
		return client;
	}


	@Override
	public com.servinglynk.hmis.warehouse.model.base.Client updateClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			update(client);
		return client;
	}


	@Override
	public void deleteClient(
			com.servinglynk.hmis.warehouse.model.base.Client client) {
			delete(client);
			
			// creating active mq request
			AMQEvent amqEvent = new AMQEvent();

			amqEvent.setEventType("client.delete");
			Map<String, Object> data = new HashMap<String, Object>();
			data.put("clientId", client.getId());
			data.put("dedupClientId", client.getDedupClientId());
			data.put("projectGroupCode", client.getProjectGroupCode());
//			data.put("userId",Securit);
			amqEvent.setPayload(data);
			amqEvent.setModule("hmis");
			amqEvent.setSubsystem("clientapi");
			messageSender.sendAmqMessage(amqEvent);	
		
	}


{'fraction_non_alphanumeric': 0.1166422645192777, 'fraction_numerical': 0.0009760858955588092, 'mean_word_length': 5.001464128843338, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6003575', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1357, 'n_words': 221}