public class MIR
extends java.lang.Object
MIR and MOR are messages unique identifiers containing the date, logical terminal (including branch code), session and sequence numbers. Nevertheless this identifiers can be confusing sometimes because they must be thought from SWIFT perspective.
A message created by the sender user/application is considered an INPUT message, because it gets into the SWIFT network. When the message is delivered and gets out of the network it is considered an OUTPUT message. Therefore the headers of a sent message are not exactly the same as the headers of the received message at the destination party. Analogous the headers of a message that the receiving user/application gets from SWIFT are not exactly the same as the headers when the message was created and sent by the sending party.
The usage of MIR and MOR are clear when analyzing system messages.
A non delivery warning for example, includes the original MIR of the
sent message, but not the MOR because the message was not delivered yet.
But a delivery confirmation on the other hand, includes both, the sender’s MIR
and the receiver’s MOR.
System messages provide MIR/MOR information using fields 106 and 107 respectively.
Constructor and Description |
---|
MIR()
Default constructor
|
MIR(java.lang.String value)
Creates a MIR object parsing the literal string value.
|
MIR(java.lang.String date,
java.lang.String logicalTerminal,
java.lang.String sessionNumber,
java.lang.String sequenceNumber) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getDate() |
java.util.Calendar |
getDateAsCalendar()
Returns this MIR date as Calendar.
|
java.lang.String |
getLogicalTerminal() |
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 |
getSequenceNumber() |
java.lang.String |
getSessionNumber() |
int |
hashCode() |
void |
setDate(java.util.Calendar date)
Sets a date from a calendar, formatting it as YYMMDD
|
void |
setDate(java.lang.String date) |
void |
setLogicalTerminal(java.lang.String logicalTerminal) |
void |
setSequenceNumber(java.lang.String sequenceNumber) |
void |
setSessionNumber(java.lang.String sessionNumber) |
public MIR(java.lang.String date, java.lang.String logicalTerminal, java.lang.String sessionNumber, java.lang.String sequenceNumber)
public MIR(java.lang.String value)
value
- the MIR value, it is expected to 28 characters lengthpublic MIR()
public java.lang.String getDate()
public void setDate(java.lang.String date)
date
- a date formatted as YYMMDDpublic void setDate(java.util.Calendar date)
date
- a datepublic java.lang.String getLogicalTerminal()
public void setLogicalTerminal(java.lang.String logicalTerminal)
public java.lang.String getSessionNumber()
public void setSessionNumber(java.lang.String sessionNumber)
public java.lang.String getSequenceNumber()
public void setSequenceNumber(java.lang.String sequenceNumber)
public java.lang.String getMIR()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final java.util.Calendar getDateAsCalendar()
SwiftFormatUtils.getDate2(String)