com.sapportals.wcm.util.channels

Interface IChannel

All Known Subinterfaces:
IAttachmentChannel
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

String getType()
Get the channel's type.

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

getID

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

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

getDescription

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

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

getDescription

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

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

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

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

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

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

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

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

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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice