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

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

Moody Dan
(207) 942-3448
Hampden, ME
Young Computing
(207) 354-7072
71 Meadow Ln
Cushing, ME
Menkin Frank Computer Consultant
(207) 257-4806
Plymouth, ME
Paradigm Technologies
(207) 680-2123
179 Main St Ste 402
Waterville, ME
C D I Inc
(207) 628-2842
Kingfield Rd N
New Portland, ME
Office Solutions ME
207-319-6045
Portland Rd
Gray, ME
Information Technology Integrators Inc
(207) 929-8247
53 Overlook Dr
Buxton, ME
Netmaine
(207) 780-6381
145 Newbury St
Portland, ME
Mason Associates Inc
(207) 347-3557
170 US Route 1 Ste 280
Falmouth, ME
Computer Software Consultants
(207) 947-1120
249 15th St
Bangor, ME

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

Office Solutions ME

207-319-6045
Portland Rd
Gray, ME

Related Local Events
Fitness Ball Workout
Dates: 5/7/2010 - 5/7/2009
Location: WALDO COUNTY GENERAL HOSPITAL'S EDUCATION CENTER
BELFAST, ME
View Details

Strong Women Workout
Dates: 12/17/2009 - 12/17/2009
Location: WALDO COUNTY GENERAL HOSPITAL'S EDUCATION CENTER
BELFAST, ME
View Details

Fitness Ball Workout
Dates: 12/10/2009 - 12/10/2009
Location: WALDO COUNTY GENERAL HOSPITAL'S EDUCATION CENTER
BELFAST, ME
View Details

Fitness Ball Workout
Dates: 12/8/2009 - 12/8/2009
Location: WALDO COUNTY GENERAL HOSPITAL'S EDUCATION CENTER
BELFAST, ME
View Details

Strong Women Workout
Dates: 12/1/2009 - 12/1/2009
Location: WALDO COUNTY GENERAL HOSPITAL'S EDUCATION CENTER
BELFAST, ME
View Details

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