<commit_before>package eu.bcvsolutions.idm.core.scheduler.task.impl.hr;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;

import org.apache.commons.lang3.StringUtils;
import org.quartz.DisallowConcurrentExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Description;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto;
import eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter;
import eu.bcvsolutions.idm.core.api.entity.OperationResult;
import eu.bcvsolutions.idm.core.api.service.IdmIdentityContractService;
import eu.bcvsolutions.idm.core.model.event.processor.contract.IdentityContractEnableProcessor;

/**
 * HR process - enable identity's contract process. The processes is started
 * for contracts that are both valid (meaning validFrom and validTill) and
 * enabled.
 * 
 * "hrEnableContract" can be configured as process workflow. 
 * 
 * @author <NAME>
 * @author <NAME>
 * @since 7.5.1
 *
 */
@Service
@Description("HR process - enable active contract")
@DisallowConcurrentExecution
public class HrEnableContractProcess extends AbstractHrProcess {

	@Autowired private IdmIdentityContractService identityContractService;
	@Autowired private IdentityContractEnableProcessor identityContractEnableProcessor;
	
	Set<UUID> cache = new HashSet<>();

	public HrEnableContractProcess() {
	}
	
	public HrEnableContractProcess(boolean skipAutomaticRoleRecalculation) {
		super(skipAutomaticRoleRecalculation);
	}
	
	/**
	 * {@inheritDoc}
	 * 
	 * Find all identity contracts, that are both valid, enabled and not excluded.
	 */
	@Override
	public Page<IdmIdentityContractDto> getItemsToProcess(Pageable pageable) {
		IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
		filter.setValid(Boolean.TRUE);
		filter.setDisabled(Boolean.FALSE);
		filter.setExcluded(Boolean.FALSE);<commit_msg>#1822 fix: remove forgotten cache<commit_after>package eu.bcvsolutions.idm.core.scheduler.task.impl.hr;

import java.util.Optional;

import org.apache.commons.lang3.StringUtils;
import org.quartz.DisallowConcurrentExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Description;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto;
import eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter;
import eu.bcvsolutions.idm.core.api.entity.OperationResult;
import eu.bcvsolutions.idm.core.api.service.IdmIdentityContractService;
import eu.bcvsolutions.idm.core.model.event.processor.contract.IdentityContractEnableProcessor;

/**
 * HR process - enable identity's contract process. The processes is started
 * for contracts that are both valid (meaning validFrom and validTill) and
 * enabled.
 * 
 * "hrEnableContract" can be configured as process workflow. 
 * 
 * @author <NAME>
 * @author <NAME>
 * @since 7.5.1
 *
 */
@Service
@Description("HR process - enable active contract")
@DisallowConcurrentExecution
public class HrEnableContractProcess extends AbstractHrProcess {

	@Autowired private IdmIdentityContractService identityContractService;
	@Autowired private IdentityContractEnableProcessor identityContractEnableProcessor;

	public HrEnableContractProcess() {
	}
	
	public HrEnableContractProcess(boolean skipAutomaticRoleRecalculation) {
		super(skipAutomaticRoleRecalculation);
	}
	
	/**
	 * {@inheritDoc}
	 * 
	 * Find all identity contracts, that are both valid, enabled and not excluded.
	 */
	@Override
	public Page<IdmIdentityContractDto> getItemsToProcess(Pageable pageable) {
		IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
		filter.setValid(Boolean.TRUE);
		filter.setDisabled(Boolean.FALSE);
		filter.setExcluded(Boolean.FALSE);
{'fraction_non_alphanumeric': 0.09299487429826703, 'fraction_numerical': 0.002928972418843056, 'mean_word_length': 6.077720207253886, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4270209', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1162, 'n_words': 241}