Skip to content

Commit

Permalink
Merge branch 'release/3.24.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
msqr committed Jul 10, 2024
2 parents e38c59b + 73c8435 commit 86715d2
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 63 deletions.
2 changes: 1 addition & 1 deletion solarnet/datum/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencyManagement {
}

description = 'SolarNet: Datum'
version = '2.10.1'
version = '2.10.2'

base {
archivesName = 'solarnet-datum'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,54 +354,56 @@ private Iterable<DatumExportResource> exportToResources(Configuration config) {
.toInstant());
}

try (DatumExportOutputFormatService.ExportContext exportContext = outputService
.createExportContext(config.getOutputConfiguration())) {
return doWithinOptionalTransaction(() -> {
try (DatumExportOutputFormatService.ExportContext exportContext = outputService
.createExportContext(config.getOutputConfiguration())) {

BasicBulkExportOptions options = new BasicBulkExportOptions(DATUM_EXPORT_NAME,
singletonMap(DatumEntityDao.EXPORT_PARAMETER_DATUM_CRITERIA, filter));
BasicBulkExportOptions options = new BasicBulkExportOptions(DATUM_EXPORT_NAME,
singletonMap(DatumEntityDao.EXPORT_PARAMETER_DATUM_CRITERIA, filter));

final QueryAuditor auditor = queryAuditor;
if ( auditor != null ) {
auditor.resetCurrentAuditResults();
}

// all exported data will be audited on the hour we start the export at
GeneralNodeDatumPK auditDatumKey = new GeneralNodeDatumPK();
auditDatumKey.setCreated(Instant.now().truncatedTo(ChronoUnit.HOURS));

datumDao.bulkExport(new ExportCallback<GeneralNodeDatumFilterMatch>() {

@Override
public void didBegin(Long totalResultCountEstimate) {
try {
exportContext
.start(totalResultCountEstimate != null ? totalResultCountEstimate
: COUNT_UNKNOWN);
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);
}
final QueryAuditor auditor = queryAuditor;
if ( auditor != null ) {
auditor.resetCurrentAuditResults();
}

@Override
public ExportCallbackAction handle(GeneralNodeDatumFilterMatch d) {
if ( d != null && d.getId() != null && auditor != null ) {
auditDatumKey.setNodeId(d.getId().getNodeId());
auditDatumKey.setSourceId(d.getId().getSourceId());
auditor.addNodeDatumAuditResults(singletonMap(auditDatumKey, 1));
// all exported data will be audited on the hour we start the export at
GeneralNodeDatumPK auditDatumKey = new GeneralNodeDatumPK();
auditDatumKey.setCreated(Instant.now().truncatedTo(ChronoUnit.HOURS));

datumDao.bulkExport(new ExportCallback<GeneralNodeDatumFilterMatch>() {

@Override
public void didBegin(Long totalResultCountEstimate) {
try {
exportContext.start(
totalResultCountEstimate != null ? totalResultCountEstimate
: COUNT_UNKNOWN);
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);
}
}
try {
exportContext.appendDatumMatch(singleton(d), DatumExportTask.this);
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);

@Override
public ExportCallbackAction handle(GeneralNodeDatumFilterMatch d) {
if ( d != null && d.getId() != null && auditor != null ) {
auditDatumKey.setNodeId(d.getId().getNodeId());
auditDatumKey.setSourceId(d.getId().getSourceId());
auditor.addNodeDatumAuditResults(singletonMap(auditDatumKey, 1));
}
try {
exportContext.appendDatumMatch(singleton(d), DatumExportTask.this);
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);
}
return ExportCallbackAction.CONTINUE;
}
return ExportCallbackAction.CONTINUE;
}
}, options);
}, options);

return exportContext.finish();
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);
}
return exportContext.finish();
} catch ( IOException e ) {
throw new DatumExportException(info.getId(), e.getMessage(), e);
}
});
}

private AggregateGeneralNodeDatumFilter policyEnforcer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import net.solarnetwork.central.common.dao.jdbc.CountPreparedStatementCreatorProvider;
import net.solarnetwork.central.datum.domain.DatumReadingType;
import net.solarnetwork.central.datum.domain.GeneralLocationDatum;
Expand Down Expand Up @@ -146,7 +144,7 @@
* {@link JdbcOperations} based implementation of {@link DatumEntityDao}.
*
* @author matt
* @version 2.5
* @version 2.6
* @since 3.8
*/
public class JdbcDatumEntityDao
Expand Down Expand Up @@ -684,7 +682,6 @@ private static RowMapper<ReadingDatum> readingMapper(Aggregation agg) {
}
}

@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
@Override
public ObjectDatumStreamFilterResults<ReadingDatum, DatumPK> findDatumReadingFiltered(
DatumCriteria filter) {
Expand Down Expand Up @@ -730,7 +727,6 @@ public ObjectDatumStreamFilterResults<ReadingDatum, DatumPK> findDatumReadingFil

}

@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
@Override
public ExportResult bulkExport(ExportCallback<GeneralNodeDatumFilterMatch> callback,
ExportOptions options) {
Expand Down Expand Up @@ -766,7 +762,7 @@ public ExportResult bulkExport(ExportCallback<GeneralNodeDatumFilterMatch> callb
if ( combining != null ) {
sqlProps.put(PARAM_COMBINING, combining);
}
// get query name to execute
String query = getQueryForFilter(filter);
*/
Expand Down
2 changes: 1 addition & 1 deletion solarnet/solaruser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

description = 'SolarUser'
version = '2.15.1'
version = '2.15.2'

base {
archivesName = 'solaruser'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* ==================================================================
* WebConfig.java - 9/10/2021 3:20:51 PM
*
*
* Copyright 2021 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
*/
Expand All @@ -40,6 +40,9 @@
import org.springframework.format.datetime.standard.TemporalAccessorParser;
import org.springframework.format.datetime.standard.TemporalAccessorPrinter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.session.config.SessionRepositoryCustomizer;
import org.springframework.session.jdbc.JdbcIndexedSessionRepository;
import org.springframework.session.jdbc.PostgreSqlJdbcIndexedSessionRepositoryCustomizer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.cors.CorsConfiguration;
Expand All @@ -65,7 +68,7 @@

/**
* Web layer configuration.
*
*
* @author matt
* @version 1.3
*/
Expand Down Expand Up @@ -125,6 +128,11 @@ public JSONView json() {
return view;
}

@Bean
public SessionRepositoryCustomizer<JdbcIndexedSessionRepository> sessionRepositoryCustomizer() {
return new PostgreSqlJdbcIndexedSessionRepositoryCustomizer();
}

@Bean
public TimeZonePropertySerializer timeZonePropertySerializer() {
return new TimeZonePropertySerializer();
Expand Down

0 comments on commit 86715d2

Please sign in to comment.