mil.navy.nps.dis
Class AcknowledgePdu

java.lang.Object
  extended bymil.navy.nps.dis.PduElement
      extended bymil.navy.nps.dis.ProtocolDataUnit
          extended bymil.navy.nps.dis.SimulationManagementFamily
              extended bymil.navy.nps.dis.AcknowledgePdu
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class AcknowledgePdu
extends SimulationManagementFamily

Simulation management PDU to acknowledge other simulation management PDUs.

Version:
1.0
Author:
Antonio Alexandre Rua (http://www.garfield.fe.up.pt/~alexrua)
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/AcknowledgePdu.java
or locally: ~/mil/navy/nps/dis/AcknowledgePdu.java
Hierarchy Diagram:
Summary:
The acknowledgment of the receipt of a Start/Resume PDU, Stop/Freeze PDU, Create Entity PDU, or a Remove Entity PDU shall be communicated by issuing an Acknowledge PDU.
Explanation:
As the other Simulation Manager Pdu, this PDU has two header section, the first one is inherited from the ProtocolDataUnit abstract class, the second from the SimulationManagementFamily abstract class. After That the PDU constains Acknowledge Flag, Response Flag and requestID fields. As with other things, the AcknowledgePdu has to know how to serialize and deserialize itself, clone itself, and print out its values.

History:
16Sep97 /Antonio Alexandre Rua /New
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
17Dec97 /Ronan Fauglas /bug fix changed sizeOf 40->32
References:
DIS Data Dictionary : Acknowledge PDU
DIS-Java-VRML Working Group: http://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml/
DIS specification : IEEE 1278.1, Section 5.4.6.5, 4.4.5.4.5
See Section 7 in EBV-DOC
See Also:
ProtocolDataUnit, PduElement, SerializationInterface, CreateEntityPdu, RemoveEntityPdu, StartResumePdu, StopFreezePdu, AcknowledgePdu, ActionRequestPdu, ActionResponsePdu, DataQueryPdu, SetDataPdu, DataPdu, EventReportPdu, CommentPdu

Field Summary
protected  UnsignedShort acknowledgeFlag
          Acknowledge Flag - This field shall indicate what type of message has been acknowledged.
protected static AcknowledgePdu exemplar
          An "exemplar" object, which is filled out to the state that is needed most of the time.
protected  UnsignedInt requestID
          Request ID - This field shall identify the matching response to the specific a Start/Resume, Stop/Freeze, Create Entity, or Remove Entity PDU sent by the simulation manager.
protected  UnsignedShort responseFlag
          Reponse flag - This field shall indicate whether or not the receiving entity was able to comply with the request, and for what reason.
static int sizeOf
          Constant value--size of a full Acknowledge PDU with header.
 
Fields inherited from class mil.navy.nps.dis.SimulationManagementFamily
originatingEntityID, receivingEntityID
 
Fields inherited from class mil.navy.nps.dis.ProtocolDataUnit
DEBUG, exerciseID, pduType, protocolFamily, protocolVersion, timeReceived, timestamp
 
Constructor Summary
AcknowledgePdu()
          Default constructor--fills with zeros for all values.
 
Method Summary
 java.lang.Object clone()
          Clone the CommentPdu, being careful to not share any pointers between the new object and the old object.
 void deSerialize(java.io.DataInputStream inputStream)
          deserialize our data from the stream.
 UnsignedShort getAcknowledgeFlag()
           
 AcknowledgePdu getExemplar()
           
 UnsignedInt getRequestID()
           
 UnsignedShort getResponseFlag()
           
 int length()
          Returns the length of the PDU header.
 java.lang.String pduName()
          Returns the name of this PDU
 void printValues(int indentLevel, java.io.PrintStream printStream)
          Prints the generated serialized object for debugging.
 void serialize(java.io.DataOutputStream outputStream)
          Serialize our data out to the stream.
 void setAcknowledgeFlag(int pAcknowledgeFlag)
           
 void setAcknowledgeFlag(UnsignedShort pAcknowledgeFlag)
           
 void setExemplar(AcknowledgePdu newExemplar)
           
 void setRequestID(int pRequestID)
           
 void setRequestID(UnsignedInt pRequestID)
           
 void setResponseFlag(int pResponseFlag)
           
 void setResponseFlag(UnsignedShort pResponseFlag)
           
 
Methods inherited from class mil.navy.nps.dis.SimulationManagementFamily
getOriginatingEntityID, getReceivingEntityID, setOriginatingEntityID, setReceivingEntityID
 
Methods inherited from class mil.navy.nps.dis.ProtocolDataUnit
byteArrayToPdu, datagramToPdu, debug, getExerciseID, getPaddingOfLength, getPduType, getProtocolFamily, getProtocolVersion, getRtpHeaderEnabled, getTimeReceived, getTimestamp, getVRMLTimestamp, makeTimestampCurrent, setExerciseID, setExerciseID, setPduType, setPduType, setProtocolFamily, setProtocolFamily, setProtocolVersion, setProtocolVersion, setRtpHeaderEnabled, setSimulationStartTime, setTimeReceived, setTimestamp, setTimestamp, stampTimeReceived, toString, trace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

acknowledgeFlag

protected UnsignedShort acknowledgeFlag
Acknowledge Flag - This field shall indicate what type of message has been acknowledged.
Value:
Enumeration, see references below for values.
References:
DIS Data Dictionary: Acknowledge Flag Field
See Section 7 in EBV-DOC


responseFlag

protected UnsignedShort responseFlag
Reponse flag - This field shall indicate whether or not the receiving entity was able to comply with the request, and for what reason.
Value:
Enumeration, see references below for values.
References:
DIS Data Dictionary: Response Flag Field
See Section 7 in EBV-DOC


requestID

protected UnsignedInt requestID
Request ID - This field shall identify the matching response to the specific a Start/Resume, Stop/Freeze, Create Entity, or Remove Entity PDU sent by the simulation manager.
Value:
A 32-bit monotonically increasing integer identifier inserted by the Simulation Manager into all Simulation Manager PDUs.
References:
DIS Data Dictionary: Request ID Field


sizeOf

public static final int sizeOf
Constant value--size of a full Acknowledge PDU with header. sizeOf = 32 bytes

See Also:
Constant Field Values

exemplar

protected static AcknowledgePdu exemplar
An "exemplar" object, which is filled out to the state that is needed most of the time.
Explanation
A brand new object has to have most of its values set, such as the forceID, protocol version, and so on. This lets the user fill out most of the values, save it in the class, then retrieve a copy of it as needed.

Constructor Detail

AcknowledgePdu

public AcknowledgePdu()
Default constructor--fills with zeros for all values.

Method Detail

serialize

public void serialize(java.io.DataOutputStream outputStream)
Serialize our data out to the stream. We first call the superclass, so that all the data there is written out to the buffer first. Then we serialize each of our ivars to the stream, being careful about the order.

Specified by:
serialize in interface SerializationInterface
Overrides:
serialize in class SimulationManagementFamily

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
deserialize our data from the stream. We first call the superclass, so that all the data there is read into the buffer first. Then we deserialize each of our ivars to the stream, being careful about the order.

Specified by:
deSerialize in interface SerializationInterface
Overrides:
deSerialize in class SimulationManagementFamily

clone

public java.lang.Object clone()
Clone the CommentPdu, being careful to not share any pointers between the new object and the old object.

Overrides:
clone in class SimulationManagementFamily

length

public int length()
Description copied from class: ProtocolDataUnit
Returns the length of the PDU header.

Overrides:
length in class SimulationManagementFamily

pduName

public java.lang.String pduName()
Description copied from class: SimulationManagementFamily
Returns the name of this PDU

Specified by:
pduName in class SimulationManagementFamily
Returns:
the name of this PDU

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Description copied from class: PduElement
Prints the generated serialized object for debugging.

Overrides:
printValues in class SimulationManagementFamily

getExemplar

public AcknowledgePdu getExemplar()

setExemplar

public void setExemplar(AcknowledgePdu newExemplar)

getAcknowledgeFlag

public UnsignedShort getAcknowledgeFlag()

setAcknowledgeFlag

public void setAcknowledgeFlag(UnsignedShort pAcknowledgeFlag)

setAcknowledgeFlag

public void setAcknowledgeFlag(int pAcknowledgeFlag)

getResponseFlag

public UnsignedShort getResponseFlag()

setResponseFlag

public void setResponseFlag(UnsignedShort pResponseFlag)

setResponseFlag

public void setResponseFlag(int pResponseFlag)

getRequestID

public UnsignedInt getRequestID()

setRequestID

public void setRequestID(UnsignedInt pRequestID)

setRequestID

public void setRequestID(int pRequestID)