mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-13 07:40:58 +00:00
Merge branch 'master' into racecommittee_integrated
Conflicts: java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/coursedata/impl/CourseDataJsonSerializer.java java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/coursedata/CourseBaseJsonSerializer.java java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/coursedata/CourseDataJsonSerializer.java java/com.sap.sailing.server.gateway/WEB-INF/web.xml java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/impl/rc/EventDataJsonExportServlet.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/DataStore.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/InMemoryDataStore.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/OfflineDataManager.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/OnlineDataManager.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/ReadonlyDataManager.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/data/parsers/EventsDataParser.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/domain/impl/FleetIdentifierImpl.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/domain/impl/ManagedRaceImpl.java mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/ui/activities/LoginActivity.java
This commit is contained in:
commit
6abba47d29
11 files changed
+125
-125
No files matched your search
+1
-1
@@ -8,7 +8,7 @@ import com.sap.sailing.domain.common.Named;
|
||||
* Base interface for courses consisting of all static information, which might be shared
|
||||
* by the server and an Android application.
|
||||
*/
|
||||
public interface CourseData extends Named {
|
||||
public interface CourseBase extends Named {
|
||||
/**
|
||||
* Clients can safely iterate over the resulting list because it's a copy which therefore won't reflect
|
||||
* waypoint additions and removals.
|
||||
+1
-1
@@ -8,7 +8,7 @@ import com.sap.sailing.domain.common.WithID;
|
||||
* Base interface for an Event consisting of all static information, which might be shared
|
||||
* by the server and an Android application.
|
||||
*/
|
||||
public interface EventData extends Named, Renamable, WithID {
|
||||
public interface EventBase extends Named, Renamable, WithID {
|
||||
|
||||
/**
|
||||
* @return a non-<code>null</code> venue for this event
|
||||
+1
-1
@@ -5,7 +5,7 @@ import com.sap.sailing.domain.common.Named;
|
||||
/**
|
||||
* Base interface for series consisting of static information describing the Series.
|
||||
*/
|
||||
public interface SeriesData extends Named {
|
||||
public interface SeriesBase extends Named {
|
||||
|
||||
/**
|
||||
* Returns the fleets of this series, in ascending order, better fleets first.
|
||||
+4
-4
@@ -2,10 +2,10 @@ package com.sap.sailing.domain.base.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.base.EventData;
|
||||
import com.sap.sailing.domain.base.EventBase;
|
||||
import com.sap.sailing.domain.base.Venue;
|
||||
|
||||
public class EventDataImpl implements EventData {
|
||||
public class EventBaseImpl implements EventBase {
|
||||
private static final long serialVersionUID = -5749964088848611074L;
|
||||
|
||||
private String name;
|
||||
@@ -14,14 +14,14 @@ public class EventDataImpl implements EventData {
|
||||
private boolean isPublic;
|
||||
private final Serializable id;
|
||||
|
||||
public EventDataImpl(String name, String venueName, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
public EventBaseImpl(String name, String venueName, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
this(name, new VenueImpl(venueName), publicationUrl, isPublic, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param venue must not be <code>null</code>
|
||||
*/
|
||||
public EventDataImpl(String name, Venue venue, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
public EventBaseImpl(String name, Venue venue, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
assert venue != null;
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package com.sap.sailing.domain.base.racegroup;
|
||||
|
||||
import com.sap.sailing.domain.base.SeriesData;
|
||||
import com.sap.sailing.domain.base.SeriesBase;
|
||||
|
||||
/**
|
||||
* The interface represents a series and holds its races. The interface abstracts from the server internal differences
|
||||
* between Leaderboards and Regattas for any app since Leaderboards do not have any series, but Regattas.
|
||||
*/
|
||||
public interface SeriesWithRows extends SeriesData {
|
||||
public interface SeriesWithRows extends SeriesBase {
|
||||
public Iterable<RaceRow> getRaceRows();
|
||||
}
|
||||
@@ -1,46 +1,46 @@
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||
|
||||
import difflib.PatchFailedException;
|
||||
|
||||
/**
|
||||
* A course consists of a sequence of {@link Waypoint}s. The {@link Leg}s extend between the adjacent waypoints.
|
||||
* Therefore, there is one waypoint more than there are legs.
|
||||
* <p>
|
||||
*
|
||||
* A course maintains a re-entrant read/write lock (see {@link ReentrantReadWriteLock}. Individual reading methods
|
||||
* internally use the read lock to protect against concurrent modifications through {@link #removeWaypoint(int)} or
|
||||
* {@link #addWaypoint(int, Waypoint)} which each obtain the write lock. However, if callers expect the waypoint or leg
|
||||
* obtained from a reading call to remain valid, holding the read lock is required. Otherwise, particularly a
|
||||
* {@link #removeWaypoint(int)} call may turn a leg and of course the waypoint invalid and therefore violate the
|
||||
* reader's assumptions. The write lock is still held while propagating the updates to all {@link CourseListener}s
|
||||
* registered. It is of course necessary to always use {@link #lockForRead()} and {@link #unlockAfterRead()}
|
||||
* symmetrically, where the {@link #unlockAfterRead()} call should happen in a <code>finally</code> clause to guarantee
|
||||
* execution.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface Course extends CourseData {
|
||||
void lockForRead();
|
||||
|
||||
void unlockAfterRead();
|
||||
|
||||
void addCourseListener(CourseListener listener);
|
||||
|
||||
void removeCourseListener(CourseListener listener);
|
||||
|
||||
/**
|
||||
* Carefully merges the new list of control points into this course by constructing a minimal difference between the
|
||||
* control point list and the control points referenced by this course's waypoints. Change events are propagated
|
||||
* to the registered {@link CourseListener}s as if {@link #addWaypoint(int, Waypoint)} and {@link #removeWaypoint(int)}
|
||||
* had been used.
|
||||
*/
|
||||
void update(List<Pair<ControlPoint, NauticalSide>> newControlPoints, DomainFactory baseDomainFactory) throws PatchFailedException;
|
||||
}
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||
|
||||
import difflib.PatchFailedException;
|
||||
|
||||
/**
|
||||
* A course consists of a sequence of {@link Waypoint}s. The {@link Leg}s extend between the adjacent waypoints.
|
||||
* Therefore, there is one waypoint more than there are legs.
|
||||
* <p>
|
||||
*
|
||||
* A course maintains a re-entrant read/write lock (see {@link ReentrantReadWriteLock}. Individual reading methods
|
||||
* internally use the read lock to protect against concurrent modifications through {@link #removeWaypoint(int)} or
|
||||
* {@link #addWaypoint(int, Waypoint)} which each obtain the write lock. However, if callers expect the waypoint or leg
|
||||
* obtained from a reading call to remain valid, holding the read lock is required. Otherwise, particularly a
|
||||
* {@link #removeWaypoint(int)} call may turn a leg and of course the waypoint invalid and therefore violate the
|
||||
* reader's assumptions. The write lock is still held while propagating the updates to all {@link CourseListener}s
|
||||
* registered. It is of course necessary to always use {@link #lockForRead()} and {@link #unlockAfterRead()}
|
||||
* symmetrically, where the {@link #unlockAfterRead()} call should happen in a <code>finally</code> clause to guarantee
|
||||
* execution.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface Course extends CourseBase {
|
||||
void lockForRead();
|
||||
|
||||
void unlockAfterRead();
|
||||
|
||||
void addCourseListener(CourseListener listener);
|
||||
|
||||
void removeCourseListener(CourseListener listener);
|
||||
|
||||
/**
|
||||
* Carefully merges the new list of control points into this course by constructing a minimal difference between the
|
||||
* control point list and the control points referenced by this course's waypoints. Change events are propagated
|
||||
* to the registered {@link CourseListener}s as if {@link #addWaypoint(int, Waypoint)} and {@link #removeWaypoint(int)}
|
||||
* had been used.
|
||||
*/
|
||||
void update(List<Pair<ControlPoint, NauticalSide>> newControlPoints, DomainFactory baseDomainFactory) throws PatchFailedException;
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import com.sap.sailing.domain.common.Named;
|
||||
import com.sap.sailing.domain.common.Renamable;
|
||||
import com.sap.sailing.domain.common.WithID;
|
||||
|
||||
/**
|
||||
* An event is a group of {@link Regatta regattas} carried out at a common venue within a common time frame. For
|
||||
* example, Kiel Week 2011 is an event, and the International German Championship 2011 held, e.g., in Travem�nde, is an event,
|
||||
* too.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public interface Event extends Named, Renamable, WithID, EventData {
|
||||
Iterable<Regatta> getRegattas();
|
||||
|
||||
void addRegatta(Regatta regatta);
|
||||
|
||||
void removeRegatta(Regatta regatta);
|
||||
}
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import com.sap.sailing.domain.common.Named;
|
||||
import com.sap.sailing.domain.common.Renamable;
|
||||
import com.sap.sailing.domain.common.WithID;
|
||||
|
||||
/**
|
||||
* An event is a group of {@link Regatta regattas} carried out at a common venue within a common time frame. For
|
||||
* example, Kiel Week 2011 is an event, and the International German Championship 2011 held, e.g., in Travem�nde, is an event,
|
||||
* too.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public interface Event extends Named, Renamable, WithID, EventBase {
|
||||
Iterable<Regatta> getRegattas();
|
||||
|
||||
void addRegatta(Regatta regatta);
|
||||
|
||||
void removeRegatta(Regatta regatta);
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import com.sap.sailing.domain.tracking.TrackedRegattaRegistry;
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public interface Series extends SeriesData {
|
||||
public interface Series extends SeriesBase {
|
||||
|
||||
/**
|
||||
* A series consists of one or more "race columns." Some people would just say "race," but we use the term "race" for
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
package com.sap.sailing.domain.base.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.base.Venue;
|
||||
|
||||
public class EventImpl extends EventDataImpl implements Event {
|
||||
private static final long serialVersionUID = 855135446595485715L;
|
||||
|
||||
private final Set<Regatta> regattas;
|
||||
|
||||
public EventImpl(String name, String venueName, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
this(name, new VenueImpl(venueName), publicationUrl, isPublic, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param venue must not be <code>null</code>
|
||||
*/
|
||||
public EventImpl(String name, Venue venue, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
super(name, venue, publicationUrl, isPublic, id);
|
||||
this.regattas = new HashSet<Regatta>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Regatta> getRegattas() {
|
||||
return Collections.unmodifiableSet(regattas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRegatta(Regatta regatta) {
|
||||
regattas.add(regatta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRegatta(Regatta regatta) {
|
||||
regattas.remove(regatta);
|
||||
}
|
||||
}
|
||||
package com.sap.sailing.domain.base.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.base.Venue;
|
||||
|
||||
public class EventImpl extends EventBaseImpl implements Event {
|
||||
private static final long serialVersionUID = 855135446595485715L;
|
||||
|
||||
private final Set<Regatta> regattas;
|
||||
|
||||
public EventImpl(String name, String venueName, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
this(name, new VenueImpl(venueName), publicationUrl, isPublic, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param venue must not be <code>null</code>
|
||||
*/
|
||||
public EventImpl(String name, Venue venue, String publicationUrl, boolean isPublic, Serializable id) {
|
||||
super(name, venue, publicationUrl, isPublic, id);
|
||||
this.regattas = new HashSet<Regatta>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Regatta> getRegattas() {
|
||||
return Collections.unmodifiableSet(regattas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRegatta(Regatta regatta) {
|
||||
regattas.add(regatta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRegatta(Regatta regatta) {
|
||||
regattas.remove(regatta);
|
||||
}
|
||||
}
|
||||
@@ -17,12 +17,12 @@
|
||||
<!-- RACE COMMITTEE START -->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>RCLeaderboards</servlet-name>
|
||||
<servlet-name>RaceGroups</servlet-name>
|
||||
<servlet-class>com.sap.sailing.server.gateway.impl.rc.RaceGroupJsonExportServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RCLeaderboards</servlet-name>
|
||||
<url-pattern>/rc/leaderboards</url-pattern>
|
||||
<servlet-name>RaceGroups</servlet-name>
|
||||
<url-pattern>/rc/racegroups</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<servlet>
|
||||
<servlet-name>RCAddToRaceLog</servlet-name>
|
||||
<servlet-class>com.sap.sailing.server.gateway.impl.rc.AddToRaceLogJsonExportServlet</servlet-class>
|
||||
<servlet-class>com.sap.sailing.server.gateway.impl.rc.AddEntryToRaceLogJsonPostServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RCAddToRaceLog</servlet-name>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import com.sap.sailing.server.gateway.deserialization.JsonDeserializer;
|
||||
import com.sap.sailing.server.gateway.deserialization.impl.Helpers;
|
||||
import com.sap.sailing.server.gateway.deserialization.impl.RaceLogEventDeserializer;
|
||||
|
||||
public class AddToRaceLogJsonExportServlet extends AbstractJsonHttpServlet {
|
||||
public class AddEntryToRaceLogJsonPostServlet extends AbstractJsonHttpServlet {
|
||||
private static final long serialVersionUID = 7704668926551060433L;
|
||||
|
||||
public static final String PARAMS_LEADERBOARD_NAME = "leaderboard";
|
||||
Reference in new issue
Block a user