com.sapportals.wcm.util.channels

Interface IChannel

All Known Implementing Classes:
AbstractChannel

public interface IChannel

A channel is the abstraction of an transport mechanism for sending messages to recipients.
A message can be a simple String or an internet MimeMessage . A recipient can be something like an user or a distribution list.

See Also:
ChannelFactory, IRecipient, MimeMessage

Method Summary
 String getDescription()
          Get the channel's displayable name.
 String getDescription(Locale locale)
          Get the channel's displayable name for a specific locale.
 MimeMessage getEmptyMessage()
          Get an empty internet mime message.
 String getID()
          Get the channel's unique system id.
 String getRecipientAddress(IRecipient recipient)
          Get the given recipient's channel address in the channel's specific format.
 String getType()
          Get the channel's type.
 void sendTo(String[] to, String from, MimeMessage mimemessage)
          Send a mime message via this channel to the given addresses.
 void sendTo(String[] to, String from, String title, String messagetext, String type)
          Send a message text via this channel to the given addresses.
 void sendTo(String[] to, String from, String title, String messagetext, String type, String encoding)
          Send a message text via this channel to the given addresses.
 void sendTo(String to, String from, MimeMessage mimemessage)
          Send a mime message via this channel to the given address.
 void sendTo(String to, String from, String title, String messagetext, String type)
          Send a message text via this channel to the given address.
 void sendTo(String to, String from, String title, String messagetext, String type, String encoding)
          Send a message text via this channel to the given address.
 

Method Detail

getType

public String getType()
Get the channel's type.

Returns:
a String with the channel's type, for example EMAIL .
See Also:
ChannelFactory

getID

public String getID()
Get the channel's unique system id.

Returns:
a String with the channel's system id.

getDescription

public String getDescription()
Get the channel's displayable name.

Returns:
a String with the channel's displayable name.

getDescription

public String getDescription(Locale locale)
Get the channel's displayable name for a specific locale.

Parameters:
locale - a Locale defining the language to get the name for.
Returns:
a String with the channel's displayable name in the given locale.

getRecipientAddress

public String getRecipientAddress(IRecipient recipient)
                           throws WcmException
Get the given recipient's channel address in the channel's specific format.

Parameters:
recipient - an IRecipient to get the channel's address for.
Returns:
a String with the address of the given recipient in the channel's specific format; null if the given recipient has no address for this channel.
Throws:
- WcmException if there was an error while resolving the recipient's address for this channel.
WcmException

getEmptyMessage

public MimeMessage getEmptyMessage()
                            throws WcmException
Get an empty internet mime message.

Returns:
an empty MimeMessage (see javax.mail.internet.MimeMessage ).
Throws:
- WcmException if there was an error while creating the mime message.
WcmException

sendTo

public void sendTo(String to,
                   String from,
                   String title,
                   String messagetext,
                   String type)
            throws WcmException
Send a message text via this channel to the given address.

Parameters:
to - a String with the address of the receiver in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
title - a String with the title for the message.
messagetext - a String with the content of the message to send.
type - a String with the mimetype of message, for example text/plain .
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException

sendTo

public void sendTo(String to,
                   String from,
                   String title,
                   String messagetext,
                   String type,
                   String encoding)
            throws WcmException
Send a message text via this channel to the given address.

Parameters:
to - a String with the address of the receiver in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
title - a String with the title for the message.
messagetext - a String with the content of the message to send.
type - a String with the mimetype of message, for example text/plain .
encoding - a String with the encoding for the message
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException

sendTo

public void sendTo(String[] to,
                   String from,
                   String title,
                   String messagetext,
                   String type)
            throws WcmException
Send a message text via this channel to the given addresses.

Parameters:
to - an array of Strings with the addresses of the receivers in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
title - a String with the title for the message.
messagetext - a String with the content of the message to send.
type - a String with the mimetype of message, for example text/plain .
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException

sendTo

public void sendTo(String[] to,
                   String from,
                   String title,
                   String messagetext,
                   String type,
                   String encoding)
            throws WcmException
Send a message text via this channel to the given addresses.

Parameters:
to - an array of Strings with the addresses of the receivers in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
title - a String with the title for the message.
messagetext - a String with the content of the message to send.
type - a String with the mimetype of message, for example text/plain .
encoding - a String with the encoding for this message
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException

sendTo

public void sendTo(String to,
                   String from,
                   MimeMessage mimemessage)
            throws WcmException
Send a mime message via this channel to the given address.

Parameters:
to - a String with the address of the receiver in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
mimemessage - an internet MimeMessage with the content of the message to send (see javax.mail.internet.MimeMessage ).
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException

sendTo

public void sendTo(String[] to,
                   String from,
                   MimeMessage mimemessage)
            throws WcmException
Send a mime message via this channel to the given addresses.

Parameters:
to - an array of String s with the addresses of the receivers in the channel's specific format.
from - a String with the address of the sender in the channel's specific format.
mimemessage - an internet MimeMessage with the content of the message to send (see javax.mail.internet.MimeMessage ).
Throws:
- WcmException if there was an error while sending the message.
PartialSendException - if the message was sent only parially (to some recipients).
WcmException


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.