com.ibm.mds.adpt.sms.base.cci
Class BaseMessageTranslator

java.lang.Object
  extended by com.ibm.mds.adpt.sms.base.cci.BaseMessageTranslator

public abstract class BaseMessageTranslator
extends java.lang.Object

This is the main utility class for the protocol message translator. When adding a new JCA Protocol adaptor, a user must extend this class to support translation of the attributes between SI and Adapter.


Field Summary
protected  java.lang.String encoding
           
protected  int maxMessageLength
           
protected  int maxTargets
           
 
Constructor Summary
BaseMessageTranslator(java.lang.String encoding)
          Creates a new Base Message Translator.
 
Method Summary
 boolean equals(BaseMessageTranslator translator)
          test if the incoming translator is equal to this translator object
 java.lang.String getDataCoding()
           
 int getMaxMessageLength()
           
 int getMaxTargets()
           
abstract  javax.resource.cci.Record getMultiTargetRecord(java.lang.String[] targets, java.lang.String source, java.lang.String msg, int segment, int totalSegments, int sarRefNum, int aid, java.lang.String serviceType, java.lang.String billingCode, java.lang.String serviceTypeUsage, java.lang.String Operation, boolean chargeForFirstSegmentOnly)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
abstract  javax.resource.cci.Record getMultiTargetRecord(java.net.URI[] targets, java.lang.String source, java.lang.String msg, int segment, int totalSegments, int sarRefNum, int aid, java.lang.String serviceType, java.lang.String billingCode, java.lang.String serviceTypeUsage, java.lang.String Operation, boolean chargeForFirstSegmentOnly)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
abstract  javax.resource.cci.Record getMultiTargetResponseRecord(java.lang.String source)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
abstract  javax.resource.cci.Record getSingleTargetRecord(java.lang.String target, java.lang.String source, java.lang.String msg, int segment, int totalSegments, int sarRefNum, int aid, java.lang.String serviceType, java.lang.String billingCode, java.lang.String serviceTypeUsage, java.lang.String Operation, boolean chargeForFirstSegmentOnly)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
abstract  javax.resource.cci.Record getSingleTargetRecord(java.net.URI target, java.lang.String source, java.lang.String msg, int segment, int totalSegments, int sarRefNum, int aid, java.lang.String serviceType, java.lang.String billingCode, java.lang.String serviceTypeUsage, java.lang.String Operation, boolean chargeForFirstSegmentOnly)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
abstract  javax.resource.cci.Record getSingleTargetResponseRecord(java.lang.String source)
          This method will divide a single internal message to an array of cci Records according to the maxMessageLength.
 boolean isReceiptRequired()
           
 void setDataCoding(java.lang.String dataCoding)
           
 void setMaxMessageLength(int maxMessageLength)
           
 void setMaxTargets(int maxTargets)
           
 void setReceiptRequired(boolean receiptRequired)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxMessageLength

protected int maxMessageLength

maxTargets

protected int maxTargets

encoding

protected java.lang.String encoding
Constructor Detail

BaseMessageTranslator

public BaseMessageTranslator(java.lang.String encoding)
Creates a new Base Message Translator. This will be used when more control is required over the message fragmentation process so that the default encoding is not used.

Parameters:
encoding - The encoding to use when fragmenting messages.
Method Detail

getMultiTargetRecord

public abstract javax.resource.cci.Record getMultiTargetRecord(java.net.URI[] targets,
                                                               java.lang.String source,
                                                               java.lang.String msg,
                                                               int segment,
                                                               int totalSegments,
                                                               int sarRefNum,
                                                               int aid,
                                                               java.lang.String serviceType,
                                                               java.lang.String billingCode,
                                                               java.lang.String serviceTypeUsage,
                                                               java.lang.String Operation,
                                                               boolean chargeForFirstSegmentOnly)
                                                        throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
targets - The array of targets who should receive a copy of the message.
source - The source address of the originator of the message.
msg - The message to translate.
aid - a Unique ID for the message segment.
Returns:
Record[] The array of CCI records to send.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getMultiTargetRecord

