@Entity(name="mx") public class MxSwiftMessage extends AbstractSwiftMessage
The class holds the full xml content plus message identification metadata gathered from the application header.
Notice, the scope of Prowide MX model is the message payload (the actual message or body data) which is the fundamental purpose of the transmission. The transmission wrappers (overhead data) are excluded and intentionally ignored if found.
MX 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.
PROPERTY_NAME
Constructor and Description |
---|
MxSwiftMessage() |
MxSwiftMessage(AbstractMX mx)
Creates a new message serializing to xml the parameter message object.
|
MxSwiftMessage(java.io.File file)
Creates a new message reading the message the content from a file.
|
MxSwiftMessage(java.io.InputStream stream)
Creates a new message reading the message the content from an input stream.
|
MxSwiftMessage(java.lang.String xml)
Creates a new message reading the message the content from a string.
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(MxSwiftMessage msg)
Creates a full copy of the current message object into another message.
|
boolean |
equals(java.lang.Object o) |
static MxSwiftMessage |
fromJson(java.lang.String json)
This method deserializes the JSON data into an MX message object.
|
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() |
java.lang.String |
getFunctionality() |
MxId |
getMxId()
Returns this message MX identification
|
java.lang.String |
getVariant() |
java.lang.String |
getVersion() |
int |
hashCode() |
static MxSwiftMessage |
parse(java.io.File file)
Creates a new message reading the message the content from a file.
|
static MxSwiftMessage |
parse(java.io.InputStream stream)
Creates a new message reading the message the content from an input stream.
|
static MxSwiftMessage |
parse(java.lang.String xml)
Creates a new message reading the message the content from a string.
|
void |
setApplicationHeader(ApplicationHeader applicationHeader)
Deprecated.
@see #getApplicationHeader()
|
void |
setBusinessProcess(MxBusinessProcess businessProcess) |
void |
setFunctionality(java.lang.String functionality) |
void |
setVariant(java.lang.String variant) |
void |
setVersion(java.lang.String version) |
java.lang.String |
toString() |
void |
updateFromModel(AbstractMX mx)
Updates the the attributes with the raw message and its metadata from the given raw (XML) message content.
|
void |
updateFromXML(java.lang.String xml)
Updates the the attributes with the raw message and its metadata from the given raw (XML) message content.
|
void |
updateFromXML(java.lang.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, getCategory, getChecksum, getChecksumBody, getCorrespondentBIC, getCreationDate, getCreationDayOfMonth, getCreationMonth, getCreationYear, getCurrency, getDirection, getFileFormat, getFilename, getId, getIdentifier, getLastData, getLastData, getLastModified, getMessage, getMessageName, getMessageType, getNotes, getPaddedId, getPreviousStatusInfo, getProperties, getProperty, getProperty, getPropertyBoolean, getPropertyBoolean, getReceiver, getReference, getRevisions, getSender, getStatus, getStatusInfo, getStatusTrail, getTradeDate, getValueDate, identifiedAsACK, identifiedAsNAK, isIncoming, isInput, isMT, isMX, isOutgoing, isOutput, isStatus, isStatus, isStatus, isStatus, match, message, messageStandardType, propertyEquals, propertyEquals, propertyEquals, sanityCheckProperties, setAmount, setChecksum, setChecksumBody, setCreationDate, setCurrency, setDirection, setFileFormat, setFilename, setId, setIdentifier, setLastModified, setMessage, setNotes, setProperties, setProperty, setProperty, setReceiver, setReference, setRevisions, setSender, setStatus, setStatus, setStatusTrail, setTradeDate, setValueDate, toJson
public MxSwiftMessage()
public MxSwiftMessage(java.lang.String xml)
public MxSwiftMessage(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
MxSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(InputStream)
public MxSwiftMessage(java.io.File file) throws java.io.IOException
java.io.IOException
MxSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(File)
public MxSwiftMessage(AbstractMX mx)
If the business header is present, the sender and receiver attributes will be set with content from the
header; also the internal raw XML will include both 'AppHdr' and 'Document' under a default root element tag
as returned by AbstractMX.message()
If the header is not present, sender and receiver will be left null and the raw internal XML will include
just the 'Document' element.
mx
- a message objectpublic static MxSwiftMessage parse(java.lang.String xml)
MxSwiftMessage(String)
public static MxSwiftMessage parse(java.io.InputStream stream) throws java.io.IOException
MxSwiftMessage(InputStream)
java.io.IOException
public static MxSwiftMessage parse(java.io.File file) throws java.io.IOException
MxSwiftMessage(File)
java.io.IOException
public void updateFromXML(java.lang.String xml)
xml
- the XML content of an MX message containing the Document and optional AppHdr elementsupdateFromMessage()
public void updateFromXML(java.lang.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 java.lang.String getFunctionality()
public void setFunctionality(java.lang.String functionality)
public java.lang.String getVariant()
public void setVariant(java.lang.String variant)
public java.lang.String getVersion()
public void setVersion(java.lang.String version)
public boolean equals(java.lang.Object o)
equals
in class AbstractSwiftMessage
public int hashCode()
hashCode
in class AbstractSwiftMessage
public BusinessHeader getBusinessHeader()
MxParser.parseBusinessHeader()
@Deprecated @ProwideDeprecated(phase3=SRU2020) public ApplicationHeader getApplicationHeader()
getBusinessHeader()
@Deprecated @ProwideDeprecated(phase3=SRU2020) public void setApplicationHeader(ApplicationHeader applicationHeader)
getApplicationHeader()
public void copyTo(MxSwiftMessage msg)
msg
- target messageAbstractSwiftMessage.copyTo(AbstractSwiftMessage)
public java.lang.String toString()
toString
in class java.lang.Object
public static MxSwiftMessage fromJson(java.lang.String json)
AbstractSwiftMessage.toJson()
public MxId getMxId()