autohit.call.modules
Class MIMEMessageModule

java.lang.Object
  extended byautohit.call.modules.Module
      extended byautohit.call.modules.MIMEMessageModule

public class MIMEMessageModule
extends Module

MIME message module. It will form MIME messages using javamail functions.

It uses system properties for javax.mail Session.

If an encoding is set, strings will be converted to bytes using the system default encoding and then encoded to the specified type. If the encoding is specified and an object is read from the universe, it will assume it is a byte stream and will encode it according to the specified charset.

start() start a new message, with no multipart
multipart() start a new multipart message
setencoding(enc) set encoding to use for subsiquent operations.
resetencoding() use the default encoding.
from(address, optional{personal}) set FROM address
to(address, optional{personal}) add a TO address. Additional calls add new recipients.
cc(address, optional{personal}) add a CC address. Additional calls add new recipients.
bcc(address, optional{personal}) add a BCC address. Additional calls add new recipients.
subject(string) set the subject line
header(n,v) add a header name/value pair.
addcontent(text) add content text to the non-multipart message
addpart(text,contentid,description) add part from string using default encodings
addpartenc(text, tenc, contentid, cenc, description, denc) add part using specified encodings
addpartuni(uniobj,contentid,description, type) add part from universe object using default encodings
addpartunienc(uniobj, tenc, contentid, cenc, description, denc, type) add part from universe object using specified encodings (uniobject currently ingnored)
save() validate message and freeze send time.
tostring() return the message as a string. It must be a save()'d message.
touni(uniobj) save the message to a universe object. It must be a save()'d message.

Version:
1.0 Version History EPG - Initial - 7Aug03
Author:
Erich P. Gatejen

Field Summary
 
Fields inherited from class autohit.call.modules.Module
myName, visCore, visLogger, visSC, visUniverse
 
Constructor Summary
MIMEMessageModule()
          Constructor
 
Method Summary
 java.lang.Object execute_chain(java.lang.String name)
          Execute a named method.
protected  void free_chain()
          Allow the subclass a chance to cleanup on free.
protected  java.lang.String instantiation_chain()
          Allow the subclass a chance to initialize.
 
Methods inherited from class autohit.call.modules.Module
buildException, buildException, debug, desired, desiredType, error, errorparam, execute, fault, fault, free, getParam, getPersist, instance, isDebugging, log, optional, optionalType, required, requiredType, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIMEMessageModule

public MIMEMessageModule()
Constructor

Method Detail

execute_chain

public java.lang.Object execute_chain(java.lang.String name)
                               throws CallException
Execute a named method. You must implement this method. You can call any of the helpers for data and services. The returned object better be a string (for now).

Specified by:
execute_chain in class Module
Parameters:
name - name of the method
Throws:
CallException
See Also:
NOPair

instantiation_chain

protected java.lang.String instantiation_chain()
                                        throws CallException
Allow the subclass a chance to initialize. At a minium, an implementor should create an empty method.

Specified by:
instantiation_chain in class Module
Returns:
the name
Throws:
CallException

free_chain

protected void free_chain()
                   throws CallException
Allow the subclass a chance to cleanup on free. At a minium, an implementor should create an empty method.

Specified by:
free_chain in class Module
Throws:
CallException


Test.