NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/statistics/StatisticsPersistenceAdapter.java
/* Criteria to use to retrieve incident events */
Criteria to use to retrieve incident events
Criteria to use to retrieve incident events
private PersistenceQuery buildRecordsCriteria() {
        ZonedDateTime dateTime = ZonedDateTime.now();
        dateTime = dateTime.minusHours(Integer.parseInt(configurationManager.getString("statisticsPeriod")));
        String startDateOfPeriod = dateTime.format(DateTimeFormatter.ISO_DATE_TIME);
        QueryBuilder isAfterThisSartPeriodDateTime = new QueryBuilder().put(
                PersistenceKernel.ndsRecord(PersistenceKernel.ndsData("eventDateTime"))).greaterThan(startDateOfPeriod);
        List<String> incidentEventStatusList = Arrays.asList(
                ConfigurationFactory.getConfiguration().getString("exemptionEvents").split("\\s*,\\s*"));
        QueryBuilder inThisEventStatusList = new QueryBuilder().put(
                PersistenceKernel.ndsRecord(PersistenceKernel.ndsData("event"))).in(incidentEventStatusList);   
        QueryBuilder criteria = new QueryBuilder().and(isAfterThisSartPeriodDateTime.get(), inThisEventStatusList.get());
        return new DocumentWrapperPersistenceQuery(criteria);
    }
private PersistenceQuery buildRecordsCriteria ( ) { ZonedDateTime dateTime = ZonedDateTime . now ( ) ; dateTime = dateTime . minusHours ( Integer . parseInt ( configurationManager . getString ( "statisticsPeriod" ) ) ) ; String startDateOfPeriod = dateTime . format ( DateTimeFormatter . ISO_DATE_TIME ) ; QueryBuilder isAfterThisSartPeriodDateTime = new QueryBuilder ( ) . put ( PersistenceKernel . ndsRecord ( PersistenceKernel . ndsData ( "eventDateTime" ) ) ) . greaterThan ( startDateOfPeriod ) ; List < String > incidentEventStatusList = Arrays . asList ( ConfigurationFactory . getConfiguration ( ) . getString ( "exemptionEvents" ) . split ( "\\s*,\\s*" ) ) ; QueryBuilder inThisEventStatusList = new QueryBuilder ( ) . put ( PersistenceKernel . ndsRecord ( PersistenceKernel . ndsData ( "event" ) ) ) . in ( incidentEventStatusList ) ; QueryBuilder criteria = new QueryBuilder ( ) . and ( isAfterThisSartPeriodDateTime . get ( ) , inThisEventStatusList . get ( ) ) ; return new DocumentWrapperPersistenceQuery ( criteria ) ; }
Criteria to use to retrieve incident events
Criteria to use to retrieve incident events