Transcription of jPOS Programmer’s Guide
1 jpos Programmer s GuideRevision: of ContentsCopyright notice .. viPreface .. vii1. The jpos Project .. About .. jpos License .. About ISO-8583 .. Downloading jpos .. Directory structure .. Using jpos .. Building jpos .. Available tasks .. Running jpos .. 52. About ISO-8583 .. An ISO-8583 primer .. International standard ISO 8583 .. Message format .. Wire protocol .. Message flow .. jpos approach to ISO-8583 .. ISOMsg & Co.. Packing and unpacking .. Creating custom packagers .. Managing the wire protocol with ISOC hannel .. Accepting connections with ISOS erver .. Multiplexing an ISOC hannel with a MUX .. IncomingListener .. 253. Support classes .. jpos ' Logger .. NameRegistrar .. Configuration .. SystemMonitor .. Profiler.
2 DirPoll .. ThreadPool .. 374. Packagers .. Implementing Custom Packagers .. GenericPackager .. 385. Channels .. TCP/IP Socket-based channels .. SSL Channels .. LoopbackChannel .. ChannelPool .. Channel Filters .. MD5 Filter .. ChannelInfoFilter .. DelayFilter .. DebugFilter .. ThroughputControlFilter .. BSHF ilter .. Aditional filters .. 476. jpos Space .. Space interface .. Local Space interface .. Space Factory .. TSpace .. JDBMS pace .. JESpace .. 52jPOS Programmer s SpaceInterceptor .. SpaceTap .. SpaceUtil .. 537. Q2 .. Running Q2 .. Command line options .. Embedding Q2 .. Shutting down Q2 .. Writing your first Q2 Script .. QTest - a sample QBean .. QBeanSupport.
3 Dynamic classloading .. 708. Q2 jpos Services .. ChannelAdaptor .. QBean descriptor .. Handling alternate connections .. Channel timeout, keep-alive, connection-timeout .. OneShotChannelAdaptor .. QBean descriptor .. QMUX .. QBean descriptor .. MTI mapping and default key .. QServer .. QBean descriptor .. 799. TransactionManager .. TransactionConstants .. Transaction Context .. Context Recovery Interface .. Assembly Line .. AbortParticipant .. GroupSelector .. TransactionManager implementation .. TM use of spaces .. Configuration .. TransactionStatusListener .. Transaction Participants .. Switch participant .. CheckFields participant .. SelectDestination .. QueryHost .. SendResponse .. JSParticipant .. Pause.
4 9810. ResultCode .. CMF .. Result holder class .. 101A. Getting involved .. 102B. License .. 103ivList of ISO-8583 message structure .. Sample 0800 message .. Primary Bitmap .. Another 0800 message .. Primary Bitmap .. Secondary Bitmap .. Sample authorization .. Authorization timeout .. Sample authorization request .. Sample authorization response .. ISOF ieldPackagers .. Sample ISOC hannel implementations .. IncomingListener Configuration Properties .. Logger s main classes .. LogListener .. NameRegistrar s prefix .. Space Names .. OneShotChannelAdaptor Attributes.. TransactionConstants .. AssemblyLine .. Switch participant Configuration Properties .. CheckFields Configuration Properties .. SelectDestination Configuration Properties.
5 QueryHost Configuration Properties .. SendResponse Configuration Properties .. 97vList of ISOC hannel example .. ISOS erver .. MUX example .. Profiler .. DirPoll Processor .. ISO-8583 version 1993 packager implementation .. ISO-8583 version 1993 packager configuration .. SocketFactory configuration .. Using the SpaceFactory .. Sample TSpace use .. Sample GroupSelector implementation .. jpos Team .. 102viCopyright noticeCopyright 1998-2017 by jpos Software SRL, Uruguay. All rights reserved. No part of this book may be reproduced in anyform or by any electronic or mechanical means, including information storage and retrieval systems, without permission inwriting from jpos Software SRL, except by a reviewer who may quote brief passages in a document covers jpos 1. The jpos About jpos project is hosted at In order to stay up-to-date with jpos news, you may want to visitthe project s main page, as well as its blog at For an up to date list of project resources, youcan visit the page.
6 There s also a low traffic jpos News mailing list where we postimportant announcements, such as a the availability of new versions of this Guide . You re encouraged to registerby visiting the project s main page at is hosted at may also want to follow us on Twitter, where we keep a list of users who regularly tweet about jpos at@apr/lists/ jpos [ ].In addition, you may want to subscribe to our users' mailing list [ ].Commit notifications can be tracked by following @jposcommits [ ].We are also active on Slack [ ]. Please request an invitation via e-mail to you happen to tweet about jpos , please use the hash tag # jpos so we can follow jpos LicensejPOS is distributed under the GNU Affero General Public License version NOTICEIf you don t plan to release your jpos based application under a compatible license (see FAQ [ ] where you can find a licensecompatibility matrix ) you need to buy a commercial license (you can contact us using the contactform [ ]).
7 About ISO-8583We assume the reader is familiar with the ISO-8583 starters, you can take a look at the Wikipedia ISO_8583 [ ] page andthe Section , An ISO-8583 primer of this document, but for any serious work you need to get a copy of thestandard from is a high level standard, and vendors have implemented it in slightly different ways. You also need theprotocol specifications for your particular you are starting a new payments application and you have full control over your spec, you may want toconsider using the ISO-8583 v2003 based jpos Common Message Format described in jpos -CMF is an open source project, you can get the DocBook sources in the jpos Githubreporitory at and modify it to fit your needs. This is an openspec, we expect institutions using it to get in touch with us in order to improve jpos Downloading jPOSThe community edition of jpos can be downloaded from the jpos Download [ ] Git repository is hosted at Github [ ]. The repository has many branches and you are dealing with a legacy jpos application, you want to use the master you are looking for older jpos versions, you can find them in the SourceForge [ ] repository, but please note all current development activity is taking place in the Github [ ] repository, Directory structurejPOS uses Gradle [ ] with a multi-module modules are defined in the file and listed below: jpos : this is the jpos system compat_1_5_2 : compatibility with older versionsYou ll find the jpos sources in the jpos /src directory.
8 |-- COPYRIGHT |-- CREDITS|-- LICENSE|-- |-- |-- ..|-- gradlew |-- |-- gradle| `-- wrapper| |-- | `-- |-- jpos | |-- | |-- src| | |-- main| | | |-- java| | |-- main| | | |-- resources| | |-- dist | | | |-- bin| | | | |-- bsh| | | | |-- q2| | | | |-- start| | | | `-- stop| | | |-- cfg| | | | |-- packager| | | | | |-- | | | | | |-- | | | | | |-- | | | |-- deploy| | | | |-- | | | | `-- | | | `-- log| | | `-- jpos Project3 Copyright noticeReadme file in markdown format shown in the Github [ ]
9 RepositoryMain Gradle configuration fileGradle s settings file, lists the modules to be compiled, in this case, jpos and is recommended that you install Gradle locally, but for a quick build, you can use the Gradle wrapper(gradlew in Unix, in Windows).Home for the jpos moduleTemplate for a production distribution directory with its deploy, cfg, bin and log directories|-- compat_1_5_2 | |-- | |-- | |-- src| | `-- main| | `-- java| | `-- org| | `-- jpos | | | `-- |-- legal | |-- | |-- |-- incoming ..Backward compatibility with version directory with contributor license agreementsContributed files not yet merged into jpos . Now with Git and pull requests, this directory will be removedat some you re dealing with a legacy jpos system, you probably don t want to use the Using jPOSYou don t have to build jpos in order to use it in your projects, although you are welcome to try and build it (seeSection , Building jpos ) for learning purposes or if you want to contribute to the produces Maven compatible poms and regularly publishes releases to Maven Central [ ].
10 If you want to use it from Maven, you can add this dependency to your pom:Here is a sample POM<dependency> <groupId> </groupId> <artifactId> jpos </artifactId> <version> </version> </dependency>or Gradle : stable release is , development release is uses the following dependency not available in Maven central, so you need to add the following repositoryThe jpos Project4 (required by Berkeley DB Java Edition)We publish SNAPSHOT daily builds ( version ) to the jpos Mavenrepository [ ] and stable releases to Maven Central. Please note thecompat_1_5_2 module is only published to jpos Maven you use Gradle, you can configure:repositories { mavenCentral() maven { url ' ' } maven { url ' ' } mavenLocal()}dependencies { compile : testCompile ' '}If you re building a jpos application, the easiest way is to clone the jpos Template [ ] project and take it from Building jPOSjPOS uses Gradle [ ] as its build system. For a quick build, you don t even need toinstall Gradle, you can use the handy gradlew (or if you re on Windows) Gradle wrapper thatautomatically downloads Gradle for you, but for daily development, it s a good idea to install it we mention the gradle command in this Guide , you can either use your locally installedGradle, or the gradlew wrapper scripts mentioned has the ability to run in background, dramatically reducing the load time.