Package hudson.tasks
Class Mailer.DescriptorImpl
- java.lang.Object
-
- hudson.model.Descriptor<T>
-
- hudson.tasks.BuildStepDescriptor<Publisher>
-
- hudson.tasks.Mailer.DescriptorImpl
-
- Enclosing class:
- Mailer
@Extension public static final class Mailer.DescriptorImpl extends BuildStepDescriptor<Publisher>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description DescriptorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
jakarta.mail.Session
createSession()
Creates a JavaMail session.FormValidation
doAddressCheck(String value)
FormValidation
doCheckAuthentication(boolean authentication, boolean useSsl, boolean useTls)
FormValidation
doCheckDefaultSuffix(String value)
FormValidation
doCheckSmtpHost(String value)
FormValidation
doSendTestMail(String smtpHost, String adminAddress, boolean authentication, String username, Secret password, boolean useSsl, boolean useTls, String smtpPort, String charset, String sendTestMailTo)
Send an email to the admin addressString
getAdminAddress()
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadSMTPAuthentication
getAuthentication()
String
getCharset()
String
getDefaultSuffix()
String
getDisplayName()
String
getReplyToAddress()
Permission
getRequiredGlobalConfigPagePermission()
String
getSmtpAuthPassword()
Deprecated.as of 1.21 Useauthentication
Secret
getSmtpAuthPasswordSecret()
String
getSmtpAuthUserName()
Deprecated.as of 1.21 Useauthentication
String
getSmtpHost()
String
getSmtpPort()
String
getSmtpServer()
Deprecated.as of 1.23, usegetSmtpHost()
String
getUrl()
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadboolean
getUseSsl()
boolean
getUseTls()
boolean
isApplicable(Class<? extends AbstractProject> jobType)
Publisher
newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
void
setAdminAddress(String adminAddress)
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadvoid
setAuthentication(SMTPAuthentication authentication)
void
setCharset(String charset)
void
setDefaultSuffix(String defaultSuffix)
void
setHudsonUrl(String hudsonUrl)
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
insteadvoid
setReplyToAddress(String address)
void
setSmtpAuth(String userName, String password)
Deprecated.as of 1.21 Useauthentication
void
setSmtpHost(String smtpHost)
void
setSmtpPort(String smtpPort)
void
setUseSsl(boolean useSsl)
void
setUseTls(boolean useTls)
-
Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
getRequiredGlobalConfigPagePermission
@NonNull public Permission getRequiredGlobalConfigPagePermission()
- Overrides:
getRequiredGlobalConfigPagePermission
in classDescriptor<Publisher>
-
getDisplayName
public String getDisplayName()
- Overrides:
getDisplayName
in classDescriptor<Publisher>
-
getDefaultSuffix
public String getDefaultSuffix()
-
getReplyToAddress
public String getReplyToAddress()
-
setReplyToAddress
@DataBoundSetter public void setReplyToAddress(String address)
-
createSession
public jakarta.mail.Session createSession()
Creates a JavaMail session.- Returns:
- mail session based on the underlying session parameters.
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
- Overrides:
configure
in classDescriptor<Publisher>
- Throws:
Descriptor.FormException
-
getSmtpHost
public String getSmtpHost()
-
getSmtpServer
@Deprecated public String getSmtpServer()
Deprecated.as of 1.23, usegetSmtpHost()
-
getAdminAddress
@Deprecated public String getAdminAddress()
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Returns:
- administrator mail address
-
getUrl
@Deprecated public String getUrl()
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Returns:
- Jenkins base URL
-
getSmtpAuthUserName
@Deprecated public String getSmtpAuthUserName()
Deprecated.as of 1.21 Useauthentication
-
getSmtpAuthPassword
@Deprecated public String getSmtpAuthPassword()
Deprecated.as of 1.21 Useauthentication
-
getSmtpAuthPasswordSecret
public Secret getSmtpAuthPasswordSecret()
-
getUseSsl
public boolean getUseSsl()
-
getUseTls
public boolean getUseTls()
-
getSmtpPort
public String getSmtpPort()
-
getCharset
public String getCharset()
-
setDefaultSuffix
@DataBoundSetter public void setDefaultSuffix(String defaultSuffix)
-
setHudsonUrl
@Deprecated public void setHudsonUrl(String hudsonUrl)
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Parameters:
hudsonUrl
- Jenkins base URL to set
-
setAdminAddress
@Deprecated public void setAdminAddress(String adminAddress)
Deprecated.as of 1.4 UseJenkinsLocationConfiguration
instead- Parameters:
adminAddress
- Jenkins administrator mail address to set
-
setSmtpHost
@DataBoundSetter public void setSmtpHost(String smtpHost)
-
setUseSsl
@DataBoundSetter public void setUseSsl(boolean useSsl)
-
setUseTls
@DataBoundSetter public void setUseTls(boolean useTls)
-
setSmtpPort
@DataBoundSetter public void setSmtpPort(String smtpPort)
-
setCharset
@DataBoundSetter public void setCharset(String charset)
-
setAuthentication
@DataBoundSetter public void setAuthentication(@CheckForNull SMTPAuthentication authentication)
-
getAuthentication
@CheckForNull public SMTPAuthentication getAuthentication()
-
setSmtpAuth
@Deprecated public void setSmtpAuth(String userName, String password)
Deprecated.as of 1.21 Useauthentication
-
newInstance
public Publisher newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) throws Descriptor.FormException
- Overrides:
newInstance
in classDescriptor<Publisher>
- Throws:
Descriptor.FormException
-
doAddressCheck
public FormValidation doAddressCheck(@QueryParameter String value)
-
doCheckSmtpHost
public FormValidation doCheckSmtpHost(@QueryParameter String value)
-
doCheckDefaultSuffix
public FormValidation doCheckDefaultSuffix(@QueryParameter String value)
-
doSendTestMail
public FormValidation doSendTestMail(@QueryParameter String smtpHost, @QueryParameter String adminAddress, @QueryParameter boolean authentication, @QueryParameter String username, @QueryParameter Secret password, @QueryParameter boolean useSsl, @QueryParameter boolean useTls, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException
Send an email to the admin address- Parameters:
smtpHost
- name of the SMTP server to use for mail sendingadminAddress
- Jenkins administrator mail addressauthentication
- if set totrue
SMTP is used without authentication (username and password)username
- plaintext username for SMTP authenticationpassword
- secret password for SMTP authenticationuseSsl
- if set totrue
SSL is useduseTls
- if set totrue
TLS is usedsmtpPort
- port to use for SMTP transfercharset
- charset of the underlying MIME-mail messagesendTestMailTo
- mail address to send test mail to- Returns:
- response with http status code depending on the result of the mail sending
- Throws:
IOException
- in case the active jenkins instance cannot be retrieved
-
doCheckAuthentication
public FormValidation doCheckAuthentication(@QueryParameter boolean authentication, @QueryParameter boolean useSsl, @QueryParameter boolean useTls)
-
isApplicable
public boolean isApplicable(Class<? extends AbstractProject> jobType)
- Specified by:
isApplicable
in classBuildStepDescriptor<Publisher>
-
-