gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class StaticHeader

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.StaticHeader

public class StaticHeader
extends java.lang.Object

Implements the StaticHeader for the RawApplication area, this class can be used to either create the StaticHeader or read a pre-existing StaticHeader.


Field Summary
private  int apidListOffset
           
private  ApStorageArea apStorageArea
           
private  int apStorageOffset
           
private static int bufSize
           
private static byte[] data
           
private  int dataSet
           
private  long endBoundary
           
private static int HeaderSize
           
private  int nextPktPos
           
private  int numAppIds
           
private  int offset
           
private  int[] packetCount
           
private  java.util.List<Packet> packetList
           
private  int packetSizeSum
           
private  PacketTrackerList packetTracker
           
private  int pktTrackerOffset
           
private  RDRAppIdList rdrList
           
private  RDRName rdrName
           
private  SpacecraftId satellite
           
private  long startBoundary
           
 
Constructor Summary
StaticHeader(byte[] data)
          Used to parse out of a static header read in as part of reading a pre-existing HDF file.
StaticHeader(SpacecraftId satellite, RDRName rdrName, java.util.List<Packet> packetList)
          Create a static header from an input packet list, used to write to the HDF
 
Method Summary
 RandomAccessPacketReader createRandomAccessPacketReader()
          Create a RandomAccessPacketReader which allows the packet in a particular RawApplicationPackets area to be read out by random access using the information in the StaticHeader.
 SequentialPacketReader createSequentialPacketReader()
          Create a SequentialPacketReader which allows the packets in a particular RawApplicationPackets area to be read out sequentially using the information in the StaticHeader.
 int getAppIdListOffset()
          Return the AppIdList offset in the StaticHeader area
 int getApStorageOffset()
          Return the ApStorageOffset value
 byte[] getData()
          Return a pointer to the original input data used for reading out the contents of the StaticHeader read out of the RawApplicationPackets area.
 int getPacketStoreSize()
          Return the packet store size
 int getPktTrackerOffset()
          Return the packet tracker offset in the StaticHeader area
 int getSize()
          Return the size of the StaticHeader, the RDR list size, the packet tacker size and the packet store size itself
 int getTotalHeaderSize()
          Return the total size of the StaticHeader which is the fixed sized of the StaticHeader area plus the RDR list size and the packet tracker size.
 void write(int dataSet)
          Write from the various sources of input the StaticHeader and the packet storage area to the RawApplicationPackets based on the HDF DataSet handle.
private  void writeApidListOffset()
          Write the application ID list offset to the StaticHeader data buffer
private  void writeApStorageOffset()
          Write the ap storage offset to the StaticHeader data buffer
private  void writeEndBoundary()
          Write the end boundary to the StaticHeader data buffer
private  void writeNextPktPos()
          Write the next packet position to the StaticHeader data buffer
private  void writeNumAppIds()
          Write the number of application IDs to the StaticHeader data buffer
private  void writePktTrackerOffset()
          Write the packet tracker offset to the StaticHeader data buffer
private  void writeSatellite()
          Write the satellite name to the StaticHeader data buffer, converting it to ASCII first
private  void writeSensor()
          Write the sensor name to the StaticHeader data buffer, converting it to ASCII first
private  void writeStartBoundary()
          Write the start boundary to the StaticHeader data buffer
private  void writeToHDF()
          Write the entire filled out data buffer to the HDF file at the specified DataSet handle using the data buffer array
private  void writeTypeID()
          Write the type id name to the StaticHeader data buffer, converting it to ASCII first
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HeaderSize

private static final int HeaderSize
See Also:
Constant Field Values

numAppIds

private int numAppIds

apidListOffset

private int apidListOffset

pktTrackerOffset

private int pktTrackerOffset

apStorageOffset

private int apStorageOffset

nextPktPos

private int nextPktPos

startBoundary

private long startBoundary

endBoundary

private long endBoundary

rdrList

private RDRAppIdList rdrList

packetTracker

private PacketTrackerList packetTracker

apStorageArea

private ApStorageArea apStorageArea

dataSet

private int dataSet

packetSizeSum

private int packetSizeSum

