}
}
private boolean synchronizeWorldsOfMatch(Date timestamp, IWVWMatch match) {
checkNotNull(match);
final IWVWMatchEntity entity = this.wvwMatchEntityDAO.findOrCreateWVWMatchEntityOf(match);
checkState(entity.getBlueMap() != null);
checkState(entity.getRedMap() != null);
checkState(entity.getGreenMap() != null);
checkState(entity.getCenterMap() != null);
checkState(entity.getBlueMap() != entity.getRedMap());
checkState(entity.getBlueMap().getId() != entity.getRedMap().getId());
checkState(entity.getBlueMap() != entity.getGreenMap());
checkState(entity.getBlueMap().getId() != entity.getGreenMap().getId());
checkState(entity.getBlueMap() != entity.getCenterMap());
checkState(entity.getBlueMap().getId() != entity.getCenterMap().getId());
checkState(entity.getBlueWorld() != null);
checkState(entity.getRedWorld() != null);
checkState(entity.getGreenWorld() != null);
boolean persisted = false;
this.wvwMatchEntityDAO.synchronizeEntityWithModel(entity, timestamp, match);
checkState(entity.getBlueMap() != null);
checkState(entity.getRedMap() != null);
checkState(entity.getGreenMap() != null);
checkState(entity.getCenterMap() != null);
checkState(entity.getBlueMap() != entity.getRedMap());
checkState(entity.getBlueMap().getId() != entity.getRedMap().getId());
checkState(entity.getBlueMap() != entity.getGreenMap());
checkState(entity.getBlueMap().getId() != entity.getGreenMap().getId());
checkState(entity.getBlueMap() != entity.getCenterMap());
checkState(entity.getBlueMap().getId() != entity.getCenterMap().getId());
checkState(entity.getBlueWorld() != null);
checkState(entity.getRedWorld() != null);
checkState(entity.getGreenWorld() != null);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Successfully synchronized " + IWVWMatchEntity.class.getSimpleName() + " with matchId=" + entity.getOriginMatchId());
}
persisted = this.wvwMatchEntityDAO.save(entity);
if (LOGGER.isDebugEnabled()) {
if (persisted) {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Successfully persisted " + IWVWMatchEntity.class.getSimpleName() + " with matchId=" + entity.getOriginMatchId());
}
}
}
if (!persisted) {
LOGGER.error("Failed to persist synchronized " + IWVWMatchEntity.class.getSimpleName() + " with matchId=" + entity.getOriginMatchId());
}
return persisted;
}