com.prowidesoftware.swift.model
Class SwiftBlock2Output

java.lang.Object
  extended by com.prowidesoftware.swift.model.SwiftBlock
      extended by com.prowidesoftware.swift.model.SwiftValueBlock
          extended by com.prowidesoftware.swift.model.SwiftBlock2
              extended by com.prowidesoftware.swift.model.SwiftBlock2Output
All Implemented Interfaces:
java.io.Serializable

public class SwiftBlock2Output
extends SwiftBlock2
implements java.io.Serializable

Base class for SWIFT Application Header Block (block 2) for OUTPUT (from SWIFT).
This block is used to construct messages that have been output from the SWIFT network. From the application point of view, it correspond to the RECEIVED messages.

It's value is fixed-length and continuous with no field delimiters. This class contains its elements as individual attributes for easier management of the block value.
This is an optional block.

Since:
4.0
Version:
$Id: SwiftBlock2Output.java,v 1.2 2013/05/14 01:49:09 sebastian Exp $
Author:
www.prowidesoftware.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.prowidesoftware.swift.model.SwiftBlock2
messagePriority, messageType
 
Fields inherited from class com.prowidesoftware.swift.model.SwiftBlock
blockType, id, input, output, unparsedTexts
 
Constructor Summary
SwiftBlock2Output()
          Default Constructor
SwiftBlock2Output(java.lang.String value)
          Creates a block 2 output object setting attributes by parsing the fixed string argument;
for example "O1001200970103BANKBEBBAXXX22221234569701031201N" or "2:O1001200970103BANKBEBBAXXX22221234569701031201N"
SwiftBlock2Output(java.lang.String messageType, java.lang.String senderInputTime, java.lang.String MIRDate, java.lang.String MIRLogicalTerminal, java.lang.String MIRSessionNumber, java.lang.String MIRSequenceNumber, java.lang.String receiverOutputDate, java.lang.String receiverOutputTime, java.lang.String messagePriority)
          Constructor for specific values
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getBlockValue()
          This method should be overwritten by subclasses, calling this method will throw a java.lang.UnsupportedOperationException
 java.lang.String getMIR()
          Gets the full MIR (Message Input Reference) string of 28 characters containing the sender's date, LT address, session and sequence:
for example YYMMDDBANKBEBBAXXX2222123456
 java.lang.String getMIRDate()
          Gets the date the sender sent the message to SWIFT, from the MIR field, in the format YYMMDD
 java.lang.String getMIRLogicalTerminal()
          Gets the the full LT address of the sender of the message, from the MIR field, for example: BANKBEBBAXXX
 java.lang.String getMIRSequenceNumber()
          Gets the date the sender sequence number, from the MIR field, in the format NNNNNN
 java.lang.String getMIRSessionNumber()
          Gets the date the sender session number, from the MIR field, in the format NNNN
 java.lang.String getReceiverOutputDate()
          Gets the Output date local to the receiver
 java.lang.String getReceiverOutputTime()
          Gets the Output time local to the receiver, written in the following format: HHMM
 java.lang.String getSenderInputTime()
          Returns the input time with respect to the sender
 java.lang.String getValue()
          Gets the fixed length block 2 value, as a result of concatenating its individual elements as follow:
Message Type + Sender Input Time + MIR + Receiver Output Date + Receiver Output Time + Message Priority.
 int hashCode()
           
 boolean isEmpty()
          Tell if this block is empty or not.
 void setBlockValue(java.lang.String value)
          This method should be overwritten by subclasses, calling this method will throw a java.lang.UnsupportedOperationException
 void setMIR(java.lang.String mir)
          Sets the full MIR (Message Input Reference) string of 28 characters containing the sender's date, LT address, session and sequence:
