Class VISA1Packager
java.lang.Object
org.jpos.util.SimpleLogSource
org.jpos.iso.packager.VISA1Packager
- All Implemented Interfaces:
ISOPackager, VISA1ResponseFilter, LogSource
ISO-8583 packager for the VISA-1 message format.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]ASCII Field Separator (0x1C) used between VISA1 sub-fields. -
Constructor Summary
ConstructorsConstructorDescriptionVISA1Packager(int[] sequence, int respField, String badResultCode, String okPattern) Constructs a VISA1Packager with the given field sequence and response-handling rules. -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new ISOMsg instance appropriate for this packager.Returns a human-readable description of this packager.getFieldDescription(ISOComponent m, int fldNumber) Emits a description of the field identified byfldnoin the given message to the log event.Inspectsresponseand returns the embedded authorization number, if any.protected intHandles the VISA1-specific encoding of field 35 (track-2 data with entry mode).byte[]pack(ISOComponent c) Packs an ISO-8583 message into a byte array.voidReplaces the VISA1 response filter used to inspect inbound responses.intunpack(ISOComponent m, byte[] b) Unpacks an ISO-8583 byte array into the given message container.voidunpack(ISOComponent m, InputStream in) Unpacks an ISO-8583 message from an input stream into the given container.Methods inherited from class SimpleLogSource
error, error, getLogger, getRealm, info, info, setLogger, setRealm, warning, warningModifier and TypeMethodDescriptionvoidLogs an error message.voidLogs an error message with an attached object.Returns the logger.getRealm()Returns the logging realm.voidLogs an informational message.voidLogs an informational message with an attached object.voidSets the logger and realm for this log source.voidSets the logging realm.voidLogs a warning message.voidLogs a warning message with an attached object.
-
Field Details
-
FS
ASCII Field Separator (0x1C) used between VISA1 sub-fields.
-
-
Constructor Details
-
VISA1Packager
Constructs a VISA1Packager with the given field sequence and response-handling rules.- Parameters:
sequence- array of fields that go to VISA1 requestrespField- where to put responsebadResultCode- (i.e. "05")okPattern- (i.e. "AUT. ")
-
-
Method Details
-
setVISA1ResponseFilter
Replaces the VISA1 response filter used to inspect inbound responses.- Parameters:
filter- the new response filter
-
handleSpecialField35
protected int handleSpecialField35(ISOMsg m, ByteArrayOutputStream bout) throws ISOException, IOException Handles the VISA1-specific encoding of field 35 (track-2 data with entry mode).- Parameters:
m- message being packedbout- destination byte stream- Returns:
- number of bytes written
- Throws:
ISOException- on field-access failureIOException- if writing toboutfails
-
pack
Description copied from interface:ISOPackagerPacks an ISO-8583 message into a byte array.- Specified by:
packin interfaceISOPackager- Parameters:
c- the Component to pack- Returns:
- Message image
- Throws:
ISOException- on packing error
-
guessAutNumber
Description copied from interface:VISA1ResponseFilterInspectsresponseand returns the embedded authorization number, if any.- Specified by:
guessAutNumberin interfaceVISA1ResponseFilter- Parameters:
s- raw VISA1 response payload- Returns:
- authorization number or null
-
unpack
Description copied from interface:ISOPackagerUnpacks an ISO-8583 byte array into the given message container.- Specified by:
unpackin interfaceISOPackager- Parameters:
m- the Container of this messageb- ISO message image- Returns:
- consumed bytes
- Throws:
ISOException- on unpacking error
-
unpack
Description copied from interface:ISOPackagerUnpacks an ISO-8583 message from an input stream into the given container.- Specified by:
unpackin interfaceISOPackager- Parameters:
m- the containerin- the input stream- Throws:
ISOException- on unpacking error
-
getFieldDescription
Description copied from interface:ISOPackagerEmits a description of the field identified byfldnoin the given message to the log event.- Specified by:
getFieldDescriptionin interfaceISOPackager- Parameters:
m- the Container (i.e. an ISOMsg)fldNumber- the Field Number- Returns:
- Field Description
-
getDescription
Description copied from interface:ISOPackagerReturns a human-readable description of this packager.- Specified by:
getDescriptionin interfaceISOPackager- Returns:
- Packager's Description
-
createISOMsg
Description copied from interface:ISOPackagerCreates and returns a new ISOMsg instance appropriate for this packager.- Specified by:
createISOMsgin interfaceISOPackager- Returns:
- a new ISOMsg
-