final long startTimestamp = System.currentTimeMillis();
LOGGER.trace("Going to synchronize matchId=" + matchId);
final Optional<IWVWMatchDTO> matchDTOOptional = WVW_SERVICE.retrieveMatch(matchId);
if (matchDTOOptional.isPresent() && matchDTOOptional.get().getDetails().isPresent()) {
final IWVWMatchDTO matchDTO = matchDTOOptional.get();
final IWVWMatchDetailsDTO matchDetailsDTO = matchDTO.getDetails().get();
final IWVWMatch matchModel = this.matchesMappedById.get(matchId);
// 0. synchronize worlds
this.synchronizeWorldNames(matchModel, matchDTO);
// 1. synchronize maps
this.synchronizeMap(matchModel, matchModel.getCenterMap(), matchDetailsDTO.getCenterMap());
this.synchronizeMap(matchModel, matchModel.getRedMap(), matchDetailsDTO.getRedMap());
this.synchronizeMap(matchModel, matchModel.getBlueMap(), matchDetailsDTO.getBlueMap());
this.synchronizeMap(matchModel, matchModel.getGreenMap(), matchDetailsDTO.getGreenMap());
// 2. synchronize match scores
matchModel.getScores().update(matchDetailsDTO.getRedScore(), matchDetailsDTO.getGreenScore(), matchDetailsDTO.getBlueScore());
} else {
LOGGER.error("Failed to retrieve " + IWVWMatchDTO.class.getSimpleName() + " for matchId=" + matchId);
}
final long endTimestamp = System.currentTimeMillis();
final long duration = endTimestamp - startTimestamp;