public abstract javax.resource.cci.Record getMultiTargetRecord(java.lang.String[] targets,
                                                               java.lang.String source,
                                                               java.lang.String msg,
                                                               int segment,
                                                               int totalSegments,
                                                               int sarRefNum,
                                                               int aid,
                                                               java.lang.String serviceType,
                                                               java.lang.String billingCode,
                                                               java.lang.String serviceTypeUsage,
                                                               java.lang.String Operation,
                                                               boolean chargeForFirstSegmentOnly)
                                                        throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
targets - The array of targets who should receive a copy of the message.
source - The source address of the originator of the message.
msg - The message to translate.
aid - a Unique ID for the message segment.
Returns:
Record[] The array of CCI records to send.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getSingleTargetRecord

public abstract javax.resource.cci.Record getSingleTargetRecord(java.lang.String target,
                                                                java.lang.String source,
                                                                java.lang.String msg,
                                                                int segment,
                                                                int totalSegments,
                                                                int sarRefNum,
                                                                int aid,
                                                                java.lang.String serviceType,
                                                                java.lang.String billingCode,
                                                                java.lang.String serviceTypeUsage,
                                                                java.lang.String Operation,
                                                                boolean chargeForFirstSegmentOnly)
                                                         throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
targets - The array of targets who should receive a copy of the message.
source - The source address of the originator of the message.
msg - The message to translate.
aid - a Unique ID for the message segment.
Returns:
Record[] The array of CCI records to send.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getSingleTargetRecord

public abstract javax.resource.cci.Record getSingleTargetRecord(java.net.URI target,
                                                                java.lang.String source,
                                                                java.lang.String msg,
                                                                int segment,
                                                                int totalSegments,
                                                                int sarRefNum,
                                                                int aid,
                                                                java.lang.String serviceType,
                                                                java.lang.String billingCode,
                                                                java.lang.String serviceTypeUsage,
                                                                java.lang.String Operation,
                                                                boolean chargeForFirstSegmentOnly)
                                                         throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
target - The URI target who should receive a copy of the message.
source - The source address of the originator of the message.
msg - The message to translate.
aid - a Unique ID for the message segment.
Returns:
Record[] The array of CCI records to send.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getMultiTargetResponseRecord

public abstract javax.resource.cci.Record getMultiTargetResponseRecord(java.lang.String source)
                                                                throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
source - The source address of the originator of the message.
Returns:
Record The CCI Response record for multiple targets.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getSingleTargetResponseRecord

public abstract javax.resource.cci.Record getSingleTargetResponseRecord(java.lang.String source)
                                                                 throws com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException
This method will divide a single internal message to an array of cci Records according to the maxMessageLength. If the maxMessageLength is set to 0, then there will be a single record returned. This method is abstract since every protocol adaptor will have a unique Record type and will need to provide an implementation of this method in order to properly translate the internal MDS messages.

Parameters:
source - The source address of the originator of the message.
Returns:
Record The response CCI record for a single target.
Throws:
com.ibm.mds.adpt.sms.smpp.util.MessageTranslationException

getMaxMessageLength

public int getMaxMessageLength()
Returns:
Returns the maxMessageLength.

setMaxMessageLength

public void setMaxMessageLength(int maxMessageLength)
Parameters:
maxMessageLength - The maxMessageLength to set.

getMaxTargets

public int getMaxTargets()
Returns:
Returns the maxTargets.

setMaxTargets

public void setMaxTargets(int maxTargets)
Parameters:
maxTargets - The maxTargets to set.

getDataCoding

public java.lang.String getDataCoding()
Returns:
Returns the dataCoding.

setDataCoding

public void setDataCoding(java.lang.String dataCoding)
Parameters:
dataCoding - The dataCoding to set.

isReceiptRequired

public boolean isReceiptRequired()
Returns:
Returns the receiptRequired.

setReceiptRequired

public void setReceiptRequired(boolean receiptRequired)
Parameters:
receiptRequired - The receiptRequired to set.

equals

public boolean equals(BaseMessageTranslator translator)
test if the incoming translator is equal to this translator object

Parameters:
translator -
Returns:


Copyright © 2006 IBM Corp. All Rights Reserved.