Class LogPackager
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jpos.iso.packager.LogPackager
- All Implemented Interfaces:
ISOPackager, LogSource, ContentHandler, DTDHandler, EntityResolver, ErrorHandler
packs/unpacks ISOMsgs from jPOS logs
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXML attribute carrying the field number.static final StringXML element name for an ISO field.static final StringXML element name for an ISO message.static final StringXML element name for the outer log wrapper.protected LoggerLogger receiving pack/unpack diagnostic events.protected StringLogger realm associated with this packager.static final StringXML attribute identifying the field type (TYPE_BINARY,TYPE_BITMAP).static final StringField-type marker: hex-encoded binary value.static final StringField-type marker: bitmap value.static final StringXML attribute carrying the field value. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the packager and prepares its underlying SAX parser. -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new ISOMsg instance appropriate for this packager.voidendElement(String ns, String name, String qname) 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.Returns the Logger associated with this source.getRealm()Returns the log realm associated with this source.byte[]pack(ISOComponent c) Packs an ISO-8583 message into a byte array.voidAttaches aLoggerand realm to this log source.voidstartElement(String ns, String name, String qName, Attributes atts) intunpack(ISOComponent c, byte[] b) Unpacks an ISO-8583 byte array into the given message container.voidunpack(ISOComponent c, InputStream in) Unpacks an ISO-8583 message from an input stream into the given container.Methods inherited from class DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
declaration
-
Field Details
-
logger
-
realm
-
LOG_TAG
-
ISOMSG_TAG
-
ISOFIELD_TAG
-
ID_ATTR
-
VALUE_ATTR
-
TYPE_ATTR
XML attribute identifying the field type (TYPE_BINARY,TYPE_BITMAP).- See Also:
-
TYPE_BINARY
-
TYPE_BITMAP
-
-
Constructor Details
-
LogPackager
Constructs the packager and prepares its underlying SAX parser.- Throws:
ISOException- if the configured SAX parser cannot be instantiated
-
-
Method Details
-
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
-
unpack
Description copied from interface:ISOPackagerUnpacks an ISO-8583 byte array into the given message container.- Specified by:
unpackin interfaceISOPackager- Parameters:
c- 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:
c- the containerin- the input stream- Throws:
ISOException- on unpacking errorIOException- on I/O failure
-
startElement
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
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
-
setLogger
-
getRealm
-
getLogger
-
createISOMsg
Description copied from interface:ISOPackagerCreates and returns a new ISOMsg instance appropriate for this packager.- Specified by:
createISOMsgin interfaceISOPackager- Returns:
- a new ISOMsg
-