SAP NetWeaver '04

com.sapportals.wcm.util.channels
Class ChannelFactory

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.factories.AbstractObjectFactory
        |
        +--com.sapportals.wcm.util.channels.ChannelFactory

public class ChannelFactory
extends AbstractObjectFactory

A factory to retrieve IChannel s.

See Also:
IChannel

Inner classes inherited from class com.sapportals.wcm.util.factories.AbstractObjectFactory
AbstractObjectFactory.ObjectClassEntry
 
Field Summary
static java.lang.String EMAIL
          channel type EMAIL.
static java.lang.String FAX
          channel type FAX.
static java.lang.String NULL_CHANNEL
          channel type NULL.
static java.lang.String SMS
          channel type SMS.
static java.lang.String STORE
          channel type STORE.
 
Fields inherited from class com.sapportals.wcm.util.factories.AbstractObjectFactory
CONFIG_OBJECTLIST_SEPARATOR, CONFIG_OBJECTLIST_TAG, CONFIG_SINGLETON_DEFAULT, CONFIG_SINGLETON_TAG, m_ID, m_LogName, m_ObjectMap, m_Properties, MULTI, SINGLETON
 
Constructor Summary
ChannelFactory(java.lang.String id)
          Create a ChannelFactory with a given id.
Note : This constructor has to be public (although it should be protected), to allow dynamic creation via the AbstractClassFactory() .
 
Method Summary
 IChannelList createChannelList()
          Create an empty IChannelList .
 IChannel getChannel(java.lang.String id)
          Get an IChannel instance for a specific id.
 IChannelList getChannelForType(java.lang.String type)
          Get a list of IChannel s for a given type.
 IChannelList getChannels()
          Get a list with all available IChannel s.
 IChannel getFirstChannelForType(java.lang.String type)
          Get the first instance of an IChannel for a given type.
static ChannelFactory getInstance()
          Get a new instance of the factory.
static java.lang.String[] getRecipientAdresses(IChannel channel, IRecipientList recipients)
          Utility method to convert an array of recipients to an array of addresses in a specific channel format.
protected  AbstractObjectFactory.ObjectClassEntry newObjectListEntry(java.lang.String id, java.lang.reflect.Constructor constructor, java.util.Properties properties, boolean singletonFlag)
          Create a new object class entry for the object class list.
 
Methods inherited from class com.sapportals.wcm.util.factories.AbstractObjectFactory
getAllObjectInstances, getFactoryInstance, getObjectConstructorParameters, getObjectConstructorParameterTypes, getObjectInstance, loadObjectMap, loadObjectMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL

public static final java.lang.String EMAIL
channel type EMAIL.

SMS

public static final java.lang.String SMS
channel type SMS.

FAX

public static final java.lang.String FAX
channel type FAX.

STORE

public static final java.lang.String STORE
channel type STORE.

NULL_CHANNEL

public static final java.lang.String NULL_CHANNEL
channel type NULL. Messages send to this channel are not send at all.
Constructor Detail

ChannelFactory

public ChannelFactory(java.lang.String id)
               throws WcmException
Create a ChannelFactory with a given id.
Note : This constructor has to be public (although it should be protected), to allow dynamic creation via the AbstractClassFactory() .
Parameters:
id - a String with the unique id for the factory.
Throws:
WcmException - Exception raised in failure situation
Method Detail

getInstance

public static ChannelFactory getInstance()
                                  throws WcmException
Get a new instance of the factory.
Returns:
a new instance of the ChannelFactory .
Throws:
WcmException - if the factory can not be created.

newObjectListEntry

protected AbstractObjectFactory.ObjectClassEntry newObjectListEntry(java.lang.String id,
                                                                    java.lang.reflect.Constructor constructor,
                                                                    java.util.Properties properties,
                                                                    boolean singletonFlag)
Description copied from class: AbstractObjectFactory
Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. Create a new object class entry for the object class list. create a new object class entry.
Overrides:
newObjectListEntry in class AbstractObjectFactory
Following copied from class: com.sapportals.wcm.util.factories.AbstractObjectFactory
Parameters:
id - a String with the id of the object class.
constructor - the Constructor for the object class.
properties - the Properties for the object class.
singletonFlag - a boolean true if this object class should have only one instance, false if not.
Returns:
TDB: Description of the outgoing return value

getChannel

public IChannel getChannel(java.lang.String id)
                    throws WcmException
Get an IChannel instance for a specific id.
Parameters:
id - TBD: Description of the incoming method parameter
Returns:
an IChannel with the channel for the given id, null if no channel exists for the given id.
Throws:
WcmException - if there an error occured while creating the channel.

getChannelForType

public IChannelList getChannelForType(java.lang.String type)
                               throws WcmException
Get a list of IChannel s for a given type.
Parameters:
type - TBD: Description of the incoming method parameter
Returns:
a IChannelList with channels for the given type, may be empty if no channels exists for that type.
Throws:
WcmException - if there an error occured while creating the channels.

getFirstChannelForType

public IChannel getFirstChannelForType(java.lang.String type)
                                throws WcmException
Get the first instance of an IChannel for a given type.
Parameters:
type - TBD: Description of the incoming method parameter
Returns:
an IChannel for the given type, null if there is no channel with the given type.
Throws:
WcmException - if an error occured while creating the channel.

getChannels

public IChannelList getChannels()
                         throws WcmException
Get a list with all available IChannel s.
Returns:
an IChannelList which may be empty if no channels exist.
Throws:
WcmException - if there an error occured while creating the channel.

getRecipientAdresses

public static java.lang.String[] getRecipientAdresses(IChannel channel,
                                                      IRecipientList recipients)
                                               throws WcmException
Utility method to convert an array of recipients to an array of addresses in a specific channel format.
Parameters:
channel - an IChannel which defines the address format.
recipients - an array of IRecipient s to get the addresses for.
Returns:
an array of Strings with the addresses.
Throws:
WcmException - if an error occured while resolving the recipients addresses.

createChannelList

public IChannelList createChannelList()
                               throws WcmException
Create an empty IChannelList .
Returns:
an empty IChannelList .
Throws:
WcmException - if the list could not be created.

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.