|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.configuration.XMLConfiguration
org.osesb.configuration.SMTPClientConfiguration
public class SMTPClientConfiguration
Parses a SMTP client configuration content model in a XML configuration file and sets configuration Properties for SMTP clients in the org.osesb.connectors.smtp package. Contains convenience methods for accessing SMTP properties.
A SMTPClientConfiguration can be embedded in any XMLConfiguration;
Example SMTPClientConfiguration content model:
{@code
mail.myserver.com
25
0
true
testClient@osesb.org
testClient
jdoeto1@somewhere.org
jdoeto2@somewhere.org
jdoecc1@somewhere.org
jdoecc2@somewhere.org
jdoebcc1@somewhere.org
jdoebcc2@somewhere.org
}| Field Summary | |
|---|---|
protected java.util.List |
bccDestinationList
List of configured BCC destination addresses. |
protected java.util.List |
ccDestinationList
List of configured CC destination addresses. |
protected java.util.List |
toDestinationList
List of configured To destination addresses. |
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
SMTPClientConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of SMTPClientConfiguration given the content model Element. |
|
SMTPClientConfiguration(java.util.Properties configurationProperties)
Creates a new instance of SMTPClientConfiguration given the configuration Properties. |
|
SMTPClientConfiguration(java.lang.String configFile)
Creates a new instance of SMTPClientConfiguration given a XML configuration file. |
|
SMTPClientConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of SMTPClientConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
void |
addBCCAddress(java.lang.String bccAddress)
Adds a configured BCC destination address. |
void |
addCCAddress(java.lang.String ccAddress)
Adds a configured CC destination address. |
void |
addToAddress(java.lang.String toAddress)
Adds a configured To destination address. |
java.lang.String[] |
getBCCAddresses()
Return the configured BCC destination addresses. |
java.lang.String[] |
getCCAddresses()
Return the configured CC destination addresses. |
java.lang.String |
getFromAddress()
Returns the From address. |
java.lang.String |
getFromName()
Returns the From name. |
java.lang.String |
getHostname()
Returns the SMTP host name. |
java.lang.String |
getPassword()
Returns the password for the SMTP host. |
int |
getPort()
Returns the SMTP port for the connection. |
int |
getRetryCount()
Returns the Retry count for sending messages. |
java.lang.String[] |
getToAddresses()
Return the configured To destination addresses. |
java.lang.String |
getUsername()
Returns the username for the SMTP host. |
protected void |
loadConfiguredDestinationAddresses()
Loads configured To, CC, and BCC destination addresses. |
static void |
main(java.lang.String[] args)
main() For testing and sandboxing. |
void |
setFromAddress(java.lang.String fromAddress)
Sets the From address. |
void |
setFromName(java.lang.String fromName)
Sets the From name. |
void |
setHostname(java.lang.String hostName)
Sets the SMTP host name. |
void |
setPassword(java.lang.String password)
Sets the password for the SMTP host. |
void |
setPort(int port)
Sets the SMTP port for the connection. |
void |
setRetryCount(int retryCount)
Sets the Retry count for sending messages. |
void |
setUsername(java.lang.String userName)
Sets the username for the SMTP host. |
java.lang.String |
toString()
Returns the String representation of this XMLConfiguration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List toDestinationList
addToAddress(String toAddress)protected java.util.List ccDestinationList
addCCAddress(String toAddress)protected java.util.List bccDestinationList
addBCCAddress(String toAddress)| Constructor Detail |
|---|
public SMTPClientConfiguration(java.lang.String configFile)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public SMTPClientConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.xpathExpression - A XPath expression that evaluates to the
element that marks the beginning of the
configuration. If following the framework
convention for SMTPClientConfiguration(s),
xpathExpression should have'smtp-client-configuration'
as the last Element in the path.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public SMTPClientConfiguration(org.w3c.dom.Element contentModelElement)
throws java.lang.Exception
contentModelElement - The top level Element for the
for the configuration.
java.lang.Exception - if there is a fatal error transversing the
configuration content model enclosed by contentModelElement.
public SMTPClientConfiguration(java.util.Properties configurationProperties)
throws java.lang.Exception
configurationProperties - Configuration name / value pairs as Properties.
java.lang.Exception - if incorrect parameters are passed| Method Detail |
|---|
protected final void loadConfiguredDestinationAddresses()
throws java.lang.Exception
java.lang.Exception - if there is a fatal error transversing the DOM
that contains the configuration content model.JAXRPCDynamicClient.invokeService(
Object[] serviceParameters,
String username,
String password),
JAXRPCClientAddressingHandler,
JAXRPCWSAddressingConfigurationpublic java.lang.String getHostname()
public void setHostname(java.lang.String hostName)
hostName - the SMTP host name.public java.lang.String getUsername()
public void setUsername(java.lang.String userName)
userName - the username for the SMTP host.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - the password for the SMTP host.public int getPort()
public void setPort(int port)
port - the SMTP host port.public int getRetryCount()
public void setRetryCount(int retryCount)
retryCount - the retry count for sending messages.public java.lang.String getFromAddress()
public void setFromAddress(java.lang.String fromAddress)
fromAddress - the From address.public java.lang.String getFromName()
public void setFromName(java.lang.String fromName)
fromName - the From name.public void addToAddress(java.lang.String toAddress)
toAddress - the SMTP address that will be
added to the configured To destination addresses.public java.lang.String[] getToAddresses()
public void addCCAddress(java.lang.String ccAddress)
ccAddress - the SMTP address that will be
added to the configured CC destination addresses.public java.lang.String[] getCCAddresses()
public void addBCCAddress(java.lang.String bccAddress)
bccAddress - the SMTP address that will be
added to the configured BCC destination addresses.public java.lang.String[] getBCCAddresses()
public java.lang.String toString()
toString in class XMLConfigurationpublic static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||