SAP NetWeaver '04

com.sapportals.wcm.util.channels
Interface IRecipient

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
public interface IRecipient

Recipients are objects, where messages can be sent to via a channel.
A recipient represents an (addressable) person or a distribution list. A recipient has adresses, one for each of the several channels it can receive messages from. For example, recipient A has an email address for the email channel and a mobile phone number for the sms-channel.
For the moment, a recipient is a simple mapping of users, groups and roles to recipients and distrubtion lists.

See Also:
RecipientFactory, IChannel

Method Summary
 boolean contains(IRecipient recipient)
          Test if a given recipient is a member of a group.
 IChannel getChannel(java.lang.String id)
          Get the recipient's channel for a given channel id.
 IChannelList getChannels()
          Get all available channels.
 IChannel getDefaultChannel()
          Get the default channel.
 java.lang.String getDescription()
          Get the recipient's displayable name.
 java.lang.String getDescription(java.util.Locale locale)
          Get the recipient's displayable name for a specific locale.
 IRecipientList getGroupMembers()
          Get all the members of a group or role.
 java.lang.String getID()
          Get the recipient's unique system id.
 java.util.Locale getLocale()
          Get the recipient's locale.
 int getType()
          Get the recipient's type.
 com.sapportals.portal.security.usermanagement.IUMPrincipal getUserManagementObject()
          Get the associated user object (IUser , IGroup or IRole ).
 boolean isGroup()
          Test if the recipient is a group and contains other recipients.
 void sendTo(IChannel channel, java.lang.String from, javax.mail.internet.MimeMessage mimemessage)
          Send a mime message via the specified channel.
 void sendTo(IChannel channel, java.lang.String from, java.lang.String title, java.lang.String messagetext, java.lang.String type)
          Send a message text via the specified channel.
 

Method Detail

getType

public int getType()
Get the recipient's type.
Returns:
a int with the recipient's type (for example IUMPrincipal.IUSER ).
See Also:
RecipientFactory.getRecipient(String, int)

getID

public java.lang.String getID()
Get the recipient's unique system id.
Returns:
a String with the recipient's unique system id.

getDescription

public java.lang.String getDescription()
Get the recipient's displayable name.
Returns:
a String with a displayable name.

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Get the recipient's displayable name for a specific locale.
Parameters:
locale - a Locale defining the language to get the name for.
Returns:
a String with a displayable name for the given locale.

getLocale

public java.util.Locale getLocale()
                           throws WcmException
Get the recipient's locale.
Returns:
a Locale with the recipient's locale.
Throws:
WcmException - if the locale data cannot be retrieved.

getUserManagementObject

public com.sapportals.portal.security.usermanagement.IUMPrincipal getUserManagementObject()
                                                                                   throws WcmException
Get the associated user object (IUser , IGroup or IRole ).
Returns:
an IUMPrincipal as the user-/group-/role-object associated to this recipient, or null if this recipient has no user/group/role associated.
Throws:
WcmException - if the operation failed (if there was an error while obtaining the recipient's userobject).

isGroup

public boolean isGroup()
                throws WcmException
Test if the recipient is a group and contains other recipients.
Returns:
a boolean true , if the recipient is a distribution list (user group or user role), false if it's a single person (user).
Throws:
WcmException - if the type for this recipient can not be resolved.

getGroupMembers

public IRecipientList getGroupMembers()
                               throws WcmException
Get all the members of a group or role.
Returns:
a IRecipientList with the members for this group, null if this recipient is not a group or role.
Throws:
WcmException - if the members can not be retrieved.

contains

public boolean contains(IRecipient recipient)
                 throws WcmException
Test if a given recipient is a member of a group.
Parameters:
recipient - TBD: Description of the incoming method parameter
Returns:
a boolean true if the given recipient is a member of this group or role, false if this recipient is not a group, the given recipient is a role or the given recipient is not a member of this group or role.
Throws:
WcmException - if the members can not be checked.

getChannel

public IChannel getChannel(java.lang.String id)
                    throws WcmException
Get the recipient's channel for a given channel id.
Parameters:
id - a String with the desired channel's system id.
Returns:
an IChannel for the recipient with the given id, null if the channel is not available for this recipient.
Throws:
WcmException - if the operation failed (if there was an error while resolving the recipients address).

getChannels

public IChannelList getChannels()
                         throws WcmException
Get all available channels.
Returns:
a IChannelList with all available channels (may be empty) for this recipient.
Throws:
WcmException - if the list cannot be retrieved.

getDefaultChannel

public IChannel getDefaultChannel()
                           throws WcmException
Get the default channel.
Returns:
an IChannel with the default channel, null if there is no default channel defined for this recipient.
Throws:
WcmException - if the operation failed (an error occured while obtaining the recipients data).

sendTo

public void sendTo(IChannel channel,
                   java.lang.String from,
                   java.lang.String title,
                   java.lang.String messagetext,
                   java.lang.String type)
            throws WcmException
Send a message text via the specified channel.
Parameters:
channel - an IChannel with the channel to use.
from - a String with the sender's address in the proper format for the channel.
title - a String with the title for the message.
messagetext - a String with the messagetext to send.
type - a String with the type of message, for example text/plain .
Throws:
WcmException - if the message cannot be sent.

sendTo

public void sendTo(IChannel channel,
                   java.lang.String from,
                   javax.mail.internet.MimeMessage mimemessage)
            throws WcmException
Send a mime message via the specified channel.
Parameters:
channel - an IChannel with the channel to use.
from - a String with the sender's address in the appropiate format for the channel.
mimemessage - a MimeMessage with the mimemessage to send.
Throws:
WcmException - if the message cannot be sent.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
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.