Class MailConfigurationServiceImpl

    • Constructor Detail

      • MailConfigurationServiceImpl

        @Inject
        public MailConfigurationServiceImpl​(@Lazy
                                            SecretEncryptionService secretEncryptionService,
                                            BambooPermissionManager bambooPermissionManager,
                                            com.atlassian.struts.TextProvider textProvider)
    • Method Detail

      • updateMailServer

        @NotNull
        public @NotNull com.atlassian.mail.server.SMTPMailServer updateMailServer​(@Nullable
                                                                                  @Nullable String name,
                                                                                  @Nullable
                                                                                  @Nullable String fromAddress,
                                                                                  @Nullable
                                                                                  @Nullable String subjectPrefix,
                                                                                  @Nullable
                                                                                  @Nullable Boolean precedenceBulkHeaderExcluded,
                                                                                  @Nullable
                                                                                  @Nullable String emailSetting,
                                                                                  @Nullable
                                                                                  @Nullable String smtpServer,
                                                                                  @Nullable
                                                                                  @Nullable String smtpPort,
                                                                                  @Nullable
                                                                                  @Nullable String smtpUsername,
                                                                                  @Nullable
                                                                                  @Nullable String smtpPassword,
                                                                                  @Nullable
                                                                                  @Nullable Boolean tlsEnabled,
                                                                                  @Nullable
                                                                                  @Nullable String jndiLocation)
                                                                           throws WebValidationException,
                                                                                  UnauthorisedException
        Description copied from interface: MailConfigurationService
        Update the current mail server configuration
        Specified by:
        updateMailServer in interface MailConfigurationService
        Parameters:
        name - name of the email server
        fromAddress - an email address Bamboo-generated emails are sent from, must be a valid email address
        subjectPrefix - prefix added to the email subject
        precedenceBulkHeaderExcluded - whether to exclude "precedence:bulk" email header
        emailSetting - must be either "JNDI" or "SMTP"
        smtpServer - address of SMTP server, null for "JDNI"
        smtpPort - port of SMTP server, null for "JNDI"
        smtpUsername - user name, null for "JNDI"
        smtpPassword - password, null for "JNDI"
        tlsEnabled - whether TLS is enabled, null for "JNDI"
        jndiLocation - JNDI address specyfing email server, null for "SMTP"
        Returns:
        SMTPMailServer - mail server configuration after the update
        Throws:
        WebValidationException - if the supplied parameters are invalid
        UnauthorisedException - if user does not have appropriate permissions (System Administrator)
      • updateMailServer

        @NotNull
        public @NotNull com.atlassian.mail.server.SMTPMailServer updateMailServer​(@Nullable
                                                                                  @Nullable String name,
                                                                                  @Nullable
                                                                                  @Nullable String fromAddress,
                                                                                  @Nullable
                                                                                  @Nullable String subjectPrefix,
                                                                                  @Nullable
                                                                                  @Nullable Boolean precedenceBulkHeaderExcluded,
                                                                                  @Nullable
                                                                                  @Nullable MailConfigurationService.MailMode emailSetting,
                                                                                  @Nullable
                                                                                  @Nullable String smtpServer,
                                                                                  @Nullable
                                                                                  @Nullable String smtpPort,
                                                                                  @Nullable
                                                                                  @Nullable String smtpUsername,
                                                                                  @Nullable
                                                                                  @Nullable String smtpPassword,
                                                                                  @Nullable
                                                                                  @Nullable Boolean tlsEnabled,
                                                                                  @Nullable
                                                                                  @Nullable String jndiLocation)
                                                                           throws WebValidationException,
                                                                                  UnauthorisedException
        Description copied from interface: MailConfigurationService
        Update the current mail server configuration
        Specified by:
        updateMailServer in interface MailConfigurationService
        Parameters:
        name - name of the email server
        fromAddress - an email address Bamboo-generated emails are sent from, must be a valid email address
        subjectPrefix - prefix added to the email subject
        precedenceBulkHeaderExcluded - whether to exclude "precedence:bulk" email header
        emailSetting - MailMode.JNDI or MailMode.SMTP
        smtpServer - address of SMTP server, null for JDNI
        smtpPort - port of SMTP server, null for JNDI
        smtpUsername - user name, null for JNDI
        smtpPassword - password, null for JNDI
        tlsEnabled - whether TLS is enabled, null for JNDI
        jndiLocation - JNDI address specyfing email server, null for SMTP
        Returns:
        SMTPMailServer - mail server configuration after the update
        Throws:
        WebValidationException - if the supplied parameters are invalid
        UnauthorisedException - if user does not have appropriate permissions (System Administrator)
      • validateJndiLocation

        @NotNull
        public @NotNull List<String> validateJndiLocation​(@NotNull
                                                          @NotNull String jndiName)
        Description copied from interface: MailConfigurationService
        Validates JNDI location for mail server.

        This method will not check whether the server can be found under the given location. Only the validity of the location (e.g. that a supported scheme was used) is checked.

        Specified by:
        validateJndiLocation in interface MailConfigurationService
        Parameters:
        jndiName - JNDI address specifying email server
        Returns:
        list of discovered errors, empty if the given JNDI location is valid