summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/gitblit/FederationClient.java5
-rw-r--r--src/main/java/com/gitblit/manager/GitblitManager.java5
-rw-r--r--src/main/java/com/gitblit/manager/INotificationManager.java8
-rw-r--r--src/main/java/com/gitblit/manager/NotificationManager.java5
4 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/FederationClient.java b/src/main/java/com/gitblit/FederationClient.java
index c3dcd9da..cd06c3cb 100644
--- a/src/main/java/com/gitblit/FederationClient.java
+++ b/src/main/java/com/gitblit/FederationClient.java
@@ -166,6 +166,11 @@ public class FederationClient {
}
@Override
+ public boolean isSendingMail() {
+ return false;
+ }
+
+ @Override
public void sendMailToAdministrators(String subject, String message) {
}
diff --git a/src/main/java/com/gitblit/manager/GitblitManager.java b/src/main/java/com/gitblit/manager/GitblitManager.java
index ef2433dd..98ad33e7 100644
--- a/src/main/java/com/gitblit/manager/GitblitManager.java
+++ b/src/main/java/com/gitblit/manager/GitblitManager.java
@@ -661,6 +661,11 @@ public class GitblitManager implements IGitblit {
*/
@Override
+ public boolean isSendingMail() {
+ return notificationManager.isSendingMail();
+ }
+
+ @Override
public void sendMailToAdministrators(String subject, String message) {
notificationManager.sendMailToAdministrators(subject, message);
}
diff --git a/src/main/java/com/gitblit/manager/INotificationManager.java b/src/main/java/com/gitblit/manager/INotificationManager.java
index 231cf43a..64fc01e8 100644
--- a/src/main/java/com/gitblit/manager/INotificationManager.java
+++ b/src/main/java/com/gitblit/manager/INotificationManager.java
@@ -22,6 +22,14 @@ import com.gitblit.models.Mailing;
public interface INotificationManager extends IManager {
/**
+ * Returns true if the email service is configured and ready to send notifications.
+ *
+ * @return true if the email service is operational
+ * @since 1.6.0
+ */
+ boolean isSendingMail();
+
+ /**
* Notify the administrators by email.
*
* @param subject
diff --git a/src/main/java/com/gitblit/manager/NotificationManager.java b/src/main/java/com/gitblit/manager/NotificationManager.java
index ba63cfc1..69a611bb 100644
--- a/src/main/java/com/gitblit/manager/NotificationManager.java
+++ b/src/main/java/com/gitblit/manager/NotificationManager.java
@@ -71,6 +71,11 @@ public class NotificationManager implements INotificationManager {
return this;
}
+ @Override
+ public boolean isSendingMail() {
+ return mailService.isReady();
+ }
+
/**
* Notify the administrators by email.
*