com.mulesoft.adapter.ra
Class XIMessageFactoryImpl

java.lang.Object
  extended by com.mulesoft.adapter.ra.XIMessageFactoryImpl
All Implemented Interfaces:
com.sap.aii.af.lib.ra.cci.XIRecordFactory, javax.resource.cci.RecordFactory

public class XIMessageFactoryImpl
extends Object
implements com.sap.aii.af.lib.ra.cci.XIRecordFactory

The XiMessageFactory allows to create an XI AF message via the XI AF message factory. It uses the XI Messaging Service API to instantiate XI message objects directly. Additionally it offers a wrapper to create XI acks. Secondly it serves as RecordFactory implemenation.


Constructor Summary
XIMessageFactoryImpl(String adapterType, String adapterNamespace)
          Creates a XI AF compliant message factory.
 
Method Summary
 void ackNotSupported(com.sap.engine.interfaces.messaging.api.MessageKey messageKey, com.sap.engine.interfaces.messaging.api.AckType[] acksNotSupported)
          Publish if acks are not supported (XI specific)
 void applicationAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck)
          Send an application ACK (XI specific)
 void applicationErrorAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck, Exception error)
          Send an application error ACK (XI specific)
 javax.resource.cci.IndexedRecord createIndexedRecord(String arg0)
          According to the RecordFactory interface a method to create index records must be provided.
 javax.resource.cci.MappedRecord createMappedRecord(String arg0)
          According to the RecordFactory interface a method to create map records must be provided.
 com.sap.engine.interfaces.messaging.api.Message createMessageRecord(com.sap.engine.interfaces.messaging.api.Party fromParty, com.sap.engine.interfaces.messaging.api.Party toParty, com.sap.engine.interfaces.messaging.api.Service fromService, com.sap.engine.interfaces.messaging.api.Service toService, com.sap.engine.interfaces.messaging.api.Action action)
          Creates a new message record.
 com.sap.engine.interfaces.messaging.api.Message createMessageRecord(com.sap.engine.interfaces.messaging.api.Party fromParty, com.sap.engine.interfaces.messaging.api.Party toParty, com.sap.engine.interfaces.messaging.api.Service fromService, com.sap.engine.interfaces.messaging.api.Service toService, com.sap.engine.interfaces.messaging.api.Action action, String messageId)
          Creates a new message record.
 com.sap.engine.interfaces.messaging.api.Message createMessageRecord(String fromParty, String toParty, String fromService, String toService, String action, String actionNS)
          Creates a new message record.
 com.sap.engine.interfaces.messaging.api.Message createMessageRecord(String fromParty, String toParty, String fromService, String toService, String action, String actionNS, String messageId)
          Creates a new message record.
 com.sap.aii.af.lib.ra.cci.XIMessageRecord createXIMessageRecord()
          Create a empty message record to be used by the application for the outbound case.
 void deliveryAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck)
          Send an delivery ACK (XI specific)
 void deliveryErrorAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck, Exception error)
          Send an delivery error ACK (XI specific)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XIMessageFactoryImpl

public XIMessageFactoryImpl(String adapterType,
                            String adapterNamespace)
                     throws javax.resource.ResourceException
Creates a XI AF compliant message factory. Internally it uses the XI AF Messaging Service message factory to instantiate the messages objects directly.

Throws:
javax.resource.ResourceException
Method Detail

createMessageRecord

public com.sap.engine.interfaces.messaging.api.Message createMessageRecord(String fromParty,
                                                                           String toParty,
                                                                           String fromService,
                                                                           String toService,
                                                                           String action,
                                                                           String actionNS)
                                                                    throws javax.resource.ResourceException
Creates a new message record. If any of the parameters is null, an InvalidParamException will be thrown. (ra implementation specific)

Parameters:
fromParty - the originating party
toParty - the destination party
fromService - the originating service
toService - the destination service
action - the action of the targeting process. The XI GUIs use the term interface instead of action
actionNS - the action (or interface) namespace of the targeting process
Returns:
Message an empty message with only party, service, action and the message id header fields set.
Throws:
javax.resource.ResourceException - if the message couldn't be created.

createMessageRecord

public com.sap.engine.interfaces.messaging.api.Message createMessageRecord(com.sap.engine.interfaces.messaging.api.Party fromParty,
                                                                           com.sap.engine.interfaces.messaging.api.Party toParty,
                                                                           com.sap.engine.interfaces.messaging.api.Service fromService,
                                                                           com.sap.engine.interfaces.messaging.api.Service toService,
                                                                           com.sap.engine.interfaces.messaging.api.Action action)
                                                                    throws javax.resource.ResourceException
