Package hudson.tasks
Class Mailer.DescriptorImpl
- Enclosing class:
- Mailer
-
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) jakarta.mail.SessionCreates a JavaMail session.doAddressCheck(String value) doCheckAuthentication(boolean authentication, boolean useSsl, boolean useTls) doCheckDefaultSuffix(String value) doCheckSmtpHost(String value) 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 addressDeprecated.Deprecated.as of 1.21 UseauthenticationDeprecated.as of 1.21 UseauthenticationDeprecated.as of 1.23, usegetSmtpHost()getUrl()Deprecated.as of 1.4 UseJenkinsLocationConfigurationinsteadbooleanbooleanbooleanisApplicable(Class<? extends AbstractProject> jobType) newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) voidsetAdminAddress(String adminAddress) Deprecated.as of 1.4 UseJenkinsLocationConfigurationinsteadvoidsetAuthentication(SMTPAuthentication authentication) voidsetCharset(String charset) voidsetDefaultSuffix(String defaultSuffix) voidsetHudsonUrl(String hudsonUrl) Deprecated.as of 1.4 UseJenkinsLocationConfigurationinsteadvoidsetReplyToAddress(String address) voidsetSmtpAuth(String userName, String password) Deprecated.as of 1.21 UseauthenticationvoidsetSmtpHost(String smtpHost) voidsetSmtpPort(String smtpPort) voidsetUseSsl(boolean useSsl) voidsetUseTls(boolean useTls) Methods inherited from class hudson.tasks.BuildStepDescriptor
filterMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, 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, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
DescriptorImpl
public DescriptorImpl()
-
-
Method Details
-
getRequiredGlobalConfigPagePermission
- Overrides:
getRequiredGlobalConfigPagePermissionin classDescriptor<Publisher>
-
getDisplayName
- Overrides:
getDisplayNamein classDescriptor<Publisher>
-
getDefaultSuffix
-
getReplyToAddress
-
setReplyToAddress
-
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.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException - Overrides:
configurein classDescriptor<Publisher>- Throws:
Descriptor.FormException
-
getSmtpHost
-
getSmtpServer
Deprecated.as of 1.23, usegetSmtpHost() -
getAdminAddress
Deprecated.as of 1.4 UseJenkinsLocationConfigurationinstead- Returns:
- administrator mail address
-
getUrl
Deprecated.as of 1.4 UseJenkinsLocationConfigurationinstead- Returns:
- Jenkins base URL
-
getSmtpAuthUserName
Deprecated.as of 1.21 Useauthentication -
getSmtpAuthPassword
Deprecated.as of 1.21 Useauthentication -
getSmtpAuthPasswordSecret
-
getUseSsl
public boolean getUseSsl() -
getUseTls
public boolean getUseTls() -
getSmtpPort
-
getCharset
-
setDefaultSuffix
-
setHudsonUrl
Deprecated.as of 1.4 UseJenkinsLocationConfigurationinstead- Parameters:
hudsonUrl- Jenkins base URL to set
-
setAdminAddress
Deprecated.as of 1.4 UseJenkinsLocationConfigurationinstead- Parameters:
adminAddress- Jenkins administrator mail address to set
-
setSmtpHost
-
setUseSsl
@DataBoundSetter public void setUseSsl(boolean useSsl) -
setUseTls
@DataBoundSetter public void setUseTls(boolean useTls) -
setSmtpPort
-
setCharset
-
setAuthentication
-
getAuthentication
-
setSmtpAuth
Deprecated.as of 1.21 Useauthentication -
newInstance
public Publisher newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) throws Descriptor.FormException - Overrides:
newInstancein classDescriptor<Publisher>- Throws:
Descriptor.FormException
-
doAddressCheck
-
doCheckSmtpHost
-
doCheckDefaultSuffix
-
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 totrueSMTP is used without authentication (username and password)username- plaintext username for SMTP authenticationpassword- secret password for SMTP authenticationuseSsl- if set totrueSSL is useduseTls- if set totrueTLS 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
- Specified by:
isApplicablein classBuildStepDescriptor<Publisher>
-
JenkinsLocationConfigurationinstead