Package com.esri.gpt.framework.mail

Examples of com.esri.gpt.framework.mail.MailConfiguration


*           indicates a programming error, bad XPath
*/
private void loadMail(ApplicationConfiguration appConfig, Document dom,
    Node root) throws XPathExpressionException {
  XPath xpath = XPathFactory.newInstance().newXPath();
  MailConfiguration mcfg = appConfig.getMailConfiguration();
  mcfg.put(
      xpath.evaluate("mail/@smtpHost", root),
      xpath.evaluate("mail/@smtpPort", root),
      xpath.evaluate("mail/@siteEmailAddress", root),
      xpath.evaluate("mail/@siteEmailAddress", root));
  mcfg.setEmailAddressRegexp(xpath.evaluate("mail/@emailAddressRegexp", root));

  Node ndAuth = (Node) xpath.evaluate("mail/smtpAuth", root, XPathConstants.NODE);
  if (ndAuth != null) {
    String sUser = Val.chkStr(xpath.evaluate("@username", ndAuth));
    String sPwd = xpath.evaluate("@password", ndAuth);
    boolean bEncrypted = Val.chkBool(xpath.evaluate("@encrypted", ndAuth), false);
    if (bEncrypted) {
      try {
        String sDecrypted = PC1_Encryptor.decrypt(sPwd);
        sPwd = sDecrypted;
      } catch (Exception e) {
        this.getLogger().log(Level.SEVERE, "The smptAuth password failed to decrypt.", e);
      }
    }
    if ((sUser != null) && (sUser.length() > 0) && (sPwd != null) && (sPwd.length() > 0)) {
      mcfg.setPasswordAuthentication(new javax.mail.PasswordAuthentication(sUser, sPwd));
    }
  }
}
View Full Code Here


public ApplicationConfiguration() {
  super();
  setDatabaseReferences(new DatabaseReferences());
  setIdentityConfiguration(new IdentityConfiguration());
  setCatalogConfiguration(new CatalogConfiguration());
  setMailConfiguration(new MailConfiguration());
  setThreadSchedulerConfiguration(new ThreadSchedulerConfiguration());
  setDownloadDataConfiguration(new DownloadConfiguration());
  setMetadataAccessPolicy(new MetadataAccessPolicy());
}
View Full Code Here

* @param configuration the mail configuration
*/
private void setMailConfiguration(MailConfiguration configuration) {
  _mailConfiguration = configuration;
  if (_mailConfiguration == null) {
    _mailConfiguration = new MailConfiguration();
  }
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.mail.MailConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.