mil.navy.nps.dis
Class DataQueryPdu

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.DataQueryPdu
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class DataQueryPdu
extends SimulationManagementFamily

Simulation management PDU to request exercise data.

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/DataQueryPdu.java
or locally: ~/mil/navy/nps/dis/DataQueryPdu.java
Hierarchy Diagram:
Summary:
A request for data from an entity shall be communicated by issuing a Data Query PDU.
Note:
We have flatenned the Data Query Datum Specification Record for the moment. This might be changed in the future if we implement some other classes that need the same record. Also note that we have implemented the fixedDatumIDlist and the variableDatumIDlist as a vector.
History:
16Sep97 /Antonio Alexandre Rua /New
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
References:
DIS Data Dictionary :Data Query PDU
DIS-Java-VRML Working Group: http://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml/
DIS specification : IEEE 1278.1, Section 5.4.6.8, 4.4.5.4.8
See Also:
ProtocolDataUnit, PduElement, SerializationInterface

Field Summary
protected static DataQueryPdu exemplar
          An "exemplar" object, which is filled out to the state that is needed most of the time.
protected  java.util.Vector fixedDatumIDList
          List of fixed datums IDs.
protected  UnsignedInt requestID
          Request ID - This field shall identify the data query request being made by the Simulation Manager.
static int sizeOf
          Constant value--size of a PDU without header(fixed, counters + requestID + timeInterval).
protected  UnsignedInt timeInterval
          Time Interval - This field shall specify the time interval between issues of Data PDUs.
protected  java.util.Vector variableDatumIDList
          List of variable datums IDs.
 
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
DataQueryPdu()
          Default constructor--fills with zeros for all values.
 
Method Summary
 void addFixedDatumID(long pFixedDatumID)
          Adds a Fixed Datum ID at the end of the list.
 void addVariableDatumID(long pVariableDatumID)
          Inserts a Variable Datum ID at the end of the list.
 java.lang.Object clone()
          Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data.
 void deSerialize(java.io.DataInputStream inputStream)
          Deserialize our data from the input stream.
 void dropFixedDatumID()
          Suppress the current Fixed Datum ID list
 void dropVariableDatumID()
          Suppress the current Fixed Datum ID list
 long fixedDatumIDAt(int pIdx)
          Returns the Fixed Datum ID at the index given in parameter.
 int fixedDatumIDCount()
          Returns the size of the List of fixed datums IDs.
 DataQueryPdu getExemplar()
           
 UnsignedInt getRequestID()
           
 UnsignedInt getTimeInterval()
           
 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 setActionID(long pActionID)
           
 void setExemplar(DataQueryPdu newExemplar)
           
 void setRequestID(long pRequestID)
           
 long variableDatumIDAt(int pIdx)
          Returns the Variable Datum ID at the index given in parameter.
 int variableDatumIDCount()
          Returns the size of the List of Variable datums IDs.
 
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

requestID

protected UnsignedInt requestID
Request ID - This field shall identify the data query request being made 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


timeInterval

protected UnsignedInt timeInterval
Time Interval - This field shall specify the time interval between issues of Data PDUs.
Value:
A value of zero in this field shall mean that the requested data should be sent once and not at any previously specified time interval.
References:
DIS Data Dictionary: Time Stamp Field
DIS specification : IEEE 1278.1, 5.3.31


fixedDatumIDList

protected java.util.Vector fixedDatumIDList
List of fixed datums IDs.
References:
See section 7 in the EBV-DOC
DIS Data Dictionary: Datum ID Field


variableDatumIDList

protected java.util.Vector variableDatumIDList
List of variable datums IDs.
References:
See section 7 in the EBV-DOC
DIS Data Dictionary: Datum ID Field


sizeOf

public static final int sizeOf
Constant value--size of a PDU without header(fixed, counters + requestID + timeInterval). sizeOf = 16 bytes

See Also:
Constant Field Values

exemplar

protected static DataQueryPdu 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

DataQueryPdu

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

Method Detail

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

serialize

public void serialize(java.io.DataOutputStream outputStream)
Description copied from class: PduElement
Serialize our data out to the stream. Subclasses of us should call super.Serialize() to make sure the superclasse's data is serialized out. The order in which instance variables are serialized is significant. They must be serialized in the same order they appear in the DIS spec. Prints out some information during execution if debugging flag is set.

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

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
Description copied from class: PduElement
Deserialize our data from the input stream. Subclasses of us should call super.deSerialize to make sure the superclass's data are properly affected. The order in which instance variables are serialized is significant. They must be deSerialized in the same order as they have been serialized as specified by the DIS spec.

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

clone

public java.lang.Object clone()
Description copied from class: PduElement
Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data. The accessor methods make copies of the objects, rather than returning the objects themselves. The runtime provides the right object type with the call to super.clone(), and we cast it to our type. Subclasses should do the same thing, and all these ivars will be taken care of automatically.

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

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 DataQueryPdu getExemplar()

setExemplar

public void setExemplar(DataQueryPdu newExemplar)

getRequestID

public UnsignedInt getRequestID()

setRequestID

public void setRequestID(long pRequestID)

getTimeInterval

public UnsignedInt getTimeInterval()

setActionID

public void setActionID(long pActionID)

fixedDatumIDCount

public int fixedDatumIDCount()
Returns the size of the List of fixed datums IDs.

Returns:
the size of the List of fixed datums IDs

variableDatumIDCount

public int variableDatumIDCount()
Returns the size of the List of Variable datums IDs.

Returns:
the size of the List of Variable datums IDs

addFixedDatumID

public void addFixedDatumID(long pFixedDatumID)
Adds a Fixed Datum ID at the end of the list.

Parameters:
pFixedDatumID - the Fixed Datum ID to be inserted in the list

fixedDatumIDAt

public long fixedDatumIDAt(int pIdx)
Returns the Fixed Datum ID at the index given in parameter.

Parameters:
pIdx - the index of the Fixed Datum ID we want to obtain
Returns:
the the Fixed Datum ID pointed by the index in parameter

dropFixedDatumID

public void dropFixedDatumID()
Suppress the current Fixed Datum ID list


addVariableDatumID

public void addVariableDatumID(long pVariableDatumID)
Inserts a Variable Datum ID at the end of the list.

Parameters:
pVariableDatumID - the Variable Datum ID to be inserted in the list

variableDatumIDAt

public long variableDatumIDAt(int pIdx)
Returns the Variable Datum ID at the index given in parameter.

Parameters:
pIdx - the index of the Variable Datum ID we want to obtain
Returns:
the Variable Datum ID pointed by the index in parameter

dropVariableDatumID

public void dropVariableDatumID()
Suppress the current Fixed Datum ID list