package gcom.batch.arrecadacao; import gcom.seguranca.acesso.usuario.Usuario; import gcom.tarefa.TarefaBatch; import gcom.tarefa.TarefaException; import gcom.util.ConstantesJNDI; import gcom.util.ConstantesSistema; import gcom.util.agendadortarefas.AgendadorTarefas; import java.util.Collection; import java.util.Collections; import java.util.Iterator; public class TarefaBatchClassificarPagamentosDevolucoes extends TarefaBatch { private static final long serialVersionUID = 1L; public TarefaBatchClassificarPagamentosDevolucoes(Usuario usuario, int idFuncionalidadeIniciada) { super(usuario, idFuncionalidadeIniciada); } @Deprecated public TarefaBatchClassificarPagamentosDevolucoes() { super(null, 0); } public Object executar() throws TarefaException { // Se o sequencial de execucao do processo_funcionalidade for 1 ou o // primeiro --> Registrar Processo Iniciado Collection<Integer> colecaoIdsLocalidades = (Collection<Integer>) getParametro(ConstantesSistema.COLECAO_UNIDADES_PROCESSAMENTO_BATCH); Iterator iterator = colecaoIdsLocalidades.iterator(); while (iterator.hasNext()) { Integer idLocalidade = (Integer) iterator.next(); enviarMensagemControladorBatch( ConstantesJNDI.BATCH_CLASSIFICAR_PAGAMENTOS_DEVOLUCOES_MDB, new Object[] { Collections.singletonList(idLocalidade), this.getIdFuncionalidadeIniciada() }); } return null; } @Override public Collection pesquisarTodasUnidadeProcessamentoBatch() { return null; } @Override public Collection pesquisarTodasUnidadeProcessamentoReinicioBatch() { return null; } @Override public void agendarTarefaBatch() { AgendadorTarefas.agendarTarefa("ClassificarPagamentosDevolucoesBatch", this); } }