Search in sources :

Example 16 with AuditEventType

use of ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType in project Gemma by PavlidisLab.

the class ArrayDesignSequenceAssociationCli method audit.

private void audit(ArrayDesign arrayDesign, String note) {
    // minor : don't add audit event if no sequences were changed, or --force.
    arrayDesignReportService.generateArrayDesignReport(arrayDesign.getId());
    AuditEventType eventType = ArrayDesignSequenceUpdateEvent.Factory.newInstance();
    auditTrailService.addUpdateEvent(arrayDesign, eventType, note);
}
Also used : AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType)

Example 17 with AuditEventType

use of ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType in project Gemma by PavlidisLab.

the class OutlierFlaggingServiceImpl method audit.

private void audit(BioAssay bioAssay, String note) {
    AuditEventType eventType = SampleRemovalEvent.Factory.newInstance();
    auditTrailService.addUpdateEvent(bioAssay, eventType, note);
}
Also used : AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType)

Example 18 with AuditEventType

use of ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType in project Gemma by PavlidisLab.

the class ArrayDesignBioSequenceDetachCli method audit.

private void audit(ArrayDesign arrayDesign) {
    super.getArrayDesignReportService().generateArrayDesignReport(arrayDesign.getId());
    AuditEventType eventType = ArrayDesignSequenceRemoveEvent.Factory.newInstance();
    auditTrailService.addUpdateEvent(arrayDesign, eventType, "Removed sequence associations with CLI");
}
Also used : AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType)

Example 19 with AuditEventType

use of ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType in project Gemma by PavlidisLab.

the class AbstractSpringAwareCLI method noNeedToRun.

/**
 * @param auditable  auditable
 * @param eventClass can be null
 * @return boolean
 */
protected boolean noNeedToRun(Auditable auditable, Class<? extends AuditEventType> eventClass) {
    boolean needToRun = true;
    Date skipIfLastRunLaterThan = this.getLimitingDate();
    List<AuditEvent> events = this.auditEventService.getEvents(auditable);
    // assume okay unless indicated otherwise
    boolean okToRun = true;
    // count.
    for (int j = events.size() - 1; j >= 0; j--) {
        AuditEvent event = events.get(j);
        if (event == null) {
            // legacy of ordered-list which could end up with gaps; should not be needed any more
            continue;
        }
        AuditEventType eventType = event.getEventType();
        if (eventType != null && eventClass != null && eventClass.isAssignableFrom(eventType.getClass()) && !eventType.getClass().getSimpleName().startsWith("Fail")) {
            if (skipIfLastRunLaterThan != null) {
                if (event.getDate().after(skipIfLastRunLaterThan)) {
                    AbstractCLI.log.info(auditable + ": " + " run more recently than " + skipIfLastRunLaterThan);
                    errorObjects.add(auditable + ": " + " run more recently than " + skipIfLastRunLaterThan);
                    needToRun = false;
                }
            } else {
                // it has been run already at some point
                needToRun = false;
            }
        }
    }
    /*
         * Always skip if the object is curatable and troubled
         */
    if (auditable instanceof Curatable) {
        Curatable curatable = (Curatable) auditable;
        // not ok if troubled
        okToRun = !curatable.getCurationDetails().getTroubled();
        // special case for expression experiments - check associated ADs.
        if (okToRun && curatable instanceof ExpressionExperiment) {
            ExpressionExperimentService ees = this.getBean(ExpressionExperimentService.class);
            for (ArrayDesign ad : ees.getArrayDesignsUsed((ExpressionExperiment) auditable)) {
                if (ad.getCurationDetails().getTroubled()) {
                    // not ok if even one parent AD is troubled, no need to check the remaining ones.
                    okToRun = false;
                    break;
                }
            }
        }
        if (!okToRun) {
            AbstractCLI.log.info(auditable + ": has an active 'trouble' flag");
            errorObjects.add(auditable + ": has an active 'trouble' flag");
        }
    }
    return !needToRun || !okToRun;
}
Also used : Curatable(ubic.gemma.model.common.auditAndSecurity.curation.Curatable) AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) AuditEvent(ubic.gemma.model.common.auditAndSecurity.AuditEvent) ExpressionExperimentService(ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) Date(java.util.Date)

Example 20 with AuditEventType

use of ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType in project Gemma by PavlidisLab.

the class ArrayDesignAnnotationFileCli method audit.

private void audit(ArrayDesign arrayDesign, String note) {
    SecurityService ss = this.getBean(SecurityService.class);
    if (!ss.isEditable(arrayDesign))
        return;
    AuditEventType eventType = ArrayDesignAnnotationFileEvent.Factory.newInstance();
    auditTrailService.addUpdateEvent(arrayDesign, eventType, note);
}
Also used : AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType) SecurityService(gemma.gsec.SecurityService)

Aggregations

AuditEventType (ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType)22 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)5 AuditEvent (ubic.gemma.model.common.auditAndSecurity.AuditEvent)3 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)3 AffyPowerToolsProbesetSummarize (ubic.gemma.core.loader.expression.AffyPowerToolsProbesetSummarize)2 AuditTrail (ubic.gemma.model.common.auditAndSecurity.AuditTrail)2 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)2 Taxon (ubic.gemma.model.genome.Taxon)2 AuditTrailService (ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService)2 SecurityService (gemma.gsec.SecurityService)1 Method (java.lang.reflect.Method)1 Date (java.util.Date)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1 Query (org.hibernate.Query)1 Test (org.junit.Test)1 Transactional (org.springframework.transaction.annotation.Transactional)1 ExpressionDataDoubleMatrix (ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)1 RawDataFetcher (ubic.gemma.core.loader.expression.geo.fetcher.RawDataFetcher)1 Auditable (ubic.gemma.model.common.Auditable)1 AuditEventValueObject (ubic.gemma.model.common.auditAndSecurity.AuditEventValueObject)1