mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 22:15:26 +00:00
Merge branch 'master' into bug5154
This commit is contained in:
commit
c795a26250
2 files changed
+16
-5
No files matched your search
+2
-5
@@ -1983,7 +1983,6 @@ public class RegattasResource extends AbstractSailingServerResource {
|
||||
jsonRaceResults.put("regatta", regatta.getName());
|
||||
jsonRaceResults.put("startOfRace-ms", trackedRace.getStartOfRace() == null ? null : trackedRace
|
||||
.getStartOfRace().asMillis());
|
||||
|
||||
JSONArray jsonLegs = new JSONArray();
|
||||
Course course = trackedRace.getRace().getCourse();
|
||||
course.lockForRead();
|
||||
@@ -2064,7 +2063,6 @@ public class RegattasResource extends AbstractSailingServerResource {
|
||||
.format(distanceSinceGun.getMeters()));
|
||||
}
|
||||
}
|
||||
|
||||
Distance distanceTraveled = trackedLegOfCompetitor.getDistanceTraveled(timePoint);
|
||||
if (distanceTraveled != null) {
|
||||
jsonCompetitorInLeg.put("distanceTraveled-m",
|
||||
@@ -2103,15 +2101,14 @@ public class RegattasResource extends AbstractSailingServerResource {
|
||||
jsonCompetitors.add(jsonCompetitorInLeg);
|
||||
}
|
||||
}
|
||||
jsonLeg.put("competitors", jsonCompetitors);
|
||||
jsonLegs.add(jsonLeg);
|
||||
}
|
||||
jsonLeg.put("competitors", jsonCompetitors);
|
||||
jsonLegs.add(jsonLeg);
|
||||
}
|
||||
} finally {
|
||||
course.unlockAfterRead();
|
||||
}
|
||||
jsonRaceResults.put("legs", jsonLegs);
|
||||
|
||||
String json = jsonRaceResults.toJSONString();
|
||||
return Response.ok(json).header("Content-Type", MediaType.APPLICATION_JSON + ";charset=UTF-8").build();
|
||||
}
|
||||
|
||||
@@ -2077,6 +2077,7 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
|
||||
Thread.currentThread().setContextClassLoader(store.getClass().getClassLoader());
|
||||
}
|
||||
logger.info("Reading user store...");
|
||||
boolean createdServerGroup = false;
|
||||
try {
|
||||
final UserStore newUserStore = (UserStore) is.readObject();
|
||||
final UserGroup newServerGroup = newUserStore.getUserGroupByName(store.getServerGroupName());
|
||||
@@ -2089,6 +2090,7 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
|
||||
final UUID serverGroupUuid = UUID.randomUUID();
|
||||
createUserGroupWithInitialUser(serverGroupUuid, serverGroupName, /* initial user */ null);
|
||||
store.setServerGroup(store.getUserGroupByName(store.getServerGroupName()));
|
||||
createdServerGroup = true;
|
||||
} else if (newServerGroup != oldServerGroup) {
|
||||
store.setServerGroup(newServerGroup);
|
||||
}
|
||||
@@ -2107,6 +2109,18 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
|
||||
}
|
||||
// now ensure that the SERVER object has a valid ownership; use the (potentially new) server group as the default:
|
||||
migrateServerObject();
|
||||
if (createdServerGroup) {
|
||||
final UserGroup serverGroup = store.getServerGroup();
|
||||
setOwnership(serverGroup.getIdentifier(), null, serverGroup, serverGroup.getName());
|
||||
final User adminUserOrNull = store.getUserByName(UserStore.ADMIN_USERNAME);
|
||||
if (adminUserOrNull == null) {
|
||||
logger.info("User 'admin' does not exist on replicated central SecurityService. "
|
||||
+ "'admin' will not be properly set up for this server.");
|
||||
} else {
|
||||
addUserToUserGroup(serverGroup, adminUserOrNull);
|
||||
setDefaultTenantForCurrentServerForUser(UserStore.ADMIN_USERNAME, serverGroup.getId());
|
||||
}
|
||||
}
|
||||
logger.info("Reading isSharedAcrossSubdomains...");
|
||||
sharedAcrossSubdomainsOf = (String) is.readObject();
|
||||
logger.info("...as "+sharedAcrossSubdomainsOf);
|
||||
|
||||
Reference in new issue
Block a user