Package org.opennms.netmgt.dao.jaxb
Class DefaultJavamailConfigurationDao
- java.lang.Object
-
- org.opennms.core.xml.AbstractJaxbConfigDao<JavamailConfiguration,JavamailConfiguration>
-
- org.opennms.netmgt.dao.jaxb.DefaultJavamailConfigurationDao
-
- All Implemented Interfaces:
JavaMailConfigurationDao
,org.springframework.beans.factory.InitializingBean
public class DefaultJavamailConfigurationDao extends AbstractJaxbConfigDao<JavamailConfiguration,JavamailConfiguration> implements JavaMailConfigurationDao
The Class DefaultJavamailConfigurationDao.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.core.xml.AbstractJaxbConfigDao
AbstractJaxbConfigDao.JaxbReloadCallback
-
-
Constructor Summary
Constructors Constructor Description DefaultJavamailConfigurationDao()
Instantiates a new default javamail configuration DAO.DefaultJavamailConfigurationDao(java.lang.Class<JavamailConfiguration> entityClass, java.lang.String description)
Instantiates a new default javamail configuration DAO.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEnd2endMailConfig(End2endMailConfig end2endConfig)
Adds the end2end mail configuration.void
addReadMailConfig(ReadmailConfig readmailConfig)
Adds the read mail configuration.void
addSendMailConfig(SendmailConfig sendmailConfig)
Adds the send mail configuration.ReadmailConfig
getDefaultReadmailConfig()
Gets the default readmail configuration.SendmailConfig
getDefaultSendmailConfig()
Gets the default sendmail configuration.End2endMailConfig
getEnd2endConfig(java.lang.String name)
Gets the end2end mail configuration.java.util.List<End2endMailConfig>
getEnd2EndConfigs()
Gets the end2end mail configurations.ReadmailConfig
getReadMailConfig(java.lang.String name)
Gets the read mail configuration.java.util.List<ReadmailConfig>
getReadmailConfigs()
Gets the readmail configurations.SendmailConfig
getSendMailConfig(java.lang.String name)
Gets the send mail configuration.java.util.List<SendmailConfig>
getSendmailConfigs()
Gets the sendmail configurations.void
reloadConfiguration()
Reloads the configuration.boolean
removeEnd2endConfig(java.lang.String end2endConfig)
Removes the end2 end configuration.boolean
removeReadMailConfig(java.lang.String readmailConfig)
Removes the readmail configuration.boolean
removeSendMailConfig(java.lang.String sendmailConfig)
Removes the sendmail configuration.void
saveConfiguration()
Saves the current configuration on disk.void
setDefaultReadmailConfig(java.lang.String readmailConfigName)
Sets the default readmail configuration.void
setDefaultSendmailConfig(java.lang.String sendmailConfigName)
Sets the default sendmail configuration.JavamailConfiguration
translateConfig(JavamailConfiguration config)
translateConfigvoid
verifyMarshaledConfiguration()
Verifies marshaled configuration.-
Methods inherited from class org.opennms.core.xml.AbstractJaxbConfigDao
addOnReloadedCallback, afterPropertiesSet, getConfigResource, getContainer, getDescription, getReloadCheckInterval, loadConfig, setConfigResource, setReloadCheckInterval
-
-
-
-
Constructor Detail
-
DefaultJavamailConfigurationDao
public DefaultJavamailConfigurationDao()
Instantiates a new default javamail configuration DAO.
-
DefaultJavamailConfigurationDao
public DefaultJavamailConfigurationDao(java.lang.Class<JavamailConfiguration> entityClass, java.lang.String description)
Instantiates a new default javamail configuration DAO.- Parameters:
entityClass
- the entity classdescription
- the description
-
-
Method Detail
-
translateConfig
public JavamailConfiguration translateConfig(JavamailConfiguration config)
Description copied from class:AbstractJaxbConfigDao
translateConfig
- Specified by:
translateConfig
in classAbstractJaxbConfigDao<JavamailConfiguration,JavamailConfiguration>
- Parameters:
config
- a K object.- Returns:
- a V object.
-
getDefaultReadmailConfig
public ReadmailConfig getDefaultReadmailConfig()
Description copied from interface:JavaMailConfigurationDao
Gets the default readmail configuration.- Specified by:
getDefaultReadmailConfig
in interfaceJavaMailConfigurationDao
- Returns:
- the default readmail configuration
-
setDefaultReadmailConfig
public void setDefaultReadmailConfig(java.lang.String readmailConfigName)
Description copied from interface:JavaMailConfigurationDao
Sets the default readmail configuration.- Specified by:
setDefaultReadmailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
readmailConfigName
- the new default readmail configuration
-
getReadMailConfig
public ReadmailConfig getReadMailConfig(java.lang.String name)
Description copied from interface:JavaMailConfigurationDao
Gets the read mail configuration.- Specified by:
getReadMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
name
- the readmail configuration name- Returns:
- the read mail configuration
-
getReadmailConfigs
public java.util.List<ReadmailConfig> getReadmailConfigs()
Description copied from interface:JavaMailConfigurationDao
Gets the readmail configurations.- Specified by:
getReadmailConfigs
in interfaceJavaMailConfigurationDao
- Returns:
- the readmail configurations
-
getDefaultSendmailConfig
public SendmailConfig getDefaultSendmailConfig()
Description copied from interface:JavaMailConfigurationDao
Gets the default sendmail configuration.- Specified by:
getDefaultSendmailConfig
in interfaceJavaMailConfigurationDao
- Returns:
- the default sendmail configuration
-
setDefaultSendmailConfig
public void setDefaultSendmailConfig(java.lang.String sendmailConfigName)
Description copied from interface:JavaMailConfigurationDao
Sets the default sendmail configuration.- Specified by:
setDefaultSendmailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
sendmailConfigName
- the new default sendmail configuration
-
getSendMailConfig
public SendmailConfig getSendMailConfig(java.lang.String name)
Description copied from interface:JavaMailConfigurationDao
Gets the send mail configuration.- Specified by:
getSendMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
name
- the sendmail configuration name- Returns:
- the send mail configuration
-
addSendMailConfig
public void addSendMailConfig(SendmailConfig sendmailConfig)
Description copied from interface:JavaMailConfigurationDao
Adds the send mail configuration.If there is a sendmail-config object with the same name, it will be replaced; otherwise, the new object will be added.
- Specified by:
addSendMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
sendmailConfig
- the sendmail configuration
-
removeSendMailConfig
public boolean removeSendMailConfig(java.lang.String sendmailConfig)
Description copied from interface:JavaMailConfigurationDao
Removes the sendmail configuration.- Specified by:
removeSendMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
sendmailConfig
- the sendmail configuration name- Returns:
- true, if successful
-
getSendmailConfigs
public java.util.List<SendmailConfig> getSendmailConfigs()
Description copied from interface:JavaMailConfigurationDao
Gets the sendmail configurations.- Specified by:
getSendmailConfigs
in interfaceJavaMailConfigurationDao
- Returns:
- the sendmail configurations
-
getEnd2endConfig
public End2endMailConfig getEnd2endConfig(java.lang.String name)
Description copied from interface:JavaMailConfigurationDao
Gets the end2end mail configuration.- Specified by:
getEnd2endConfig
in interfaceJavaMailConfigurationDao
- Parameters:
name
- the end2end configuration name- Returns:
- the end2end configuration
-
addReadMailConfig
public void addReadMailConfig(ReadmailConfig readmailConfig)
Description copied from interface:JavaMailConfigurationDao
Adds the read mail configuration.If there is a readmail-config object with the same name, it will be replaced; otherwise, the new object will be added.
- Specified by:
addReadMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
readmailConfig
- the readmail configuration
-
removeReadMailConfig
public boolean removeReadMailConfig(java.lang.String readmailConfig)
Description copied from interface:JavaMailConfigurationDao
Removes the readmail configuration.- Specified by:
removeReadMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
readmailConfig
- the readmail configuration name- Returns:
- true, if successful
-
getEnd2EndConfigs
public java.util.List<End2endMailConfig> getEnd2EndConfigs()
Description copied from interface:JavaMailConfigurationDao
Gets the end2end mail configurations.- Specified by:
getEnd2EndConfigs
in interfaceJavaMailConfigurationDao
- Returns:
- the end2end mail configurations
-
addEnd2endMailConfig
public void addEnd2endMailConfig(End2endMailConfig end2endConfig)
Description copied from interface:JavaMailConfigurationDao
Adds the end2end mail configuration.If there is a end2end-mail-config object with the same name, it will be replaced; otherwise, the new object will be added.
- Specified by:
addEnd2endMailConfig
in interfaceJavaMailConfigurationDao
- Parameters:
end2endConfig
- the end2end configuration
-
removeEnd2endConfig
public boolean removeEnd2endConfig(java.lang.String end2endConfig)
Description copied from interface:JavaMailConfigurationDao
Removes the end2 end configuration.- Specified by:
removeEnd2endConfig
in interfaceJavaMailConfigurationDao
- Parameters:
end2endConfig
- the end2end configuration name- Returns:
- true, if successful
-
verifyMarshaledConfiguration
public void verifyMarshaledConfiguration() throws java.lang.IllegalStateException
Description copied from interface:JavaMailConfigurationDao
Verifies marshaled configuration.- Specified by:
verifyMarshaledConfiguration
in interfaceJavaMailConfigurationDao
- Throws:
java.lang.IllegalStateException
- the illegal state exception
-
reloadConfiguration
public void reloadConfiguration() throws org.springframework.dao.DataAccessResourceFailureException
Description copied from interface:JavaMailConfigurationDao
Reloads the configuration.- Specified by:
reloadConfiguration
in interfaceJavaMailConfigurationDao
- Throws:
org.springframework.dao.DataAccessResourceFailureException
- the data access resource failure exception
-
saveConfiguration
public void saveConfiguration()
Description copied from interface:JavaMailConfigurationDao
Saves the current configuration on disk.- Specified by:
saveConfiguration
in interfaceJavaMailConfigurationDao
-
-