Merge remote-tracking branch 'origin/master' into bug2346

This commit is contained in:
Tim Hessenmüller
2021-02-05 13:51:03 +01:00
1050 changed files with 27151 additions and 5544 deletions
@@ -1,8 +1,8 @@
package com.sap.sailing.domain.common;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.sap.sailing.domain.common.dto.PersonDTO;
import com.sap.sse.common.CountryCode;
@@ -15,8 +15,8 @@ import com.sap.sse.common.impl.NamedImpl;
public class CompetitorDescriptor extends NamedImpl implements Named {
private static final long serialVersionUID = -6645726854552711646L;
private final UUID competitorUUID;
private final UUID boatUUID;
private final Serializable competitorId;
private final Serializable boatId;
private final String shortName;
private final String eventName;
private final String regattaName;
@@ -32,23 +32,23 @@ public class CompetitorDescriptor extends NamedImpl implements Named {
private final Duration timeOnDistanceAllowancePerNauticalMile;
public CompetitorDescriptor(String eventName, String regattaName, String raceName, String fleetName,
UUID competitorUUID, String fullName, String shortName, String teamName, Iterable<PersonDTO> persons,
Serializable competitorId, String fullName, String shortName, String teamName, Iterable<PersonDTO> persons,
CountryCode countryCode, Double timeOnTimeFactor,
Duration timeOnDistanceAllowancePerNauticalMile, UUID boatUUID, String boatName, String boatClassName, String sailNumber) {
Duration timeOnDistanceAllowancePerNauticalMile, Serializable boatId, String boatName, String boatClassName, String sailNumber) {
super(fullName);
this.shortName = shortName;
this.eventName = eventName;
this.regattaName = regattaName;
this.raceName = raceName;
this.fleetName = fleetName;
this.competitorUUID = competitorUUID;
this.competitorId = competitorId;
this.teamName = teamName;
this.countryCode = countryCode;
this.persons = new ArrayList<>();
Util.addAll(persons, this.persons);
this.timeOnTimeFactor = timeOnTimeFactor;
this.timeOnDistanceAllowancePerNauticalMile = timeOnDistanceAllowancePerNauticalMile;
this.boatUUID = boatUUID;
this.boatId = boatId;
this.boatName = boatName;
this.boatClassName = boatClassName;
this.sailNumber = sailNumber;
@@ -106,12 +106,12 @@ public class CompetitorDescriptor extends NamedImpl implements Named {
return timeOnDistanceAllowancePerNauticalMile;
}
public UUID getCompetitorUUID() {
return competitorUUID;
public Serializable getCompetitorId() {
return competitorId;
}
public UUID getBoatUUID() {
return boatUUID;
public Serializable getBoatId() {
return boatId;
}
@Override
@@ -2,7 +2,6 @@ package com.sap.sailing.domain.common.dto;
import com.sap.sailing.domain.common.RankingMetrics;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.RegattaNameAndRaceName;
import com.sap.sailing.domain.common.security.SecuredDomainType;
import com.sap.sse.security.shared.HasPermissions;
import com.sap.sse.security.shared.QualifiedObjectIdentifier;
@@ -36,22 +35,23 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
public TrackedRaceStatisticsDTO trackedRaceStatistics;
private String regattaName;
public String boatClass;
private RankingMetrics rankingMetricType;
private RegattaAndRaceIdentifier raceIdentifier;
public RaceDTO() {}
public RaceDTO(RegattaAndRaceIdentifier raceIdentifier, TrackedRaceDTO trackedRace, boolean isCurrentlyTracked, RankingMetrics rankingMetricType) {
super(raceIdentifier, trackedRace);
this.regattaName = raceIdentifier.getRegattaName();
this.raceIdentifier = raceIdentifier;
this.isTracked = isCurrentlyTracked;
this.rankingMetricType = rankingMetricType;
}
public RegattaAndRaceIdentifier getRaceIdentifier() {
return new RegattaNameAndRaceName(regattaName, getName());
return raceIdentifier;
}
public RankingMetrics getRankingMetricType() {
@@ -59,7 +59,7 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
}
public String getRegattaName() {
return regattaName;
return raceIdentifier.getRegattaName();
}
@Override
@@ -69,7 +69,7 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
result = prime * result + ((boatClass == null) ? 0 : boatClass.hashCode());
result = prime * result + (isTracked ? 1231 : 1237);
result = prime * result + ((places == null) ? 0 : places.hashCode());
result = prime * result + ((regattaName == null) ? 0 : regattaName.hashCode());
result = prime * result + ((getRegattaName() == null) ? 0 : getRegattaName().hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
return result;
}
@@ -95,10 +95,10 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
return false;
} else if (!places.equals(other.places))
return false;
if (regattaName == null) {
if (other.regattaName != null)
if (getRegattaName() == null) {
if (other.getRegattaName() != null)
return false;
} else if (!regattaName.equals(other.regattaName))
} else if (!getRegattaName().equals(other.getRegattaName()))
return false;
if (status == null) {
if (other.status != null)
@@ -139,7 +139,7 @@ public class RaceDTO extends BasicRaceDTO implements SecuredDTO {
}
public TypeRelativeObjectIdentifier getTypeRelativeObjectIdentifier() {
return new TypeRelativeObjectIdentifier(regattaName, getName());
return raceIdentifier.getTypeRelativeObjectIdentifier();
}
}
@@ -3,7 +3,7 @@ package com.sap.sailing.domain.common.racelog.tracking;
import java.io.Serializable;
public class MarkAlreadyUsedInRaceException extends Exception implements Serializable {
private static final long serialVersionUID = 2040461905745135256L;
public MarkAlreadyUsedInRaceException() {
@@ -1,31 +0,0 @@
package com.sap.sailing.domain.common.racelog.tracking;
import java.io.IOException;
import java.io.Serializable;
public class TransformationException extends IOException implements Serializable {
private static final long serialVersionUID = -7795777645371428971L;
public TransformationException() {
}
public TransformationException(Class<?> from, Class<?> to, String at, Throwable e) {
super("Couldn't transform "+from.getName()+" into "+to.getName()+" at "+at, e);
}
public TransformationException(Class<?> from, Class<?> to, String at) {
this(from, to, at, null);
}
public TransformationException(String message, Throwable e) {
super(message, e);
}
public TransformationException(Throwable e) {
super(e);
}
public TransformationException(String message) {
super(message);
}
}
@@ -1,5 +1,7 @@
package com.sap.sailing.domain.common.racelog.tracking;
import com.sap.sse.common.TransformationException;
/**
* Handle transformation between two types. Most likely use-case is serialization,
* e.g. for JSON documents or database persistence.
@@ -18,7 +18,7 @@ import com.sap.sse.security.shared.impl.SecuredSecurityTypes;
*/
public class SecuredDomainType extends HasPermissionsImpl {
private static final long serialVersionUID = -7072719056136061490L;
private static final Set<HasPermissions> allInstances = new HashSet<>();
private static final Set<SecuredDomainType> allInstances = new HashSet<>();
public SecuredDomainType(String logicalTypeName, Action... availableActions) {
super(logicalTypeName, availableActions);
@@ -30,7 +30,7 @@ public class SecuredDomainType extends HasPermissionsImpl {
allInstances.add(this);
}
public static Iterable<HasPermissions> getAllInstances() {
public static Iterable<SecuredDomainType> getAllInstances() {
return Collections.unmodifiableSet(allInstances);
}