for example YYMMDDBANKBEBBAXXX2222123456
 void setMIRDate(java.lang.String MIRDate)
          Sets the date the sender sent the message to SWIFT, from the MIR field
 void setMIRLogicalTerminal(java.lang.String MIRLogicalTerminal)
          Sets the the full LT address of the sender of the message, from the MIR field, for example: BANKBEBBAXXX
 void setMIRSequenceNumber(java.lang.String MIRSequenceNumber)
          Sets the sequence number field of the MIR
 void setMIRSessionNumber(java.lang.String MIRSessionNumber)
          Sets the session number field of the MIR
 void setReceiverOutputDate(java.lang.String receiverOutputDate)
          Sets the Output date local to the receiver, written in the following format: YYMMDD
 void setReceiverOutputTime(java.lang.String receiverOutputTime)
          Sets the Output time local to the receiver, written in the following format: HHMM
 void setSenderInputTime(java.lang.String senderInputTime)
          Sets the input time with respect to the sender
 void setValue(java.lang.String value)
          Sets the block's attributes by parsing the string argument containing the blocks value.
 
Methods inherited from class com.prowidesoftware.swift.model.SwiftBlock2
clean, getMessagePriority, getMessageType, getName, getNumber, isInput, isOutput, setBlockName, setBlockNumber, setMessagePriority, setMessageType, toString
 
Methods inherited from class com.prowidesoftware.swift.model.SwiftValueBlock
getValuePart, size
 
Methods inherited from class com.prowidesoftware.swift.model.SwiftBlock
getBlockType, getId, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwiftBlock2Output

public SwiftBlock2Output(java.lang.String messageType,
                         java.lang.String senderInputTime,
                         java.lang.String MIRDate,
                         java.lang.String MIRLogicalTerminal,
                         java.lang.String MIRSessionNumber,
                         java.lang.String MIRSequenceNumber,
                         java.lang.String receiverOutputDate,
                         java.lang.String receiverOutputTime,
                         java.lang.String messagePriority)
Constructor for specific values

Parameters:
messageType - the message type
senderInputTime - the input time
MIRDate - date
MIRLogicalTerminal - logical terminal
MIRSessionNumber - session number
MIRSequenceNumber - message sequence number
receiverOutputDate - receiver date
receiverOutputTime - receiver time
messagePriority - the message priority (S=system, U=urgent, N=normal)

SwiftBlock2Output

public SwiftBlock2Output(java.lang.String value)
Creates a block 2 output object setting attributes by parsing the fixed string argument;
for example "O1001200970103BANKBEBBAXXX22221234569701031201N" or "2:O1001200970103BANKBEBBAXXX22221234569701031201N"

Parameters:
value - a fixed length string of 47 (starting with 'O') or 49 (starting with '2:O') characters containing the blocks value

SwiftBlock2Output

public SwiftBlock2Output()
Default Constructor

Method Detail

setSenderInputTime

public void setSenderInputTime(java.lang.String senderInputTime)
Sets the input time with respect to the sender

Parameters:
senderInputTime - 4 numbers HHMM

getSenderInputTime

public java.lang.String getSenderInputTime()
Returns the input time with respect to the sender

Returns:
4 numbers HHMM

setMIRDate

public void setMIRDate(java.lang.String MIRDate)
Sets the date the sender sent the message to SWIFT, from the MIR field

Parameters:
MIRDate - 6 numbers with date in format YYMMDD

getMIRDate

public java.lang.String getMIRDate()
Gets the date the sender sent the message to SWIFT, from the MIR field, in the format YYMMDD

Returns:
String with 6 numbers

setMIRLogicalTerminal

public void setMIRLogicalTerminal(java.lang.String MIRLogicalTerminal)
Sets the the full LT address of the sender of the message, from the MIR field, for example: BANKBEBBAXXX

Parameters:
MIRLogicalTerminal -

getMIRLogicalTerminal

public java.lang.String getMIRLogicalTerminal()
Gets the the full LT address of the sender of the message, from the MIR field, for example: BANKBEBBAXXX

Returns:
LT address

setMIRSessionNumber

