Supporting additional constructor from superclass in NotificationSets to

automatically track the UserStore via OSGi service registry
This commit is contained in:
Steffen Schaefer committed 2016-07-12 10:12:52 +02:00
1 parent 8da490d09a
commit a0cec5fb37
5 files changed
+45

No files matched your search

@@ -4,6 +4,8 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.osgi.framework.BundleContext;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.server.impl.preferences.model.BoatClassNotificationPreference;
import com.sap.sailing.server.impl.preferences.model.BoatClassNotificationPreferences;
@@ -16,6 +18,13 @@ public abstract class AbstractBoatClassNotificationSet
public AbstractBoatClassNotificationSet(UserStore store) {
super(BoatClassNotificationPreferences.PREF_NAME, store);
}
/**
* Constructor used to automatically track {@link UserStore} as OSGi service.
*/
public AbstractBoatClassNotificationSet(BundleContext bundleContext) {
super(BoatClassNotificationPreferences.PREF_NAME, bundleContext);
}
@Override
protected Collection<BoatClass> calculateObjectsToNotify(BoatClassNotificationPreferences preference) {
@@ -4,6 +4,8 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.osgi.framework.BundleContext;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.server.impl.preferences.model.CompetitorNotificationPreference;
import com.sap.sailing.server.impl.preferences.model.CompetitorNotificationPreferences;
@@ -16,6 +18,13 @@ public abstract class AbstractCompetitorNotificationSet
public AbstractCompetitorNotificationSet(UserStore store) {
super(CompetitorNotificationPreferences.PREF_NAME, store);
}
/**
* Constructor used to automatically track {@link UserStore} as OSGi service.
*/
public AbstractCompetitorNotificationSet(BundleContext bundleContext) {
super(CompetitorNotificationPreferences.PREF_NAME, bundleContext);
}
@Override
protected Collection<Competitor> calculateObjectsToNotify(CompetitorNotificationPreferences preference) {
@@ -1,5 +1,7 @@
package com.sap.sailing.server.impl.preferences;
import org.osgi.framework.BundleContext;
import com.sap.sailing.server.impl.preferences.model.BoatClassNotificationPreference;
import com.sap.sse.security.UserStore;
@@ -9,6 +11,13 @@ public class BoatClassResultsNotificationSet extends AbstractBoatClassNotificati
super(store);
}
/**
* Constructor used to automatically track {@link UserStore} as OSGi service.
*/
public BoatClassResultsNotificationSet(BundleContext bundleContext) {
super(bundleContext);
}
@Override
protected boolean shouldNotifyFor(BoatClassNotificationPreference pref) {
return pref.isNotifyAboutResults();
@@ -1,5 +1,7 @@
package com.sap.sailing.server.impl.preferences;
import org.osgi.framework.BundleContext;
import com.sap.sailing.server.impl.preferences.model.BoatClassNotificationPreference;
import com.sap.sse.security.UserStore;
@@ -9,6 +11,13 @@ public class BoatClassUpcomingRaceNotificationSet extends AbstractBoatClassNotif
super(store);
}
/**
* Constructor used to automatically track {@link UserStore} as OSGi service.
*/
public BoatClassUpcomingRaceNotificationSet(BundleContext bundleContext) {
super(bundleContext);
}
@Override
protected boolean shouldNotifyFor(BoatClassNotificationPreference pref) {
return pref.isNotifyAboutUpcomingRaces();
@@ -1,5 +1,7 @@
package com.sap.sailing.server.impl.preferences;
import org.osgi.framework.BundleContext;
import com.sap.sailing.server.impl.preferences.model.CompetitorNotificationPreference;
import com.sap.sse.security.UserStore;
@@ -9,6 +11,13 @@ public class CompetitorResultsNotificationSet extends AbstractCompetitorNotifica
super(store);
}
/**
* Constructor used to automatically track {@link UserStore} as OSGi service.
*/
public CompetitorResultsNotificationSet(BundleContext bundleContext) {
super(bundleContext);
}
@Override
protected boolean shouldNotifyFor(CompetitorNotificationPreference pref) {
return pref.isNotifyAboutResults();