gov.nasa.gsfc.drl.rtstps.core.ccsds
Class PacketOutputTool

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.ccsds.PacketOutputTool

public class PacketOutputTool
extends java.lang.Object

An STPS node that sends packets to receivers uses this utility to construct the output object. The utility disguises the fact that the output may be more than one receiver. It also guarantees that all receivers accept packets.


Field Summary
private  PacketBroadcaster broadcaster
           
private  java.lang.String name
           
private  PacketReceiver output
           
 
Constructor Summary
PacketOutputTool(java.lang.String name)
          Create the packet receiver tool.
 
Method Summary
 void addOutput(PacketReceiver r)
          Add a PacketReceiver object to the output list.
 void addReceiver(Receiver r)
          Add a receiver to the output list.
 PacketReceiver getOutput()
          Get the constructed packet receiver.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

output

private PacketReceiver output

broadcaster

private PacketBroadcaster broadcaster

name

private java.lang.String name
Constructor Detail

PacketOutputTool

public PacketOutputTool(java.lang.String name)
Create the packet receiver tool.

Parameters:
name - usually the client's name, used in error messages.
Method Detail

addOutput

public void addOutput(PacketReceiver r)
Add a PacketReceiver object to the output list.


addReceiver

public void addReceiver(Receiver r)
                 throws RtStpsException
Add a receiver to the output list.

Parameters:
r - If the receiver is not of the expected type, then the method throws an exception.
Throws:
RtStpsException

getOutput

public PacketReceiver getOutput()
Get the constructed packet receiver.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object