Main Page | Packages | Class Hierarchy | Compound List | Compound Members

de.stz.bt.fnd.FND_DatagramFactory Class Reference

List of all members.

Public Member Functions

FND_Datagram getNORMALDatagram ()
FND_Datagram getREJECTDatagram (FND_Datagram dgram)
FND_Datagram getERRORDatagram (FND_Datagram errDgram)
FND_Datagram getRSPDatagram (FND_Datagram dgram)
FND_Datagram getACKDatagram (FND_Datagram dgram)

Static Public Member Functions

FND_DatagramFactory getInstance ()

Detailed Description

The Datagram Factory is a Singleton that is used to get preformatted Datagram objects.

Author:
J. Seitter
Version:
$Id: FND_DataPointContext.java,v 1.2 2004/09/10 11:00:08 jseitter Exp $


Member Function Documentation

FND_Datagram de.stz.bt.fnd.FND_DatagramFactory.getACKDatagram FND_Datagram  dgram  ) 
 

Turns a given datagram into a Acknowledge datagram

Parameters:
the datagram to convert
Returns:
the converted datagram

00132                                                          {
00133 
00134     logger.debug("getACKDatagram()");
00135     FND_Datagram result = dgram;
00136     byte[] tc = result.getTransportControl();
00137     result.setTransportControl(FND_Datagram.D_R_ACK, tc[1], tc[2], tc[3]);
00138     setDateTime(result);
00139     result.setInfoCode((byte) 0x00, (byte) 0x00);
00140     return result;
00141   }

FND_DatagramFactory de.stz.bt.fnd.FND_DatagramFactory.getInstance  )  [static]
 

Returns:
The unique instance of this class.

00043                                                   {
00044     if (null == _instance) {
00045       _instance = new FND_DatagramFactory();
00046     }
00047     return _instance;
00048   }

FND_Datagram de.stz.bt.fnd.FND_DatagramFactory.getREJECTDatagram FND_Datagram  dgram  ) 
 

If a datagram has to be rejected, this method converts the received datagram into it's reject counterpart.

Parameters:
dgram the datagram that should be rejected
Returns:
the corrosponding REJECT datagram

00070                                                             {
00071 
00072     logger.debug("getREJECTDatagram()");
00073     byte[] tc = dgram.getTransportControl();
00074     if (tc[0] == FND_Datagram.D_R_CMD)
00075       tc[0] = FND_Datagram.D_R_RSP;
00076     if (tc[0] == FND_Datagram.D_R_USM)
00077       tc[0] = FND_Datagram.D_R_ACK;
00078     tc[1] = FND_Datagram.TAG_REJECT;
00079     //TODO: set an correct exc_1 and exc_2 code here
00080     dgram.setInfoCode((byte) 0x05, (byte) 0x00);
00081     dgram.setTransportControl(tc[0], tc[1], tc[2], tc[3]);
00082     return dgram;
00083   }

FND_Datagram de.stz.bt.fnd.FND_DatagramFactory.getRSPDatagram FND_Datagram  dgram  ) 
 

Turns a given datagram into a Response datagram

Parameters:
the datagram to convert
Returns:
the converted datagram

00116                                                          {
00117 
00118     logger.debug("getRSPDatagram()");
00119     FND_Datagram result = dgram;
00120     byte[] tc = result.getTransportControl();
00121     result.setTransportControl(FND_Datagram.D_R_RSP, tc[1], tc[2], tc[3]);
00122     setDateTime(result);
00123     result.setInfoCode((byte) 0x00, (byte) 0x00);
00124     return result;
00125   }


The documentation for this class was generated from the following file:
Generated on Mon Nov 15 08:36:09 2004 for FND4J by doxygen 1.3.3