gov.nasa.gsfc.drl.rtstps.core.ccsds.path
Class PacketPipeline

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.RtStpsNode
      extended by gov.nasa.gsfc.drl.rtstps.core.ccsds.path.PacketPipeline
All Implemented Interfaces:
PacketReceiver, Receiver, Sender, java.lang.Cloneable

public class PacketPipeline
extends RtStpsNode
implements PacketReceiver, Sender, java.lang.Cloneable

This class handles a packet stream usually for one application id. Its primary functions are to count status, check packet lengths, and check the sequence counter.


Nested Class Summary
(package private)  class PacketPipeline.Sequencer
          This class maintains the packet sequence count.
static class PacketPipeline.Setup
           
 
Field Summary
private  LongStatusItem badLengthSample
           
static java.lang.String CLASSNAME
          This is a class name for this STPS node type, which is also the element name.
private  LongStatusItem discardedPackets
           
private  LongStatusItem invalidLengthPackets
           
private  LongStatusItem missingPackets
           
private  PacketReceiver output
           
private  LongStatusItem packetsOut
           
private  LongStatusItem packetsWithFill
           
private  PacketOutputTool potool
           
private static int SEQUENCE_MASK
           
private  LongStatusItem sequenceErrors
           
private  PacketPipeline.Sequencer sequencer
           
private  PacketPipeline.Setup setup
           
private static int UNINITIALIZED
           
 
Fields inherited from class gov.nasa.gsfc.drl.rtstps.core.RtStpsNode
linkName, statusItemList, typeName
 
Constructor Summary
PacketPipeline()
          Create a PacketPipeline object.
 
Method Summary
 void addReceiver(Receiver r)
          Add a Receiver to this sender's list of receivers.
 void finishSetup(Configuration configuration)
          Finish the setup.
 void flush()
          Flush the pipeline.
 void load(org.w3c.dom.Element element, Configuration configuration)
          Set up this stps node with a configuration.
 void putPacket(Packet packet)
          Give a packet to this PacketReceiver.
 void putPackets(Packet[] packets)
          Give an array of packets to this PacketReceiver.
 
Methods inherited from class gov.nasa.gsfc.drl.rtstps.core.RtStpsNode
clear, clone, getElementName, getLinkName, getStatusItems, setLinkName, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.gsfc.drl.rtstps.core.ccsds.PacketReceiver
getLinkName
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
This is a class name for this STPS node type, which is also the element name. It is not necessarily the link name, which is the name of one particular object.

See Also:
Constant Field Values

setup

private PacketPipeline.Setup setup

sequencer

private PacketPipeline.Sequencer sequencer

output

private PacketReceiver output

potool

private PacketOutputTool potool

packetsOut

private LongStatusItem packetsOut

discardedPackets

private LongStatusItem discardedPackets

invalidLengthPackets

private LongStatusItem invalidLengthPackets

missingPackets

private LongStatusItem missingPackets

packetsWithFill

private LongStatusItem packetsWithFill

sequenceErrors

private LongStatusItem sequenceErrors

badLengthSample

private LongStatusItem badLengthSample

UNINITIALIZED

private static final int UNINITIALIZED
See Also:
Constant Field Values

SEQUENCE_MASK

private static final int SEQUENCE_MASK
See Also:
Constant Field Values
Constructor Detail

PacketPipeline

public PacketPipeline()
Create a PacketPipeline object.

Method Detail

load

public void load(org.w3c.dom.Element element,
                 Configuration configuration)
          throws RtStpsException
Set up this stps node with a configuration.

Specified by:
load in class RtStpsNode
Throws:
RtStpsException

addReceiver

public void addReceiver(Receiver r)
                 throws RtStpsException
Add a Receiver to this sender's list of receivers.

Specified by:
addReceiver in interface Sender
Parameters:
r - If the receiver is not of the expected type, then the method throws an StpsException.
Throws:
RtStpsException

finishSetup

public void finishSetup(Configuration configuration)
                 throws RtStpsException
Finish the setup. When this method is called, you may assume all nodes have been created and exist by name in the map, and all standard links have been resolved. This is a last chance to prepare for data flow.

Specified by:
finishSetup in class RtStpsNode
Throws:
RtStpsException

putPackets

public void putPackets(Packet[] packets)
                throws RtStpsException
Give an array of packets to this PacketReceiver.

Specified by:
putPackets in interface PacketReceiver
Throws:
RtStpsException

putPacket

public void putPacket(Packet packet)
               throws RtStpsException
Give a packet to this PacketReceiver.

Specified by:
putPacket in interface PacketReceiver
Throws:
RtStpsException

flush

public void flush()
           throws RtStpsException
Flush the pipeline.

Specified by:
flush in interface PacketReceiver
Specified by:
flush in interface Receiver
Throws:
RtStpsException