Skip to content

Commit

Permalink
traffic-event-bz: fix endpoint url to https, add UUID generation logging
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Dec 27, 2024
1 parent ec6b232 commit c361926
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package it.bz.noi.trafficeventroadworkbz;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.uuid.Generators;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.Point;
Expand Down Expand Up @@ -46,6 +48,18 @@ public void execute() {
EventDto eventDto = new EventDto();

Map<String, Object> uuidFields = getUuidFields(trafficEventRoadwork);

if (LOG.isDebugEnabled()) {
// This happens inside the bdp client library when setting UUID
ObjectMapper mapper = new ObjectMapper();
String uuidNameJson = mapper.writer().writeValueAsString(uuidFields);
String uuid = Generators.nameBasedGenerator(null).generate(uuidNameJson).toString();
LOG.debug("Dumping UUID generation:");
LOG.debug("fields: {}", uuidFields);
LOG.debug("json: {}", uuidNameJson);
LOG.debug("uuid: {}", uuid);
}

eventDto.setUuid(uuidFields);
eventDto.setEventSeriesUuid(uuidFields);
eventDto.setCategory(String.format("%s_%s | %s_%s", trafficEventRoadwork.getTycodeIt(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TrafficEventRoadworkBZConnector {

private static final Logger LOG = LoggerFactory.getLogger(TrafficEventRoadworkBZConnector.class);

private static final String END_POINT_URL = "http://www.provinz.bz.it/vmz/traffic.json";
private static final String END_POINT_URL = "https://www.provinz.bz.it/vmz/traffic.json";

public List<TrafficEventRoadworkBZModel> getTrafficEventRoadworksModelList() throws IOException {

Expand Down

0 comments on commit c361926

Please sign in to comment.