scriptella.driver.mail
Class MailConnection

java.lang.Object
  extended by scriptella.spi.AbstractConnection
      extended by scriptella.driver.mail.MailConnection
All Implemented Interfaces:
scriptella.spi.Connection

public class MailConnection
extends scriptella.spi.AbstractConnection

Represents a JavaMail connection.

For configuration details and examples see overview page.

TODO:

Version:
1.0
Author:
Fyodor Kupolov

Nested Class Summary
 
Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection
scriptella.spi.AbstractConnection.StatementCounter
 
Field Summary
static java.lang.String SUBJECT
          Name of the subject connection property.
static java.lang.String TYPE
          Name of the type connection property.
static java.lang.String TYPE_HTML
           
static java.lang.String TYPE_TEXT
           
 
Fields inherited from class scriptella.spi.AbstractConnection
counter
 
Constructor Summary
MailConnection(scriptella.spi.ConnectionParameters parameters)
          Creates an email connection.
 
Method Summary
 void close()
           
 void executeQuery(scriptella.spi.Resource queryContent, scriptella.spi.ParametersCallback parametersCallback, scriptella.spi.QueryCallback queryCallback)
           
 void executeScript(scriptella.spi.Resource scriptContent, scriptella.spi.ParametersCallback parametersCallback)
           
protected  javax.mail.internet.MimeMessage format(java.io.Reader reader, scriptella.expression.PropertiesSubstitutor ps)
           
protected  void send(javax.mail.internet.MimeMessage message)
          Template method to decouple transport dependency, overriden in test classes.
 
Methods inherited from class scriptella.spi.AbstractConnection
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
Name of the type connection property. Specifies type of E-Mail message content: TYPE_TEXT, TYPE_HTML.

See Also:
Constant Field Values

SUBJECT

public static final java.lang.String SUBJECT
Name of the subject connection property. Specifies e-mail subject.

See Also:
Constant Field Values

TYPE_TEXT

public static final java.lang.String TYPE_TEXT
See Also:
Constant Field Values

TYPE_HTML

public static final java.lang.String TYPE_HTML
See Also:
Constant Field Values
Constructor Detail

MailConnection

public MailConnection(scriptella.spi.ConnectionParameters parameters)
Creates an email connection.

Parameters:
parameters - connection parameters.
Method Detail

executeScript

public void executeScript(scriptella.spi.Resource scriptContent,
                          scriptella.spi.ParametersCallback parametersCallback)
                   throws scriptella.spi.ProviderException
Throws:
scriptella.spi.ProviderException

format

protected javax.mail.internet.MimeMessage format(java.io.Reader reader,
                                                 scriptella.expression.PropertiesSubstitutor ps)
                                          throws javax.mail.MessagingException,
                                                 java.io.IOException
Throws:
javax.mail.MessagingException
java.io.IOException

send

protected void send(javax.mail.internet.MimeMessage message)
             throws javax.mail.MessagingException
Template method to decouple transport dependency, overriden in test classes.

Parameters:
message - message to send.
Throws:
javax.mail.MessagingException

executeQuery

public void executeQuery(scriptella.spi.Resource queryContent,
                         scriptella.spi.ParametersCallback parametersCallback,
                         scriptella.spi.QueryCallback queryCallback)
                  throws scriptella.spi.ProviderException
Throws:
scriptella.spi.ProviderException

close

public void close()
           throws scriptella.spi.ProviderException
Throws:
scriptella.spi.ProviderException


Copyright © Copyright 2006-2009 The Scriptella Project Team.