gov.nasa.gsfc.drl.rtstps.server
Class StatusBlock

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.server.StatusBlock
All Implemented Interfaces:
java.io.Serializable

public class StatusBlock
extends java.lang.Object
implements java.io.Serializable

This class contains the status information for one RtStpsNode object. It is not created for those nodes that do not produce status. The core nodes do not use it directly. It is merely a container for transport to a RT-STPS status listener.

The status block has two labels: a type and a name. The type string is the node class name and corresponds to the XML element name. The name string is the name for a particular node instance and corresponds to the link name. The link name is always unique even across different types.

Types are predefined. "frame_sync", "frame_status", and "packet" are type examples. Names are user defined and correspond to the label attribute in most XML elements. They can be anything.

Some nodes have a single type and name. Those nodes are singletons. For example, "frame_status" is the type and name of the FrameStatus node.

Note that it is possible to create s status block that is not node based. The server itself creates a status block that contains state information.

See Also:
Serialized Form

Field Summary
private  java.lang.String name
          The RtStpsNode link name, which is also the XML label attribute.
private static long serialVersionUID
           
private  StatusItem[] statusItems
          A list of status items for this node.
private  java.lang.String type
          The RtStpsNode type or class name.
 
Constructor Summary
StatusBlock(RtStpsNode node)
          Create a StatusBlock from an RtStpsNode.
StatusBlock(java.lang.String btype, java.lang.String bname, StatusItem[] itemList)
          A constructor that is not node-based.
 
Method Summary
(package private)  void clear()
          Zero/clear the status items in this block.
 java.lang.String getName()
          Get the name string.
 StatusItem[] getStatusItems()
          Get the array of StatusItems.
 java.lang.String getType()
          Get the type string.
 java.lang.String toString()
          Gets a combined string consisting of the type and name separated by a dot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private java.lang.String type
The RtStpsNode type or class name. It is also the element tag name from the XML setup file.


name

private java.lang.String name
The RtStpsNode link name, which is also the XML label attribute. For singleton nodes such as "frame_sync", the type and name are the same.


statusItems

private StatusItem[] statusItems
A list of status items for this node. It should never be null or empty.


serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

StatusBlock

StatusBlock(RtStpsNode node)
Create a StatusBlock from an RtStpsNode.


StatusBlock

StatusBlock(java.lang.String btype,
            java.lang.String bname,
            StatusItem[] itemList)
A constructor that is not node-based.

Parameters:
btype - A type name that corresponds to an element name for RT-STPS node status blocks.
bname - A link name that corresponds to a link name for RT-STPS node status blocks.
itemList - A list of status items for this block.
Method Detail

getType

public final java.lang.String getType()
Get the type string. (the element tag)


getName

public final java.lang.String getName()
Get the name string. (the link name)


getStatusItems

public final StatusItem[] getStatusItems()
Get the array of StatusItems. It is never null or empty.


toString

public java.lang.String toString()
Gets a combined string consisting of the type and name separated by a dot. However, it returns just the type (or name, which is the same) if the node is a singleton.

Overrides:
toString in class java.lang.Object

clear

void clear()
Zero/clear the status items in this block. This is meaningful to the server only.