is used to store the character delimiter and lists of MDRs. They are three
different sets of delimiters which can be
by application dynamically. Any MDR has to be added to GDSCache before
using it to decode or encode gds message.
maintains MDR lists: Permanent MDR List and Non-permanent MDR List. MDRs
in the permanent list can only
overwriten by the same version of MDRs. MDRs in the non-permanet list will
be automatically deleted for available
to accommodate new added MDRs. The maximum number of MDRs in the non-permanet
list should be set by
Otherwise default number 10 will be used. Application can also preload
MDRs permanently into Cache from
public static synchronized int addMDR(String mdrId, String mdrVer,
String mdrBuf, boolean permanent, boolean overWrite)
public static synchronized int addNonPermanentMDR(String mdrId,
String mdrVer, String mdrBuf, boolean overWrite)
public static synchronized int addPermanentMDR(String mdrId, String
mdrVer, String mdrBuf, boolean overWrite)
public synchronized static int loadMDRFromFile(String filePath,
public synchronized static int loadMDRFromURL(URL fileUrl, String
public static synchronized int setMaxNumOfMDRs(int num)
public synchronized static void setSystem(String sysName)
is responsible for parsing incoming GDS message and returning parsed
segments and elements to calling application.
can passes a GDS message in two ways:
allocMsg() - passes the whole complete message into the decoder. It
is recommended for small size message which is less than or equal to 5K.
resetPacket() and putPacket() - passes a packet of the packetized
message into the once a time until the last packet.It is recommended for
large size message which is more than 5K.
can get segments and elements in two ways:
getNextSeg() and getNextElem() - gets segments and elements in the
sequencial order which they are in the message.
These method can be called even during the process of putPacket
GDSError.GDS_MESSAGE_PREMATURE_END error returned, application
should continue to put packet before
call getNextSeg() or getNextElem() again.
getSegList() - This method is used to get the segment list with the
id and the nesting level is 0.This method should be called after the whole
message has been put into the decoder otherwise the segment list may be
public synchronized int allocMsg(String gdsString)
public synchronized String getMsgId()
public synchronized String getMsgVer()
public synchronized GDSSegValue getNextSeg()
public synchronized GDSElemValue getNextElem()
public synchronized GDSSegList getSegList(String segId)
public synchronized int resetPacket()
public synchronized int putPacket(String packet)
is responsible for taking segments and elements to build outgoing GDS
message. Application calls a seris of put
to put message id, version segments and elements for building a message.
can get the built message in two ways:
getMsg() - gets the whole message.
initPacket() and getPacket() - has the encoder to packetize the
message into packets with specified size ( Last packet
size may be less than the packet size.) and return one packet a
public synchronized int putMsgIdVer(String id, String ver)
public synchronized int putAction(String action)
public synchronized int putSeg(String segId, char segNestLevel)
public synchronized int putElem(String elemId, String value)
public synchronized int putCompElem(String compId, char nestLevel)
public synchronized int putCompEnd()
public synchronized String getMsg()
public synchronized int initPacket(int packetSize)
public synchronized String getPacket()