mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
Now logging when tracked race is connected with race column
also loggin which user linked the race.
This commit is contained in:
1 parent
c72c5e2928
commit
883ef38d90
3 files changed
+18
No files matched your search
+5
@@ -5,6 +5,7 @@ import java.io.ObjectInputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
@@ -20,6 +21,8 @@ import com.sap.sse.common.Util;
|
||||
|
||||
public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implements RaceColumn {
|
||||
private static final long serialVersionUID = -7801617988982540470L;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AbstractRaceColumn.class.getName());
|
||||
|
||||
private TrackedRaces trackedRaces;
|
||||
private Map<Fleet, RaceIdentifier> raceIdentifiers;
|
||||
@@ -70,6 +73,8 @@ public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implem
|
||||
if (trackedRace != null) {
|
||||
this.trackedRaces.put(fleet, trackedRace);
|
||||
this.setRaceIdentifier(fleet, trackedRace.getRaceIdentifier());
|
||||
logger.info(String.format("Linked race column %s with tracked race %s.", this.getName(),
|
||||
trackedRace.getRace().getName()));
|
||||
}
|
||||
}
|
||||
if (trackedRace != null) {
|
||||
|
||||
+9
@@ -452,6 +452,7 @@ import com.sap.sse.replication.ReplicationFactory;
|
||||
import com.sap.sse.replication.ReplicationMasterDescriptor;
|
||||
import com.sap.sse.replication.ReplicationService;
|
||||
import com.sap.sse.replication.impl.ReplicaDescriptor;
|
||||
import com.sap.sse.security.SessionUtils;
|
||||
import com.sap.sse.util.ServiceTrackerFactory;
|
||||
import com.sapsailing.xrr.structureimport.eventimport.RegattaJSON;
|
||||
|
||||
@@ -2370,6 +2371,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
@Override
|
||||
public boolean connectTrackedRaceToLeaderboardColumn(String leaderboardName, String raceColumnName,
|
||||
String fleetName, RegattaAndRaceIdentifier raceIdentifier) {
|
||||
Object principal = SessionUtils.getPrincipal();
|
||||
if (principal != null) {
|
||||
logger.info(String.format("%s linked race column %s %s (%s) with tracked race %s.", principal.toString(),
|
||||
leaderboardName, raceColumnName, fleetName, raceIdentifier.getRaceName()));
|
||||
} else {
|
||||
logger.info(String.format("Linked race column %s %s (%s) with tracked race %s.", leaderboardName, raceColumnName, fleetName,
|
||||
raceIdentifier.getRaceName()));
|
||||
}
|
||||
return getService().apply(new ConnectTrackedRaceToLeaderboardColumn(leaderboardName, raceColumnName, fleetName, raceIdentifier));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,4 +168,8 @@ public class SessionUtils {
|
||||
}
|
||||
return (Token) session.getAttribute(SESSION_REQUEST_TOKEN);
|
||||
}
|
||||
|
||||
public static Object getPrincipal() {
|
||||
return SecurityUtils.getSubject().getPrincipal();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user