Formatting Messages in Java to Communicate with Legacy Systems, Part 2 North Dakota

We conclude this tutorial with with more on the BuildMsg.processRequest() and BuildMsg.getMsg() methods, and generating an EBCDIC byte stream using "cp500" encoding.

Local Companies

PCs For Parents
800-998-8652
1506 16th St S
Fargo, ND
Atlas Business Solutions, inc. (ABS)
800-874-8801
3330 Fiechtner Drive SW
Fargo, ND
Martech Media
(701) 462-3525
611 Main St
Washburn, ND
Independent Consulting
(701) 677-4227
609 Pheasant Dr
South Heart, ND
D F C Consultants Ltd
(701) 483-6872
100 S State Ave
Dickinson, ND
Intelligent InSites
(701) 893-2080
102 Broadway
Fargo, ND
Atlas Business Solutions
701-235-5226
3330 Fietchner Dr.
Fargo, ND
Mini Computer Services
(701) 725-4320
15700 19th Ave NW
Des Lacs, ND
Information Technologies Inc
(701) 258-9105
Bismarck, ND
Stratacom
(701) 232-8847
1316 23rd St S
Fargo, ND

provided by: 
Originally published at Internet.com


Introduction



In Part 1 of our tutorial, we began discussing how legacy systems usually expect messages in a rigid format, such as EBCDIC (Extended Binary Coded Decimal Interchange Code), and how such messages can be built in Java. Here in Part 2, we'll continue this discussion, with more detail on the BuildMsg.processRequest() and BuildMsg.getMsg() methods, and generating an EBCDIC byte stream using "cp500" encoding.

BuildMsg Class



The BuildMsg class has two critical methods namely processRequest() and getMsg(). The processRequest method constructs the message. The getMsg method returns the message as an EBCDIC byte array.
BuildMsg.processRequest() method


The processRequest method accepts a parameter of the type InputData and uses it to construct the message. The testMsg StringBuffer will hold the message that is built. The set methods for each data item return a string that is appended to the testMsg StringBuffer.

The set methods for each data item (like setDi1 ) will take care of the details of setting up that particular data item. They will also set a flag to indicate whether the data item exists. These flags are used by the method inpDiDefine.setPBitmapFromFlags() to set the bitmap. The bitmap for the message is built dynamically for every message based on the flags...

Read article at Internet.com site

Featured Local Company

Intelligent InSites

7018932080
102 Broadway
Fargo, ND


Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML