package org.sonar.server.notification;
import com.google.common.collect.Lists;
-import org.sonar.api.server.ServerSide;
+import java.util.Arrays;
+import java.util.List;
+import javax.annotation.Nullable;
import org.sonar.api.notifications.NotificationChannel;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
-import javax.annotation.Nullable;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @since 3.5
- */
-@ServerSide
public class NotificationCenter {
private static final Logger LOG = Loggers.get(NotificationCenter.class);
private final NotificationDispatcherMetadata[] dispatchersMetadata;
private final NotificationChannel[] channels;
- /**
- * Constructor for {@link NotificationCenter}
- */
public NotificationCenter(NotificationDispatcherMetadata[] metadata, NotificationChannel[] channels) {
this.dispatchersMetadata = metadata;
this.channels = channels;
this(new NotificationDispatcherMetadata[0], channels);
}
- /**
- * Default constructor.
- */
public NotificationCenter() {
this(new NotificationDispatcherMetadata[0], new NotificationChannel[0]);
LOG.warn("There is no notification channel - no notification will be delivered!");
}
- /**
- * Returns all the available channels.
- */
public List<NotificationChannel> getChannels() {
return Arrays.asList(channels);
}
import org.picocontainer.Startable;
import org.sonar.api.Properties;
import org.sonar.api.Property;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.config.Settings;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
+import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.jpa.session.DatabaseSessionFactory;
import org.sonar.server.db.DbClient;
-/**
- * @since 2.10
- */
@Properties({
@Property(
key = NotificationService.PROPERTY_DELAY,
private ScheduledExecutorService executorService;
private boolean stopping = false;
- /**
- * Constructor for {@link NotificationService}
- */
public NotificationService(Settings settings, DefaultNotificationManager manager, DbClient dbClient,
- DatabaseSessionFactory databaseSessionFactory, NotificationDispatcher[] dispatchers) {
+ DatabaseSessionFactory databaseSessionFactory, NotificationDispatcher[] dispatchers) {
this.databaseSessionFactory = databaseSessionFactory;
this.delayInSeconds = settings.getLong(PROPERTY_DELAY);
this.delayBeforeReportingStatusInSeconds = settings.getLong(PROPERTY_DELAY_BEFORE_REPORTING_STATUS);
* Default constructor when no dispatchers.
*/
public NotificationService(Settings settings, DefaultNotificationManager manager, DbClient dbClient,
- DatabaseSessionFactory databaseSessionFactory) {
+ DatabaseSessionFactory databaseSessionFactory) {
this(settings, manager, dbClient, databaseSessionFactory, new NotificationDispatcher[0]);
}