com.prowidesoftware.swift.model.mt
Class AbstractMT

java.lang.Object
  extended by com.prowidesoftware.swift.model.mt.AbstractMT
Direct Known Subclasses:
MT028, MT101, MT102, MT102_STP, MT103, MT103_STP, MT104, MT105, MT107, MT110, MT111, MT112, MT190, MT191, MT192, MT195, MT196, MT198, MT199, MT200, MT201, MT202, MT202COV, MT203, MT204, MT205, MT205COV, MT207, MT210, MT256, MT290, MT291, MT292, MT295, MT296, MT298, MT299, MT300, MT303, MT304, MT305, MT306, MT307, MT320, MT321, MT330, MT340, MT341, MT350, MT360, MT361, MT362, MT364, MT365, MT380, MT381, MT390, MT391, MT392, MT395, MT396, MT398, MT399, MT400, MT410, MT412, MT416, MT420, MT422, MT430, MT450, MT455, MT456, MT490, MT491, MT492, MT495, MT496, MT498, MT499, MT500, MT501, MT502, MT503, MT504, MT505, MT506, MT507, MT508, MT509, MT510, MT518, MT535, MT537, MT540, MT541, MT542, MT543, MT544, MT545, MT546, MT547, MT548, MT549, MT564, MT565, MT566, MT567, MT590, MT591, MT592, MT595, MT596, MT598, MT599, MT600, MT601, MT604, MT605, MT606, MT607, MT608, MT609, MT690, MT691, MT692, MT695, MT696, MT698, MT699, MT700, MT701, MT705, MT707, MT710, MT711, MT720, MT721, MT730, MT732, MT734, MT740, MT742, MT747, MT750, MT752, MT754, MT756, MT760, MT767, MT768, MT769, MT790, MT791, MT792, MT795, MT796, MT798, MT798_743, MT798_745, MT798_760, MT798_761, MT798_762, MT798_763, MT798_764, MT798_766, MT798_767, MT798_769, MT798_779, MT798_788, MT798_789, MT798_790, MT798_791, MT798_793, MT798_794, MT798_799, MT799, MT800, MT801, MT802, MT824, MT890, MT891, MT892, MT895, MT896, MT898, MT899, MT900, MT910, MT920, MT935, MT940, MT941, MT942, MT950, MT970, MT971, MT972, MT973, MT985, MT986, MT990, MT991, MT992, MT995, MT996, MT998, MT999

public abstract class AbstractMT
extends java.lang.Object

Base class for specific MTs.
This class implements several high level delegate methods of SwiftMessage.

Since:
6.0
Version:
$Id: AbstractMT.java,v 1.1.1.1 2013/04/10 17:04:50 mgriffa Exp $
Author:
www.prowidesoftware.com

Constructor Summary
AbstractMT()
          Creates a particular MT initialized with a new SwiftMessage.
AbstractMT(SwiftMessage m)
           
 
Method Summary
 void addField(Field f)
          Adds the given field to the body block.
 java.lang.String FIN()
          Gets a String containing the FIN message (SWIFT MT message).
 java.lang.String getApplicationId()
           
 java.lang.String getLogicalTerminal()
           
 java.lang.String getMessagePriority()
           
abstract  java.lang.String getMessageType()
          Returns this MT number
 java.lang.String getReceiver()
          Gets the logical terminal field of the application header block.
 java.lang.String getSender()
          Gets the logical terminal field of the header block.
 java.lang.String getSequenceNumber()
           
 java.lang.String getServiceId()
           
 java.lang.String getSessionNumber()
           
 SwiftMessage getSwiftMessage()
           
 boolean isInput()
           
 boolean isOutput()
           
 void setReceiver(BIC bic)
           
 void setReceiver(java.lang.String BIC)
          Sets the logical terminal field of the application header block.
It is fixed at 12 characters; it must have X in position 9 (padded with "X" if no branch is required).
 void setSender(BIC bic)
           
 void setSender(java.lang.String BIC)
          Sets the logical terminal field of the header block.
It is fixed at 12 characters; it must not have X in position 9 (padded with "X" if no branch is required).
 void setSwiftMessage(SwiftMessage m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMT

public AbstractMT(SwiftMessage m)
Parameters:
m - swift message to model as a particular MT

AbstractMT

public AbstractMT()
Creates a particular MT initialized with a new SwiftMessage. All blocks are initialized.

Method Detail

getSwiftMessage

public SwiftMessage getSwiftMessage()
Returns:
the swift message object modeled as this particular MT

setSwiftMessage

public void setSwiftMessage(SwiftMessage m)
Parameters:
m - swift message to model as a particular MT

getApplicationId

public java.lang.String getApplicationId()
Returns:
application id from block 1
See Also:
SwiftBlock1.getApplicationId()

getServiceId

public java.lang.String getServiceId()
Returns:
service id from block 1
See Also:
SwiftBlock1.getServiceId()

getLogicalTerminal

public java.lang.String getLogicalTerminal()
Returns:
logical terminal from block 1
See Also:
SwiftBlock1.getLogicalTerminal()

getSessionNumber

public java.lang.String getSessionNumber()
Returns:
session number from block 1
See Also:
SwiftBlock1.getSessionNumber()

getSequenceNumber

public java.lang.String getSequenceNumber()
Returns:
sequence number from block 1
See Also:
SwiftBlock1.getSequenceNumber()

getMessagePriority

public java.lang.String getMessagePriority()
Returns:
message priority from block 2
See Also:
SwiftBlock2.getMessagePriority()

isInput

public boolean isInput()
Returns:
true if message is an input message sent to SWIFTNet, false otherwise
See Also:
SwiftBlock2.isInput()

isOutput

public boolean isOutput()
Returns:
true if message is an output message received from SWIFTNet, false otherwise
See Also:
SwiftBlock2.isOutput()

setSender

public void setSender(java.lang.String BIC)
Sets the logical terminal field of the header block.
It is fixed at 12 characters; it must not have X in position 9 (padded with "X" if no branch is required).

Parameters:
BIC - the SWIFT BIC code to set as sender address.
Since:
6.4

setSender

public void setSender(BIC bic)
Since:
6.4
See Also:
setSender(String)

getSender

public java.lang.String getSender()
Gets the logical terminal field of the header block.

Returns:
the found BIC code of the sender or null if the message or the header block are null.
Since:
6.4

setReceiver

public void setReceiver(java.lang.String BIC)
Sets the logical terminal field of the application header block.
It is fixed at 12 characters; it must have X in position 9 (padded with "X" if no branch is required).

Parameters:
BIC - the SWIFT BIC code to set as sender address.
Since:
6.4

setReceiver

public void setReceiver(BIC bic)
Since:
6.4
See Also:
setReceiver(String)

getReceiver

public java.lang.String getReceiver()
Gets the logical terminal field of the application header block.

Returns:
the found BIC code of the sender or null if the message or the header block are null.
Since:
6.4

addField

public void addField(Field f)
Adds the given field to the body block.

Parameters:
f -

FIN

public java.lang.String FIN()
Gets a String containing the FIN message (SWIFT MT message).

Returns:
a string with the FIN format representation of the message

getMessageType

public abstract java.lang.String getMessageType()
Returns this MT number

Returns:
the message type number of this MT
Since:
6.4