de.stz.bt.fnd
Class FND_DatagramFactory

java.lang.Object
  extended byde.stz.bt.fnd.FND_DatagramFactory

public class FND_DatagramFactory
extends java.lang.Object

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

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

Field Summary
private static FND_DatagramFactory _instance
          A handle to the unique Singleton instance.
private static java.util.GregorianCalendar calendar
           
private static org.apache.log4j.Logger logger
           
 
Constructor Summary
FND_DatagramFactory()
           
 
Method Summary
 FND_Datagram getACKDatagram(FND_Datagram dgram)
          Turns a given datagram into a Acknowledge datagram
 FND_Datagram getERRORDatagram(FND_Datagram errDgram)
           
static FND_DatagramFactory getInstance()
           
 FND_Datagram getNORMALDatagram()
           
 FND_Datagram getREJECTDatagram(FND_Datagram dgram)
          If a datagram has to be rejected, this method converts the received datagram into it's reject counterpart.
 FND_Datagram getRSPDatagram(FND_Datagram dgram)
          Turns a given datagram into a Response datagram
private  void setDateTime(FND_Datagram dgram)
          Sets the timestamp on the given datagram to the current time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

calendar

private static java.util.GregorianCalendar calendar

logger

private static final org.apache.log4j.Logger logger

_instance

private static FND_DatagramFactory _instance
A handle to the unique Singleton instance.

Constructor Detail

FND_DatagramFactory

public FND_DatagramFactory()
Method Detail

getInstance

public static FND_DatagramFactory getInstance()
Returns:
The unique instance of this class.

getNORMALDatagram

public FND_Datagram getNORMALDatagram()

getREJECTDatagram

public FND_Datagram 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

getERRORDatagram

public FND_Datagram getERRORDatagram(FND_Datagram errDgram)

getRSPDatagram

public FND_Datagram getRSPDatagram(FND_Datagram dgram)
Turns a given datagram into a Response datagram

Returns:
the converted datagram

getACKDatagram

public FND_Datagram getACKDatagram(FND_Datagram dgram)
Turns a given datagram into a Acknowledge datagram

Returns:
the converted datagram

setDateTime

private void setDateTime(FND_Datagram dgram)
Sets the timestamp on the given datagram to the current time