org.ow2.petals.bc.mail
Class MailUtil

java.lang.Object
  extended by org.ow2.petals.bc.mail.MailUtil

public class MailUtil
extends java.lang.Object

Author:
”Mathieu CARROLLE - mathieu.carrolle@petalslink.com”

Constructor Summary
MailUtil()
           
 
Method Summary
static ProvideDescriptor build(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
          Extract mail session properties from the service unit for Provide node
static ConsumeDescriptor buildConsumeDescriptor(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
          Extract mail session properties from the service unit for Consume node
static ProvideDescriptor buildFromPayload(org.w3c.dom.Node node)
          Build a descriptor by extracting all information from the associated JBI message payload.
static ProvideDescriptor buildFromProperties(org.ow2.petals.component.framework.api.message.Exchange exchange, org.w3c.dom.Node node)
          Retrieve mail session properties from Normalized message properties.
protected static void checkProperties(ConsumeDescriptor consumeDescriptor)
          Check the properties extracted from the address URI.
protected static void checkProperties(ProvideDescriptor provideDescriptor)
          Check the properties extracted from the address URI.
static boolean checkWsaProperties(org.ow2.petals.component.framework.api.message.Exchange exchange)
          Check if the ws addressing properties are present
static java.lang.String extractMailBodyFromPayload(org.w3c.dom.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailUtil

public MailUtil()
Method Detail

build

public static ProvideDescriptor build(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
                               throws javax.jbi.messaging.MessagingException,
                                      MissingElementException
Extract mail session properties from the service unit for Provide node

Parameters:
extensions - extensions associated to the given message exchange
Returns:
ProvideDescriptor
Throws:
javax.jbi.messaging.MessagingException
MissingElementException

buildConsumeDescriptor

public static ConsumeDescriptor buildConsumeDescriptor(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
                                                throws javax.jbi.messaging.MessagingException,
                                                       MissingElementException
Extract mail session properties from the service unit for Consume node

Parameters:
extensions - extensions associated to the given message exchange
Returns:
ConsumeDescriptor
Throws:
javax.jbi.messaging.MessagingException
MissingElementException

buildFromPayload

public static ProvideDescriptor buildFromPayload(org.w3c.dom.Node node)
                                          throws MissingElementException,
                                                 javax.jbi.messaging.MessagingException
Build a descriptor by extracting all information from the associated JBI message payload.

NOTE:
Used when the component supplies its own service

Parameters:
node - the root node of the messsage payload
Throws:
{@link - MissingElementException}
{@link - MessagingException}
MissingElementException
javax.jbi.messaging.MessagingException

extractMailBodyFromPayload

public static java.lang.String extractMailBodyFromPayload(org.w3c.dom.Node node)
                                                   throws MissingElementException,
                                                          javax.jbi.messaging.MessagingException
Throws:
MissingElementException
javax.jbi.messaging.MessagingException

buildFromProperties

public static ProvideDescriptor buildFromProperties(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                                    org.w3c.dom.Node node)
                                             throws MissingElementException,
                                                    javax.jbi.messaging.MessagingException
Retrieve mail session properties from Normalized message properties.

NOTE:
Used when the component supplies its own service

Parameters:
exchange - the message exchange used to extract properties
node - the root node of the messsage payload to extract mail's body
Returns:
ProvideDescriptor
Throws:
{@link - MissingElementException}
{@link - MessagingException}
MissingElementException
javax.jbi.messaging.MessagingException

checkWsaProperties

public static boolean checkWsaProperties(org.ow2.petals.component.framework.api.message.Exchange exchange)
Check if the ws addressing properties are present

Parameters:
exchange -
Returns:
Throws:
MissingElementException

checkProperties

protected static void checkProperties(ProvideDescriptor provideDescriptor)
                               throws javax.jbi.messaging.MessagingException,
                                      MissingElementException
Check the properties extracted from the address URI. Only hostname is obligatory for all schemes. Only SMTP, POP3 and IMAP schemes are supported. "toAddress" is need for SMTP scheme.

Parameters:
provideDescriptor -
Throws:
MissingElementException
org.ow2.petals.component.framework.api.exception.PEtALSCDKException - if a checking step failed
javax.jbi.messaging.MessagingException

checkProperties

protected static void checkProperties(ConsumeDescriptor consumeDescriptor)
                               throws javax.jbi.messaging.MessagingException,
                                      MissingElementException
Check the properties extracted from the address URI. Only hostname is obligatory for all schemes. Only SMTP, POP3 and IMAP schemes are supported. "toAddress" is need for SMTP scheme.

Parameters:
consumeDescriptor -
Throws:
MissingElementException
javax.jbi.messaging.MessagingException - if a checking step failed


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.