summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-06-05 10:23:58 -0400
committerJames Moger <james.moger@gitblit.com>2014-06-05 10:23:58 -0400
commit74221eb302e782ef23777d5c3f0a649ceb321c1e (patch)
tree2bd26e2e9ccb51a97fa9266c589e703df764994d
parent6537deb8b76b7a4725c40a174a7c440385f88e51 (diff)
downloadgitblit-74221eb302e782ef23777d5c3f0a649ceb321c1e.tar.gz
gitblit-74221eb302e782ef23777d5c3f0a649ceb321c1e.zip
Add method to INotificationManager to return email service status
-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.
*