public class ServiceMessage21 extends AbstractMT
m
Constructor and Description |
---|
ServiceMessage21(java.io.File file)
Creates a new ServiceMessage21 by parsing a file with the message content in its swift FIN format.
If the file content is null or cannot be parsed as a message, the internal message object will be initialized (blocks will be created) but empty. If the file contains multiple messages, only the first one will be parsed. |
ServiceMessage21(java.io.InputStream stream)
Creates a new ServiceMessage21 by parsing a input stream with the message content in its swift FIN format, using "UTF-8" as encoding.
If the message content is null or cannot be parsed, the internal message object will be initialized (blocks will be created) but empty. If the stream contains multiple messages, only the first one will be parsed. |
ServiceMessage21(java.lang.String fin)
Creates a new ServiceMessage21 by parsing a String with the message content in its swift FIN format.
If the fin parameter is null or the message cannot be parsed, the internal message object will be initialized (blocks will be created) but empty. If the string contains multiple messages, only the first one will be parsed. |
ServiceMessage21(SwiftMessage aMessage) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorCode()
Returns the error code present in NAK messages in field 405
|
java.lang.String |
getErrorLine()
Returns the error line present in NAK messages in field 405
|
java.lang.String |
getMessageType()
Will always return null because service messages do not contain a message type.
|
boolean |
isAck()
Returns true if this message is an ACK (positive acknowledge).
|
boolean |
isNack()
Returns true if this message is an NACK (negative acknowledge).
|
static AbstractMT |
newInstance(SwiftMessage swiftMessage) |
static ServiceMessage21 |
parse(java.io.File file)
Creates a new ServiceMessage21 by parsing a file with the message content in its swift FIN format.
If the file contains multiple messages, only the first one will be parsed. |
static ServiceMessage21 |
parse(java.io.InputStream stream)
Creates a new ServiceMessage21 by parsing a input stream with the message content in its swift FIN format, using "UTF-8" as encoding.
If the stream contains multiple messages, only the first one will be parsed. |
static ServiceMessage21 |
parse(MtSwiftMessage m)
Creates an ServiceMessage21 initialized with the parameter MtSwiftMessage.
|
static ServiceMessage21 |
parse(java.lang.String fin)
Creates a new ServiceMessage21 by parsing a String with the message content in its swift FIN format.
If the file contains multiple messages, only the first one will be parsed. |
addField, append, append, append, containsSequence, containsSequenceList, create, create, fromJson, getApplicationId, getFields, getLogicalTerminal, getMessagePriority, getMtId, getReceiver, getSender, getSequence, getSequence, getSequence, getSequenceList, getSequenceList, getSequenceNumber, getServiceId, getSessionNumber, getSignature, getSwiftMessage, getSwiftMessageNotNullOrException, getVariant, isIncoming, isInput, isOutgoing, isOutput, isType, json, message, nameFromClass, read, setReceiver, setReceiver, setSender, setSender, setSignature, setSwiftMessage, tag, tags, toJson, toString, write, write, xml
getMessageStandardType, isMT, isMX
public ServiceMessage21(SwiftMessage aMessage)
aMessage
- java.lang.RuntimeException
- if the message is not a service message with service id 21 (meaning positive or negative acknowledge)public ServiceMessage21(java.io.InputStream stream) throws java.io.IOException
stream
- an input stream in UTF-8 encoding with the MT message in its FIN swift format.java.io.IOException
public ServiceMessage21(java.io.File file) throws java.io.IOException
file
- a file with the MT message in its FIN swift format.java.io.IOException
public ServiceMessage21(java.lang.String fin)
fin
- a string with the MT message in its FIN swift formatjava.lang.RuntimeException
- if the message is not a service message with service id 21 (meaning positive or negative acknowledge)public static AbstractMT newInstance(SwiftMessage swiftMessage)
swiftMessage
- java.lang.RuntimeException
- if the message is not a service message with service id 21 (meaning positive or negative acknowledge)public static ServiceMessage21 parse(MtSwiftMessage m)
m
- swift message with the ServiceMessage21 contentServiceMessage21(String)
public static ServiceMessage21 parse(java.io.InputStream stream) throws java.io.IOException
stream
- an input stream in UTF-8 encoding with the MT message in its FIN swift format.java.io.IOException
public static ServiceMessage21 parse(java.io.File file) throws java.io.IOException
file
- a file with the MT message in its FIN swift format.java.io.IOException
public static ServiceMessage21 parse(java.lang.String fin)
fin
- a string with the MT message in its FIN swift formatjava.lang.RuntimeException
- if the message is not a service message with service id 21 (meaning positive or negative acknowledge)public java.lang.String getMessageType()
getMessageType
in class AbstractMT
public final boolean isAck()
public final boolean isNack()
public java.lang.String getErrorCode()
public java.lang.String getErrorLine()