Adjusted the service layer to handle multiple sailorsInfoWebsiteURLs

This commit is contained in:
Steffen Schaefer committed 2016-02-24 13:13:05 +01:00
1 parent 16a327fecc
commit d4ed30c36e
8 files changed
+23 -17

No files matched your search

@@ -466,7 +466,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
ConcurrentHashMap<String, Regatta> getPersistentRegattasForRaceIDs();
Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL, Iterable<ImageDescriptor> images,
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images,
Iterable<VideoDescriptor> videos);
void setRegattaForRace(Regatta regatta, String raceIdAsString);
@@ -2619,12 +2619,13 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate,
TimePoint endDate, String venue, boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL,
TimePoint endDate, String venue, boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
Event result = new EventImpl(eventName, startDate, endDate, venue, isPublic, id);
addEvent(result);
result.setDescription(eventDescription);
result.setOfficialWebsiteURL(officialWebsiteURL);
result.setSailorsInfoWebsiteURLs(sailorsInfoWebsiteURLs);
result.setImages(images);
result.setVideos(videos);
return result;
@@ -1,6 +1,8 @@
package com.sap.sailing.server.operationaltransformation;
import java.net.URL;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import com.sap.sailing.domain.base.Event;
@@ -28,10 +30,10 @@ public class CreateEvent extends AbstractEventOperation<Event> {
private final Iterable<ImageDescriptor> images;
private final Iterable<VideoDescriptor> videos;
private final URL officialWebsiteURL;
private final URL sailorsInfoWebsiteURL;
private final Map<Locale, URL> sailorsInfoWebsiteURLs;
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
@@ -40,7 +42,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
this.venue = venue;
this.isPublic = isPublic;
this.officialWebsiteURL = officialWebsiteURL;
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
this.sailorsInfoWebsiteURLs = sailorsInfoWebsiteURLs;
this.images = images;
this.videos = videos;
}
@@ -64,7 +66,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
@Override
public Event internalApplyTo(RacingEventService toState) {
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
getId(), officialWebsiteURL, sailorsInfoWebsiteURL, images, videos);
getId(), officialWebsiteURL, sailorsInfoWebsiteURLs, images, videos);
}
}