public void setMIRSessionNumber(java.lang.String MIRSessionNumber)
Sets the session number field of the MIR

Parameters:
MIRSessionNumber - 4 numbers

getMIRSessionNumber

public java.lang.String getMIRSessionNumber()
Gets the date the sender session number, from the MIR field, in the format NNNN

Returns:
4 numbers

setMIRSequenceNumber

public void setMIRSequenceNumber(java.lang.String MIRSequenceNumber)
Sets the sequence number field of the MIR

Parameters:
MIRSequenceNumber - 6 numbers

getMIRSequenceNumber

public java.lang.String getMIRSequenceNumber()
Gets the date the sender sequence number, from the MIR field, in the format NNNNNN

Returns:
6 numbers

getMIR

public java.lang.String getMIR()
Gets the full MIR (Message Input Reference) string of 28 characters containing the sender's date, LT address, session and sequence:
for example YYMMDDBANKBEBBAXXX2222123456

Returns:
a String with MIR, returns null if all MIR components are null

setMIR

public void setMIR(java.lang.String mir)
Sets the full MIR (Message Input Reference) string of 28 characters containing the sender's date, LT address, session and sequence:
for example YYMMDDBANKBEBBAXXX2222123456

Parameters:
mir - complete MIR string

setReceiverOutputDate

public void setReceiverOutputDate(java.lang.String receiverOutputDate)
Sets the Output date local to the receiver, written in the following format: YYMMDD

Parameters:
receiverOutputDate - 6 characters in format YYMMDD

getReceiverOutputDate

public java.lang.String getReceiverOutputDate()
Gets the Output date local to the receiver

Returns:
6 characters in format YYMMDD

setReceiverOutputTime

public void setReceiverOutputTime(java.lang.String receiverOutputTime)
Sets the Output time local to the receiver, written in the following format: HHMM

Parameters:
receiverOutputTime - String with 4 numbers

getReceiverOutputTime

public java.lang.String getReceiverOutputTime()
Gets the Output time local to the receiver, written in the following format: HHMM

Returns:
String with 4 numbers

isEmpty

public boolean isEmpty()
Tell if this block is empty or not. This block is considered to be empty if all its attributes are set to null.

Overrides:
isEmpty in class SwiftValueBlock
Returns:
true if all fields are null and false in other case

getValue

public java.lang.String getValue()
Gets the fixed length block 2 value, as a result of concatenating its individual elements as follow:
Message Type + Sender Input Time + MIR + Receiver Output Date + Receiver Output Time + Message Priority.

Overrides:
getValue in class SwiftValueBlock
Returns:
the blocks value as a single string

getBlockValue

public java.lang.String getBlockValue()
Description copied from class: SwiftValueBlock
This method should be overwritten by subclasses, calling this method will throw a java.lang.UnsupportedOperationException

Overrides:
getBlockValue in class SwiftValueBlock
Returns:
N/A
See Also:
getValue()

setValue

public void setValue(java.lang.String value)
Sets the block's attributes by parsing the string argument containing the blocks value. This value can be in different flavors because some fields are optional.
Example of supported values:
   "O1001200970103BANKBEBBAXXX22221234569701031201"  (46) or
 "2:O1001200970103BANKBEBBAXXX22221234569701031201"  (48)   // used for service/system messages
   "O1001200970103BANKBEBBAXXX22221234569701031201N" (47) or
 "2:O1001200970103BANKBEBBAXXX22221234569701031201N" (49)
 

Overrides:
setValue in class SwiftValueBlock
Parameters:
value - a string with the value to split

setBlockValue

public void setBlockValue(java.lang.String value)
Description copied from class: SwiftValueBlock
This method should be overwritten by subclasses, calling this method will throw a java.lang.UnsupportedOperationException

Overrides:
setBlockValue in class SwiftValueBlock
Parameters:
value - unused
See Also:
setValue(String)

hashCode

public int hashCode()
Overrides:
hashCode in class SwiftBlock2

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class SwiftBlock2