SAP NetWeaver '04

com.sapportals.wcm.util.channels
Class AbstractChannel

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.channels.AbstractChannel
All Implemented Interfaces:
IChannel

public abstract class AbstractChannel
extends java.lang.Object
implements IChannel

Base class for IChannel -implementations.
The AbstractChannel implements some generic behavior for loading configuration data and retrieving a standard channel description from the channel's type.

See Also:
IChannel

Field Summary
protected static com.sap.tc.logging.Location _log
          log.
protected static ResourceBundles _res
          resource bundles.
static java.lang.String ENCODING
          encoding to use as default for messages.
protected  java.lang.String m_ID
          The system id for this channel.
protected  java.util.Properties m_Properties
          The properties for this channel.
 
Constructor Summary
protected AbstractChannel(java.lang.String id, java.util.Properties properties)
          Create a channel with a specific id from the given properties.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks if this channel is equal to a given channel.
 java.lang.String getDescription()
          Get the displayable name.
 java.lang.String getDescription(java.util.Locale locale)
          Get the displayable name for the given locale.
 javax.mail.internet.MimeMessage getEmptyMessage()
          Get an empty mime message for this channel.
 java.lang.String getID()
          Get the system id for this channel.
abstract  java.lang.String getRecipientAddress(IRecipient recipient)
          Get the address for the specified recipient.
abstract  java.lang.String getType()
          Get the type for this channel.
 void sendTo(java.lang.String[] addresses, java.lang.String from, javax.mail.internet.MimeMessage mimemessage)
          Send a mime message via this channel.
 void sendTo(java.lang.String[] addresses, java.lang.String from, java.lang.String title, java.lang.String messagetext, java.lang.String type)
          Send a message via this channel to the given addresses.
 void sendTo(java.lang.String[] addresses, java.lang.String from, java.lang.String title, java.lang.String messagetext, java.lang.String type, java.lang.String encoding)
          Send a message via this channel to the given addresses.
abstract  void sendTo(java.lang.String address, java.lang.String from, javax.mail.internet.MimeMessage mimemessage)
          Send a mime message via this channel to the given recipient.
abstract  void sendTo(java.lang.String address, java.lang.String from, java.lang.String title, java.lang.String messagetext, java.lang.String type)
          Send a message via this channel to the given address.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sapportals.wcm.util.channels.IChannel
sendTo
 

Field Detail

ENCODING

public static final java.lang.String ENCODING
encoding to use as default for messages. The default value given can be overridden by the caller

_log

protected static com.sap.tc.logging.Location _log
log.

_res

protected static ResourceBundles _res
resource bundles.

m_ID

protected java.lang.String m_ID
The system id for this channel.

m_Properties

protected java.util.Properties m_Properties
The properties for this channel.
Constructor Detail

AbstractChannel

protected AbstractChannel(java.lang.String id,
                          java.util.Properties properties)
                   throws WcmException
Create a channel with a specific id from the given properties.
Parameters:
id - TBD: Description of the incoming method parameter
properties - TBD: Description of the incoming method parameter
Throws:
WcmException - if the channel could not be created.
Method Detail

getType

public abstract java.lang.String getType()
Get the type for this channel.
Specified by:
getType in interface IChannel
Returns:
String is the channel's type (see ChannelFactory).

equals

public boolean equals(java.lang.Object object)
Checks if this channel is equal to a given channel.
Overrides:
equals in class java.lang.Object
Parameters:
object - TBD: Description of the incoming method parameter
Returns:
true if both channels are equal; false if not.

getID

public java.lang.String getID()
Get the system id for this channel.
Specified by:
getID in interface IChannel
Returns:
String is the channel's id.

getDescription

public java.lang.String getDescription()
Get the displayable name.
Specified by:
getDescription in interface IChannel
Returns:
String is the channel's name.

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Get the displayable name for the given locale.
Specified by:
getDescription in interface IChannel
Parameters:
locale - TBD: Description of the incoming method parameter
Returns:
String is the channel's name for the given locale.

getRecipientAddress

public abstract java.lang.String getRecipientAddress(IRecipient recipient)
                                              throws WcmException
Get the address for the specified recipient.
Specified by:
getRecipientAddress in interface IChannel
Parameters:
recipient - TBD: Description of the incoming method parameter
Returns:
String is the address of the given recipient for this channel.
Throws:
WcmException - if the recipient's address for this channel can't be resolved.

getEmptyMessage

public javax.mail.internet.MimeMessage getEmptyMessage()
                                                throws WcmException
Get an empty mime message for this channel.
Specified by:
getEmptyMessage in interface IChannel
Returns:
an empty MimeMessage for this channel.
Throws:
WcmException - if there was an error while creating the mime message.

sendTo

public abstract void sendTo(java.lang.String address,
                            java.lang.String from,
                            java.lang.String title,
                            java.lang.String messagetext,
                            java.lang.String type)
                     throws WcmException
Send a message via this channel to the given address.
Specified by:
sendTo in interface IChannel
Parameters:
address - TBD: Description of the incoming method parameter
from - TBD: Description of the incoming method parameter
title - TBD: Description of the incoming method parameter
messagetext - TBD: Description of the incoming method parameter
type - TBD: Description of the incoming method parameter
Throws:
WcmException - Exception raised in failure situation

sendTo

public void sendTo(java.lang.String[] addresses,
                   java.lang.String from,
                   java.lang.String title,
                   java.lang.String messagetext,
                   java.lang.String type)
            throws WcmException
Send a message via this channel to the given addresses.
Specified by:
sendTo in interface IChannel
Parameters:
addresses - TBD: Description of the incoming method parameter
from - TBD: Description of the incoming method parameter
title - TBD: Description of the incoming method parameter
messagetext - TBD: Description of the incoming method parameter
type - TBD: Description of the incoming method parameter
Throws:
WcmException - Exception raised in failure situation

sendTo

public void sendTo(java.lang.String[] addresses,
                   java.lang.String from,
                   java.lang.String title,
                   java.lang.String messagetext,
                   java.lang.String type,
                   java.lang.String encoding)
            throws WcmException
Send a message via this channel to the given addresses.
Specified by:
sendTo in interface IChannel
Parameters:
addresses - TBD: Description of the incoming method parameter
from - TBD: Description of the incoming method parameter
title - TBD: Description of the incoming method parameter
messagetext - TBD: Description of the incoming method parameter
type - TBD: Description of the incoming method parameter
encoding - TBD: Description of the incoming method parameter
Throws:
WcmException - Exception raised in failure situation

sendTo

public abstract void sendTo(java.lang.String address,
                            java.lang.String from,
                            javax.mail.internet.MimeMessage mimemessage)
                     throws WcmException
Send a mime message via this channel to the given recipient.
Specified by:
sendTo in interface IChannel
Parameters:
address - TBD: Description of the incoming method parameter
from - TBD: Description of the incoming method parameter
mimemessage - TBD: Description of the incoming method parameter
Throws:
WcmException - Exception raised in failure situation

sendTo

public void sendTo(java.lang.String[] addresses,
                   java.lang.String from,
                   javax.mail.internet.MimeMessage mimemessage)
            throws WcmException
Send a mime message via this channel.
Specified by:
sendTo in interface IChannel
Parameters:
addresses - TBD: Description of the incoming method parameter
from - TBD: Description of the incoming method parameter
mimemessage - TBD: Description of the incoming method parameter
Throws:
WcmException - Exception raised in failure situation

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.