satellite

private SpacecraftId satellite

rdrName

private RDRName rdrName

packetList

private java.util.List<Packet> packetList

data

private static byte[] data

offset

private int offset

packetCount

private int[] packetCount

bufSize

private static int bufSize
Constructor Detail

StaticHeader

public StaticHeader(SpacecraftId satellite,
                    RDRName rdrName,
                    java.util.List<Packet> packetList)
Create a static header from an input packet list, used to write to the HDF

Parameters:
satellite - the name of the satellite
rdrName - the RDR name
packetList - the list of packets that the static header needs to track that go into a particular RawApplicationPackets area

StaticHeader

public StaticHeader(byte[] data)
Used to parse out of a static header read in as part of reading a pre-existing HDF file. Note that the input data buffer has been read by some other entity and passed to this routine which cracks it apart.

Parameters:
data - containing the static header
Method Detail

createSequentialPacketReader

public SequentialPacketReader createSequentialPacketReader()
Create a SequentialPacketReader which allows the packets in a particular RawApplicationPackets area to be read out sequentially using the information in the StaticHeader.

Returns:
a SequentialPacketReader

createRandomAccessPacketReader

public RandomAccessPacketReader createRandomAccessPacketReader()
Create a RandomAccessPacketReader which allows the packet in a particular RawApplicationPackets area to be read out by random access using the information in the StaticHeader.

Returns:
a RandomAccessPacketReader

getData

public byte[] getData()
Return a pointer to the original input data used for reading out the contents of the StaticHeader read out of the RawApplicationPackets area.

Returns:
a byte array of the data

getApStorageOffset

public int getApStorageOffset()
Return the ApStorageOffset value

Returns:
the offset

getTotalHeaderSize

public int getTotalHeaderSize()
Return the total size of the StaticHeader which is the fixed sized of the StaticHeader area plus the RDR list size and the packet tracker size.

Returns:
the sum of the sizes

getPacketStoreSize

public int getPacketStoreSize()
Return the packet store size

Returns:
the size

getSize

public int getSize()
Return the size of the StaticHeader, the RDR list size, the packet tacker size and the packet store size itself

Returns:
the sum of all the sizes

getAppIdListOffset

public int getAppIdListOffset()
Return the AppIdList offset in the StaticHeader area

Returns:
the offset

getPktTrackerOffset

public int getPktTrackerOffset()
Return the packet tracker offset in the StaticHeader area

Returns:
the offset

write

public void write(int dataSet)
           throws RtStpsException
Write from the various sources of input the StaticHeader and the packet storage area to the RawApplicationPackets based on the HDF DataSet handle.

Parameters:
dataSet - the HDF handle to the RawApplicationPackets
Throws:
RtStpsException - wrapped HDF or other exceptions

writeSatellite

private void writeSatellite()
Write the satellite name to the StaticHeader data buffer, converting it to ASCII first


writeSensor

private void writeSensor()
Write the sensor name to the StaticHeader data buffer, converting it to ASCII first


writeTypeID

private void writeTypeID()
Write the type id name to the StaticHeader data buffer, converting it to ASCII first


writeNumAppIds

private void writeNumAppIds()
Write the number of application IDs to the StaticHeader data buffer


writeApidListOffset

private void writeApidListOffset()
Write the application ID list offset to the StaticHeader data buffer


writePktTrackerOffset

private void writePktTrackerOffset()
Write the packet tracker offset to the StaticHeader data buffer


writeApStorageOffset

private void writeApStorageOffset()
Write the ap storage offset to the StaticHeader data buffer


writeNextPktPos

private void writeNextPktPos()
Write the next packet position to the StaticHeader data buffer


writeStartBoundary

private void writeStartBoundary()
Write the start boundary to the StaticHeader data buffer


writeEndBoundary

private void writeEndBoundary()
Write the end boundary to the StaticHeader data buffer


writeToHDF

private void writeToHDF()
                 throws RtStpsException
Write the entire filled out data buffer to the HDF file at the specified DataSet handle using the data buffer array

Throws:
wraps - any HDF exceptions in an RtStpsException
RtStpsException