removed methods to add or remove imageURL, sponsorImageURL and videoURLs as they are now derived always from the corresponding images and videos

This commit is contained in:
fmittag committed 2015-06-12 17:44:33 +02:00
1 parent 32b77348f0
commit 0e85f3c32d
17 files changed
+115 -300

No files matched your search

@@ -371,8 +371,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
*/
void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
URL logoImageURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos);
URL logoImageURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos);
/**
* Renames a sailing event. If a sailing event by the name <code>oldName</code> does not exist in {@link #getEvents()},
@@ -467,8 +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, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, URL logoImageURL, URL officialWebsiteURL);
boolean isPublic, UUID id, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, URL logoImageURL, URL officialWebsiteURL);
void setRegattaForRace(Regatta regatta, String raceIdAsString);
@@ -2574,13 +2574,9 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
public Event addEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venue, boolean isPublic, UUID id) {
Event result = createEventWithoutReplication(eventName, eventDescription, startDate, endDate, venue, isPublic,
id, /* imageURLs */Collections.<URL> emptyList(),
/* videoURLs */Collections.<URL> emptyList(), /* sponsorImageURLs */Collections.<URL> emptyList(),
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(),
id, /* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(),
/* logoImageURL */ null, /* officialWebsiteURL */null);
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, /* imageURLs */
id, Collections.<URL> emptyList(),
/* videoURLs */Collections.<URL> emptyList(), /* sponsorImageURLs */Collections.<URL> emptyList(),
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, id,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(),
/* logoimageURL */null, /* officialWebsiteURLAsString */null));
return result;
@@ -2593,15 +2589,11 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate,
TimePoint endDate, String venue, boolean isPublic, UUID id, Iterable<URL> imageURLs,
Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos,
TimePoint endDate, String venue, boolean isPublic, UUID id, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos,
URL logoImageURL, URL officialWebsiteURL) {
Event result = new EventImpl(eventName, startDate, endDate, venue, isPublic, id);
addEvent(result);
result.setDescription(eventDescription);
result.setImageURLs(imageURLs);
result.setVideoURLs(videoURLs);
result.setSponsorImageURLs(sponsorImageURLs);
result.setLogoImageURL(logoImageURL);
result.setOfficialWebsiteURL(officialWebsiteURL);
result.setImages(images);
@@ -2621,8 +2613,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
URL logoImageURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
URL logoImageURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
final Event event = eventsById.get(id);
if (event == null) {
throw new IllegalArgumentException("Sailing event with ID " + id + " does not exist.");
@@ -2646,9 +2637,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
event.setLeaderboardGroups(leaderboardGroups);
event.setOfficialWebsiteURL(officialWebsiteURL);
event.setLogoImageURL(logoImageURL);
event.setImageURLs(imageURLs);
event.setVideoURLs(videoURLs);
event.setSponsorImageURLs(sponsorImageURLs);
event.setImages(images);
event.setVideos(videos);
// TODO consider use diffutils to compute diff between old and new leaderboard groups list and apply the patch
@@ -25,17 +25,13 @@ public class CreateEvent extends AbstractEventOperation<Event> {
private final boolean isPublic;
private final String eventName;
private final String eventDescription;
private final Iterable<URL> videoURLs;
private final Iterable<URL> imageURLs;
private final Iterable<URL> sponsorImageURLs;
private final Iterable<ImageDescriptor> images;
private final Iterable<VideoDescriptor> videos;
private final URL logoImageURL;
private final URL officialWebsiteURL;
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, URL logoImageURL, URL officialWebsiteURL) {
boolean isPublic, UUID id, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, URL logoImageURL, URL officialWebsiteURL) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
@@ -43,9 +39,6 @@ public class CreateEvent extends AbstractEventOperation<Event> {
this.endDate = endDate;
this.venue = venue;
this.isPublic = isPublic;
this.imageURLs = imageURLs;
this.videoURLs = videoURLs;
this.sponsorImageURLs = sponsorImageURLs;
this.images = images;
this.videos = videos;
this.logoImageURL = logoImageURL;
@@ -71,7 +64,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
@Override
public Event internalApplyTo(RacingEventService toState) {
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
getId(), imageURLs, videoURLs, sponsorImageURLs, images, videos, logoImageURL, officialWebsiteURL);
getId(), images, videos, logoImageURL, officialWebsiteURL);
}
}
@@ -20,16 +20,12 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
private final String eventDescription;
private final URL officialWebsiteURL;
private final URL logoImageURL;
private final Iterable<URL> imageURLs;
private final Iterable<URL> videoURLs;
private final Iterable<URL> sponsorImageURLs;
private final Iterable<ImageDescriptor> images;
private final Iterable<VideoDescriptor> videos;
public UpdateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL logoImageURL,
URL officialWebsiteURL, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
URL officialWebsiteURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
@@ -40,9 +36,6 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
this.leaderboardGroupIds = leaderboardGroupIds;
this.officialWebsiteURL = officialWebsiteURL;
this.logoImageURL = logoImageURL;
this.imageURLs = imageURLs;
this.videoURLs = videoURLs;
this.sponsorImageURLs = sponsorImageURLs;
this.images = images;
this.videos = videos;
}
@@ -62,7 +55,7 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
@Override
public Void internalApplyTo(RacingEventService toState) {
toState.updateEvent(getId(), eventName, eventDescription, startDate, endDate, venueName, isPublic,
leaderboardGroupIds, officialWebsiteURL, logoImageURL, imageURLs, videoURLs, sponsorImageURLs, images, videos);
leaderboardGroupIds, officialWebsiteURL, logoImageURL, images, videos);
return null;
}
}