public class MtSwiftMessage extends AbstractSwiftMessage
identifier, PROPERTY_NAME, receiver, sender
Constructor and Description |
---|
MtSwiftMessage() |
MtSwiftMessage(File file)
Creates a new message reading the message the content from a file.
|
MtSwiftMessage(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
MtSwiftMessage(String fin)
Creates a new message reading the message the content from a string.
|
MtSwiftMessage(SwiftMessage model)
Creates an MtSwiftMessage from a SwiftMessage.
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(MtSwiftMessage msg)
copies attributes from this object to the given object
non inherited copied attributes:
mir
modelMessage
mur
pde
pdm
uuid
|
boolean |
equals(Object obj) |
String |
getMessageName()
Get the value of the property under the
AbstractSwiftMessage.PROPERTY_NAME key or the result of getMessageType() |
String |
getMessageType()
Get the message type.
For MTs this is the MT type number present in the identifier attribute. |
Integer |
getMessageTypeInt()
Get the integer value of the
getMessageType()
or null if the identifier attribute is not set or not a number |
String |
getMir() |
SwiftMessage |
getModelMessage()
Deprecated.
the internal model message is no longer user to avoid inconsistencies
between the raw format and the parsed data.
|
String |
getMur() |
String |
getPde() |
String |
getPdm() |
String |
getUuid() |
int |
hashCode() |
boolean |
isType(int type)
Test if this message is a given specific type.
|
boolean |
isType(Integer... type)
Tell if this message is any of the given types.
|
static MtSwiftMessage |
parse(File file)
Creates a new message reading the message the content from a file.
|
static MtSwiftMessage |
parse(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
static MtSwiftMessage |
parse(String fin)
Creates a new message reading the message the content from a string.
|
MtSwiftMessage |
readFile(File file)
Deprecated.
use the constructor
MtSwiftMessage(File) instead |
void |
setMir(String mir) |
void |
setModelMessage(SwiftMessage modelMessage)
Deprecated.
the internal model message is no longer user to avoid inconsistencies
between the raw format and the parsed data.
use
updateFromModel() |
void |
setMur(String mur) |
void |
setPde(String pde) |
void |
setPdm(String pdm) |
void |
setUuid(String uuid) |
String |
toString() |
void |
updateFromFIN()
Updates the derived attributes from the current raw (FIN) message attribute.
|
void |
updateFromFIN(String fin)
Updates the the attributes with the raw message and its metadata from the given raw (FIN) message content.
|
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()
Deprecated.
use update from string or constructor from String, File or InputStream instead,
the internal model message is no longer user to avoid inconsistencies
between the raw format and the parsed data.
|
void |
updateFromModel(AbstractMT mt)
The AbstractMT is serialized to its FIN raw format to set the internal raw message attribute.
|
void |
updateFromModel(SwiftMessage model)
The SwiftMessage is serialized to its FIN raw format to set the internal raw message attribute.
|
addNote, addRevision, addStatus, contains, contains, copyTo, createRevision, findStatusInfo, getChecksum, getCreationDate, getDirection, getFileFormat, getFilename, getId, getIdentifier, getLastData, getLastData, getLastModified, getMessage, getNotes, getPaddedId, getPreviousStatusInfo, getProperties, getProperty, getProperty, getPropertyBoolean, getPropertyBoolean, getReceiver, getReference, getRevisions, getSender, getStatus, getStatusInfo, getStatusTrail, isIncoming, isInput, isMT, isMX, isOutgoing, isOutput, isStatus, isStatus, isStatus, isStatus, match, message, messageStandardType, sanityCheckProperties, setChecksum, setCreationDate, setDirection, setFileFormat, setFilename, setId, setIdentifier, setLastModified, setMessage, setNotes, setProperties, setProperty, setProperty, setReceiver, setReference, setRevisions, setSender, setStatus, setStatus, setStatusTrail
public MtSwiftMessage()
public MtSwiftMessage(String fin)
FileFormat.FIN
public MtSwiftMessage(InputStream stream) throws IOException
FileFormat.FIN
IOException
MtSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(InputStream)
public MtSwiftMessage(File file) throws IOException
FileFormat.FIN
IOException
MtSwiftMessage(String)
,
AbstractSwiftMessage.AbstractSwiftMessage(File)
public MtSwiftMessage(SwiftMessage model)
updateFromModel()
public static MtSwiftMessage parse(String fin)
MtSwiftMessage(String)
public static MtSwiftMessage parse(InputStream stream) throws IOException
MtSwiftMessage(InputStream)
IOException
public static MtSwiftMessage parse(File file) throws IOException
MtSwiftMessage(File)
IOException
protected void updateFromMessage() throws IllegalArgumentException
AbstractSwiftMessage
updateFromMessage
in class AbstractSwiftMessage
IllegalArgumentException
- if the source format is not FileFormat.FIN
or if the message cannot be parsed into a MtSwiftMessage
objectAbstractSwiftMessage.updateFromMessage()
public void updateFromFIN(String fin)
fin
- the new message contentupdateFromMessage()
public void updateFromFIN()
public void updateFromModel(SwiftMessage model)
public void updateFromModel(AbstractMT mt)
@Deprecated public void updateFromModel()
@Deprecated public SwiftMessage getModelMessage()
@Deprecated public void setModelMessage(SwiftMessage modelMessage)
updateFromModel()
public String getMessageType()
public Integer getMessageTypeInt()
getMessageType()
or null if the identifier attribute is not set or not a numberpublic String getMessageName()
AbstractSwiftMessage.PROPERTY_NAME
key or the result of getMessageType()
getMessageName
in class AbstractSwiftMessage
public boolean isType(Integer... type)
type
- a variable list of integers for testing to match as the current message typetrue
if the current message type is any of the integers given as parameters, and false
in any other casepublic boolean isType(int type)
type
- the message type given as int, to testtrue
if this message type is the type
given, or false
in any other casepublic String getPde()
public void setPde(String pde)
public String getPdm()
public void setPdm(String pdm)
public String getMir()
public void setMir(String mir)
public String getMur()
public void setMur(String mur)
public String getUuid()
public void setUuid(String uuid)
public int hashCode()
hashCode
in class AbstractSwiftMessage
public boolean equals(Object obj)
equals
in class AbstractSwiftMessage
@Deprecated public MtSwiftMessage readFile(File file) throws IOException
MtSwiftMessage(File)
insteadreadFile
in class AbstractSwiftMessage
IOException
public void copyTo(MtSwiftMessage msg)
msg
- AbstractSwiftMessage.copyTo(AbstractSwiftMessage)