com.sapportals.wcm.util.channels

Interface IRecipient

All Known Subinterfaces:
IAttachmentRecipient

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 addresses, 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 distribution lists.

See Also:
RecipientFactory, IChannel

Method Summary
 boolean contains(IRecipient recipient)
          Test if a given recipient is a member of a group.
 IChannel getChannel(String id)
          Get the recipient's channel for a given channel id.
 IChannelList getChannels()
          Get all available channels.
 IChannel getDefaultChannel()
          Get the default channel.
 String getDescription()
          Get the recipient's displayable name.
 String getDescription(Locale locale)
          Get the recipient's displayable name for a specific locale.
 IRecipientList getGroupMembers()
          Get all the members of a group or role.
 String getID()
          Get the recipient's unique system id.
 Locale getLocale()
          Get the recipient's locale.
 int getType()
          Get the recipient's type.
 com.sapportals.portal.security.usermanagement.IUMPrincipal getUserManagementObject()
          Deprecated. As of NetWeaver 7.1, replaced by getUserManagementObjectUME()
 IPrincipal getUserManagementObjectUME()
          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, String from, MimeMessage mimemessage)
          Send a mime message via the specified channel.
 void sendTo(IChannel channel, String from, String title, String messagetext, String type)
          Send a message text via the specified channel.
 

Method Detail

getType

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

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

Returns:
a String with the recipient's unique system id.

getDescription

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

Returns:
a String with a displayable name.

getDescription

String getDescription(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

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

com.sapportals.portal.security.usermanagement.IUMPrincipal getUserManagementObject()
                                                                                   throws WcmException
Deprecated. As of NetWeaver 7.1, replaced by getUserManagementObjectUME()

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).

getUserManagementObjectUME

IPrincipal getUserManagementObjectUME()
                                      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).
Since:
NetWeaver 7.1

isGroup

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

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

boolean contains(IRecipient recipient)
                 throws WcmException
Test if a given recipient is a member of a group.

Parameters:
recipient - a IRecipient representing an (addressable) person or a distribution list
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

IChannel getChannel(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

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

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

void sendTo(IChannel channel,
            String from,
            String title,
            String messagetext,
            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 message text to send.
type - a String with the type of message, for example text/plain .
Throws:
WcmException - if the message cannot be sent.

sendTo

void sendTo(IChannel channel,
            String from,
            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 appropriate format for the channel.
mimemessage - a MimeMessage with the mime message to send.
Throws:
WcmException - if the message cannot be sent.
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