]> source.dussan.org Git - gitblit.git/commitdiff
Add method to INotificationManager to return email service status
authorJames Moger <james.moger@gitblit.com>
Thu, 5 Jun 2014 14:23:58 +0000 (10:23 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 5 Jun 2014 14:23:58 +0000 (10:23 -0400)
src/main/java/com/gitblit/FederationClient.java
src/main/java/com/gitblit/manager/GitblitManager.java
src/main/java/com/gitblit/manager/INotificationManager.java
src/main/java/com/gitblit/manager/NotificationManager.java

index c3dcd9daf619998367df7ef397d01bc5b30cf808..cd06c3cbd05a6b5ab43f2a09588d13c1dc6d6634 100644 (file)
@@ -165,6 +165,11 @@ public class FederationClient {
                        return this;\r
                }\r
 \r
+               @Override\r
+               public boolean isSendingMail() {\r
+                       return false;\r
+               }\r
+\r
                @Override\r
                public void sendMailToAdministrators(String subject, String message) {\r
                }\r
index ef2433ddcff2a5d5fccc38861045a773c4b928c2..98ad33e737ac26f48853ed95e54bdae36ba23ab1 100644 (file)
@@ -660,6 +660,11 @@ public class GitblitManager implements IGitblit {
         * NOTIFICATION MANAGER
         */
 
+       @Override
+       public boolean isSendingMail() {
+               return notificationManager.isSendingMail();
+       }
+
        @Override
        public void sendMailToAdministrators(String subject, String message) {
                notificationManager.sendMailToAdministrators(subject, message);
index 231cf43aba233f39a04c2d158651031d2bfd9f50..64fc01e85a060c7fb075c006e84a82bb4c737424 100644 (file)
@@ -21,6 +21,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.
         *
index ba63cfc12f212d219ed8954cee4aef9c8afbb7d9..69a611bbdc09c564fd7dae9dbb80955288d06fb8 100644 (file)
@@ -71,6 +71,11 @@ public class NotificationManager implements INotificationManager {
                return this;
        }
 
+       @Override
+       public boolean isSendingMail() {
+               return mailService.isReady();
+       }
+
        /**
         * Notify the administrators by email.
         *