com.sap.engine.interfaces.messaging.api

Interface MessageFactory


public interface MessageFactory

The MessageFactory interface follows the typical factory design pattern and allows applications to create empty message containers. Applications can then populate the message using the accessor methods of the Message object.
It is important to note that the Message will be constructed with the following key fields: FromParty, ToParty, FromService, ToService, and Action. These keys will be used to look up important configurable information from the registry that is required to transmit the message. The intent is that the application will know the logical sender, sender system, receiver, receiver system, and what they are trying to accomplish, but not necessarily protocol specific or transmission specific details (e.g. should it be sent via JMS or HTTP).

Version:
$Id: //tc/xpi.ms/NW711_03_COR/src/_interface/pifce/api/com/sap/engine/interfaces/messaging/api/MessageFactory.java#1 $

Method Summary
 Message createMessage(Party fromParty, Party toParty, Service fromService, Service toService, Action action)
          The MessageFactory implementation will validate the parameters, do a registry lookup based on the parameters, and create an empty messsage containing all the information available from the registry.
 Message createMessage(Party fromParty, Party toParty, Service fromService, Service toService, Action action, String messageId)
          The MessageFactory implementation will validate the parameters, do a registry lookup based on the parameters, and create an empty messsage containing all the information available from the registry.
 

Method Detail

createMessage

Message createMessage(Party fromParty,
                      Party toParty,
                      Service fromService,
                      Service toService,
                      Action action)
                      throws MessagingException
The MessageFactory implementation will validate the parameters, do a registry lookup based on the parameters, and create an empty messsage containing all the information available from the registry. If any of the parameters is null, an InvalidParamException will be thrown.

Parameters:
fromParty - the originating party
toParty - the destination party
fromService - the originating service
toService - the destination service
action - the action of the targeting process
Returns:
Message an empty message with only party, service, action and the message id header fields set.
Throws:
MessagingException - if the message couldn't be created.

createMessage

Message createMessage(Party fromParty,
                      Party toParty,
                      Service fromService,
                      Service toService,
                      Action action,
                      String messageId)
                      throws MessagingException
The MessageFactory implementation will validate the parameters, do a registry lookup based on the parameters, and create an empty messsage containing all the information available from the registry. If any of the parameters is null, an InvalidParamException will be thrown.

Parameters:
fromParty - the originating party
toParty - the destination party
fromService - the originating service
toService - the destination service
action - the action of the targeting process
messageId - the Message ID.
Returns:
Message an empty message with only party, service, action and the message id header fields set.
Throws:
MessagingException - if the message couldn't be created.


Copyright 2009 SAP AG Complete Copyright Notice