Class PackagerWrapper
java.lang.Object
org.jpos.iso.packager.PackagerWrapper
- All Implemented Interfaces:
Configurable, ISOPackager, LogSource
public abstract class PackagerWrapper
extends Object
implements ISOPackager, LogSource, Configurable
Wrapper on standard packager
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurationConfiguration applied to this wrapper (and propagated to the inner packager when configurable).protected LoggerLogger receiving wrapped pack/unpack diagnostic events.protected StringLogger realm associated with this packager.protected ISOPackagerUnderlying packager that this wrapper delegates to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFieldDescription(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.Returns the underlying packager.getRealm()Returns the log realm associated with this source.abstract byte[]pack(ISOComponent c) Packs an ISO-8583 message into a byte array.voidrequiresinner-packagerpropertyvoidAttaches aLoggerand realm to this log source.voidsetPackager(ISOPackager packger) Replaces the underlying packager.abstract intunpack(ISOComponent c, byte[] b) Unpacks an ISO-8583 byte array into the given message container.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISOPackager
createISOMsg, getDescription, unpackModifier and TypeMethodDescriptionCreates and returns a new ISOMsg instance appropriate for this packager.Returns a human-readable description of this packager.voidunpack(ISOComponent m, InputStream in) Unpacks an ISO-8583 message from an input stream into the given container.
-
Field Details
-
logger
-
realm
-
standardPackager
Underlying packager that this wrapper delegates to. -
cfg
Configuration applied to this wrapper (and propagated to the inner packager when configurable).
-
-
Constructor Details
-
PackagerWrapper
public PackagerWrapper()Default constructor.
-
-
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
-
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
-
setPackager
Replaces the underlying packager.- Parameters:
packger- inner packager to delegate to
-
getPackager
Returns the underlying packager.- Returns:
- the inner packager, or
nullif none is configured
-
setLogger
-
getRealm
-
getLogger
-
setConfiguration
requiresinner-packagerproperty- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object- Throws:
ConfigurationException- if configuration is invalid
-