Creates a new message record. Analogous to createMessageRecord with string arguments. (ra implementation specific)

Throws:
javax.resource.ResourceException

createMessageRecord

public com.sap.engine.interfaces.messaging.api.Message createMessageRecord(String fromParty,
                                                                           String toParty,
                                                                           String fromService,
                                                                           String toService,
                                                                           String action,
                                                                           String actionNS,
                                                                           String messageId)
                                                                    throws javax.resource.ResourceException
Creates a new message record. If any of the parameters is null, an InvalidParamException will be thrown. (ra implementation specific)

Parameters:
fromParty - the originating party
toParty - the destination party
fromService - the originating service
toService - the destination service
action - the action of the targeting process
actionNS - the action (or interface) namespace 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:
javax.resource.ResourceException - if the message couldn't be created.

createMessageRecord

public com.sap.engine.interfaces.messaging.api.Message createMessageRecord(com.sap.engine.interfaces.messaging.api.Party fromParty,
                                                                           com.sap.engine.interfaces.messaging.api.Party toParty,
                                                                           com.sap.engine.interfaces.messaging.api.Service fromService,
                                                                           com.sap.engine.interfaces.messaging.api.Service toService,
                                                                           com.sap.engine.interfaces.messaging.api.Action action,
                                                                           String messageId)
                                                                    throws javax.resource.ResourceException
Creates a new message record. Analogous to createMessageRecord with string arguments. (ra implementation specific)

Throws:
javax.resource.ResourceException

createMappedRecord

public javax.resource.cci.MappedRecord createMappedRecord(String arg0)
                                                   throws javax.resource.ResourceException
According to the RecordFactory interface a method to create map records must be provided. However, it is not being used. (CCI JCA 1.0)

Specified by:
createMappedRecord in interface javax.resource.cci.RecordFactory
Throws:
javax.resource.ResourceException - Always thrown

createIndexedRecord

public javax.resource.cci.IndexedRecord createIndexedRecord(String arg0)
                                                     throws javax.resource.ResourceException
According to the RecordFactory interface a method to create index records must be provided. However, it is not being used. (CCI JCA 1.0)

Specified by:
createIndexedRecord in interface javax.resource.cci.RecordFactory
Throws:
javax.resource.ResourceException - Always thrown

createXIMessageRecord

public com.sap.aii.af.lib.ra.cci.XIMessageRecord createXIMessageRecord()
Create a empty message record to be used by the application for the outbound case. (XI specific)

Specified by:
createXIMessageRecord in interface com.sap.aii.af.lib.ra.cci.XIRecordFactory
Returns:
Instance of XIMessageRecord with empty XI message

ackNotSupported

public void ackNotSupported(com.sap.engine.interfaces.messaging.api.MessageKey messageKey,
                            com.sap.engine.interfaces.messaging.api.AckType[] acksNotSupported)
                     throws com.sap.engine.interfaces.messaging.api.exception.MessagingException
Publish if acks are not supported (XI specific)

Parameters:
messageKey - identifies the message that cannot be ack'ed
acksNotSupported - identfies the not supported ACK type: 'deliveryAck', 'deliveryErrorAck', 'applicationAck', 'applicationErrorAck'
Throws:
com.sap.engine.interfaces.messaging.api.exception.MessagingException - Exception if ACK name is wrong.

applicationAck

public void applicationAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck)
Send an application ACK (XI specific)

Parameters:
messageToAck - identifies the message for that an application ack has to be sent

applicationErrorAck

public void applicationErrorAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck,
                                Exception error)
Send an application error ACK (XI specific)

Parameters:
messageToAck - identifies the message for that an application ack has to be sent
error - Exception that describes the application error

deliveryAck

public void deliveryAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck)
Send an delivery ACK (XI specific)

Parameters:
messageToAck - identifies the message for that a delivery ack has to be sent

deliveryErrorAck

public void deliveryErrorAck(com.sap.engine.interfaces.messaging.api.MessageKey messageToAck,
                             Exception error)
Send an delivery error ACK (XI specific)

Parameters:
messageToAck - identifies the message for that an delivery ack has to be sent
error - Exception that describes the application error


Copyright © 2012. All Rights Reserved.