Esempio n. 1
0
        public virtual void delete(bool cascadeToHistory)
        {
            CommandContext commandContext = Context.CommandContext;

            deleteSeedJob();
            deleteMonitorJob();
            BatchJobHandler.deleteJobs(this);

            JobDefinitionManager jobDefinitionManager = commandContext.JobDefinitionManager;

            jobDefinitionManager.delete(SeedJobDefinition);
            jobDefinitionManager.delete(MonitorJobDefinition);
            jobDefinitionManager.delete(BatchJobDefinition);

            commandContext.BatchManager.delete(this);
            configuration.deleteByteArrayValue();

            fireHistoricEndEvent();

            if (cascadeToHistory)
            {
                HistoricIncidentManager historicIncidentManager = commandContext.HistoricIncidentManager;
                historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId);
                historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId);
                historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId);

                HistoricJobLogManager historicJobLogManager = commandContext.HistoricJobLogManager;
                historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId);
                historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId);
                historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId);

                commandContext.HistoricBatchManager.deleteHistoricBatchById(id);
            }
        }
Esempio n. 2
0
            public Void execute(CommandContext commandContext)
            {
                ((JobEntity)job).delete();

                HistoricIncidentManager historicIncidentManager = commandContext.HistoricIncidentManager;

                foreach (HistoricIncident incident in incidents)
                {
                    HistoricIncidentEntity incidentEntity = (HistoricIncidentEntity)incident;
                    historicIncidentManager.delete(incidentEntity);
                }

                commandContext.HistoricJobLogManager.deleteHistoricJobLogByJobId(job.Id);
                return(null);
            }
Esempio n. 3
0
        public virtual void delete()
        {
            HistoricIncidentManager historicIncidentManager = Context.CommandContext.HistoricIncidentManager;

            historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId);
            historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId);
            historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId);

            HistoricJobLogManager historicJobLogManager = Context.CommandContext.HistoricJobLogManager;

            historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId);
            historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId);
            historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId);

            Context.CommandContext.HistoricBatchManager.delete(this);
        }