public class MxSwiftMessage extends AbstractSwiftMessage
MMX messages are uniquely identify by their business process, message functionality, variant and version.
Consider the following example: TREA.001.001.02
businessProcess: Alphabetic code in four positions (fixed length) identifying the Business Process
functionality: Alphanumeric code in three positions (fixed length) identifying the Message Functionality
variant: Numeric code in three positions (fixed length) identifying a particular flavor (variant) of Message Functionality
version: Numeric code in two positions (fixed length) identifying the version.
identifier, IDENTIFIER_ACK, IDENTIFIER_NAK, PROPERTY_NAME, receiver, sender
Constructor and Description |
---|
MxSwiftMessage() |
MxSwiftMessage(AbstractMX mx)
Creates a new message serializing to xml the parameter message object.
|
MxSwiftMessage(File file)
Creates a new message reading the message the content from a file.
|
MxSwiftMessage(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
MxSwiftMessage(String xml)
Creates a new message reading the message the content from a string.
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(MxSwiftMessage msg)
copies attributes from this object to the given object
non inherited copied attributes:
functionality
variant
version
|
boolean |
equals(Object obj) |
ApplicationHeader |
getApplicationHeader()
Deprecated.
use #getBusinessHeader() instead
|
BusinessHeader |
getBusinessHeader()
If present in the message content, returns the business header (SWIFT or ISO version)
Notice this header is optional and may not be present.
|
MxBusinessProcess |
getBusinessProcess() |
String |
getFunctionality() |
String |
getVariant() |
String |
getVersion() |
int |
hashCode() |
static MxSwiftMessage |
parse(File file)
Creates a new message reading the message the content from a file.
|
static MxSwiftMessage |
parse(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
static MxSwiftMessage |
parse(String xml)
Creates a new message reading the message the content from a string.
|
MxSwiftMessage |
readFile(File file)
Deprecated.
use the constructor
MxSwiftMessage(File) instead |
void |
setApplicationHeader(ApplicationHeader applicationHeader)
Deprecated.
@see #getApplicationHeader()
|
void |
setBusinessProcess(MxBusinessProcess businessProcess) |
protected void |
setDataFromNamespace(String namespace)
Deprecated.
The internal metadata is set automatically from the message content when
the object is constructed from String, File or Stream. This should not be updated from
a decoupled namespace String to avoid inconsistencies between the stored raw message content
and the metadata.
|
void |
setFunctionality(String functionality) |
void |
setVariant(String variant) |
void |
setVersion(String version) |
String |
toString() |
protected void |
updateFromMessage()
Updates the object attributes with metadata parsed from the message raw content:
identifier, sender, receiver, direction and specific data for the implementing subclass.
|
void |
updateFromModel(AbstractMX mx)
Updates the the attributes with the raw message and its metadata from the given raw (XML) message content.
|
void |
updateFromXML(String xml)
Updates the the attributes with the raw message and its metadata from the given raw (XML) message content.
|
void |
updateFromXML(String xml,
MxId id)
Similar to
updateFromXML(String) but providing the corresponding MxId
to skip automatic detection for specific Mx type from content. |
addNote, addRevision, addStatus, contains, contains, copyTo, createRevision, findStatusInfo, findStatusInfo, findStatusInfoLast, findStatusInfoLast, formattedAmount, formattedAmount, getAmount, getChecksum, getCreationDate, getCurrency, getDirection, getFileFormat, getFilename, getId, getIdentifier, getLastData, getLastData, getLastModified, getMessage, getMessageName, getNotes, getPaddedId, getPreviousStatusInfo, getProperties, getProperty, getProperty, getPropertyBoolean, getPropertyBoolean, getReceiver, getReference, getRevisions, getSender, getStatus, getStatusInfo, getStatusTrail, identifiedAsACK, identifiedAsNAK, isIncoming, isInput, isMT, isMX, isOutgoing, isOutput, isStatus, isStatus, isStatus, isStatus, match, message, messageStandardType, sanityCheckProperties, setAmount, setChecksum, setCreationDate, setCurrency, setDirection, setFileFormat, setFilename, setId, setIdentifier, setLastModified, setMessage, setNotes, setProperties, setProperty, setProperty, setReceiver, setReference, setRevisions, setSender, setStatus, setStatus, setStatusTrail
public MxSwiftMessage()
public MxSwiftMessage(String xml)
public MxSwiftMessage(InputStream stream) throws IOException
IOException
MxSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(InputStream)
public MxSwiftMessage(File file) throws IOException
IOException
MxSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(File)
public MxSwiftMessage(AbstractMX mx)
AbstractMX.message(String)
mx
- public static MxSwiftMessage parse(String xml)
MxSwiftMessage(String)
public static MxSwiftMessage parse(InputStream stream) throws IOException
MxSwiftMessage(InputStream)
IOException
public static MxSwiftMessage parse(File file) throws IOException
MxSwiftMessage(File)
IOException
protected void updateFromMessage()
AbstractSwiftMessage
updateFromMessage
in class AbstractSwiftMessage
AbstractSwiftMessage.updateFromMessage()
public void updateFromXML(String xml)
xml
- the XML content of an MX message containing the Document and optional AppHdr elementsupdateFromMessage()
public void updateFromXML(String xml, MxId id)
updateFromXML(String)
but providing the corresponding MxId
to skip automatic detection for specific Mx type from content.xml
- the XML content of an MX message containing the Document and optional AppHdr elementsid
- the specific Mx type identificationpublic void updateFromModel(AbstractMX mx)
mx
- the new message contentupdateFromMessage()
public MxBusinessProcess getBusinessProcess()
public void setBusinessProcess(MxBusinessProcess businessProcess)
public String getFunctionality()
public void setFunctionality(String functionality)
public String getVariant()
public void setVariant(String variant)
public String getVersion()
public void setVersion(String version)
public int hashCode()
hashCode
in class AbstractSwiftMessage
public boolean equals(Object obj)
equals
in class AbstractSwiftMessage
@Deprecated @ProwideDeprecated(phase4=_2018) public MxSwiftMessage readFile(File file) throws IOException
MxSwiftMessage(File)
insteadreadFile
in class AbstractSwiftMessage
IOException
@Deprecated @ProwideDeprecated(phase3=_2018) protected void setDataFromNamespace(String namespace)
public BusinessHeader getBusinessHeader()
MxParser.parseBusinessHeader()
@Deprecated public ApplicationHeader getApplicationHeader()
getBusinessHeader()
@Deprecated public void setApplicationHeader(ApplicationHeader applicationHeader)
getApplicationHeader()
public void copyTo(MxSwiftMessage msg)
msg
- AbstractSwiftMessage.copyTo(AbstractSwiftMessage)