grs.pds.edr
Class MsgEdrRecord

java.lang.Object
  |
  +--grs.pds.BasePdsRecord
        |
        +--grs.pds.TimeSeriesRecord
              |
              +--grs.pds.edr.MsgEdrRecord
All Implemented Interfaces:
PdsRecord

public class MsgEdrRecord
extends TimeSeriesRecord

Message data, sent from the GRS CEB. Usually generated from command completions. Also includes CEB error messages.

Version:
$Revision: 1.4 $
Author:
$Author: guym $

Field Summary
 byte counter
           
 String message_text
           
 short msg_id
           
 int ody_orbit
           
 int orbit
           
 byte origin
           
 int pixel
           
 long sc_recv_time
           
 Date utc
           
 
Fields inherited from class grs.pds.BasePdsRecord
PdsTimeFormat
 
Fields inherited from interface grs.pds.PdsRecord
GAMMA_CHANNELS, int10, int12, int2, int3, logger, MESSAGE_LENGTH, NS_MAX_EVENTS, PEF_COMMANDS, prec10, prec12, prec13, prec14, prec15, prec16, prec17, prec5, prec6, prec7, PROFILE_LENGTH, PROFILE_SIZE, PULSER_CHANNELS, QUERY_DATE_FMT, SC_ID
 
Constructor Summary
MsgEdrRecord(DataInputStream in)
          Read msg record from DataInputStream.
MsgEdrRecord(ResultSet rs)
          Read record in from ResultSet.
 
Method Summary
static String[] createInsertString(String schema)
          create SQL Query to insert message records.
static String[] createSelectString(String schema)
          create SQL Query to select message records.
 long getSCLK()
          Get the Date (time) of record.
 Date getUTC()
          Get the UTC time that this record was observed on.
static void main(String[] args)
          Demonstrates use of this class to parse an Msg EDR record.
 int prepareInsert(PreparedStatement pstmt)
          Bind values to the PreparedStatement
 String[] toStringArray()
          Display message record.
 void writeTo(DataOutputStream out)
          Write this record to a DataOutputStream.
 
Methods inherited from class grs.pds.BasePdsRecord
endianSwapShort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sc_recv_time

public long sc_recv_time

utc

public Date utc

msg_id

public short msg_id

pixel

public int pixel

orbit

public int orbit

ody_orbit

public int ody_orbit

counter

public byte counter

origin

public byte origin

message_text

public String message_text
Constructor Detail

MsgEdrRecord

public MsgEdrRecord(ResultSet rs)
             throws SQLException
Read record in from ResultSet.

Parameters:
rs - ResultSet to read from.
Throws:
SQLException - Error reading from result set.

MsgEdrRecord

public MsgEdrRecord(DataInputStream in)
             throws ParseException,
                    IOException
Read msg record from DataInputStream.

Parameters:
in - Stream to read from.
Throws:
IOException - error reading from stream.
ParseException - UTC date in stream is in invalid format.
Method Detail

createSelectString

public static String[] createSelectString(String schema)
create SQL Query to select message records.

Parameters:
schema - DB Schema to use.
Returns:
SQL query array.

createInsertString

public static String[] createInsertString(String schema)
create SQL Query to insert message records.

Parameters:
schema - DB Schema to use.
Returns:
SQL query array.

prepareInsert

public int prepareInsert(PreparedStatement pstmt)
                  throws SQLException
Bind values to the PreparedStatement

Specified by:
prepareInsert in class BasePdsRecord
Parameters:
pstmt - prepared statement
Returns:
number of values bound
Throws:
SQLException - Error in binding binding

writeTo

public void writeTo(DataOutputStream out)
             throws IOException
Write this record to a DataOutputStream. Will use a PrintStream internally to write the characters.

Specified by:
writeTo in class BasePdsRecord
Parameters:
out - Stream to write to.
Throws:
IOException - Error writing to stream.

toStringArray

public String[] toStringArray()
Display message record.

Specified by:
toStringArray in class BasePdsRecord
Returns:
Fields and values of this record.

getSCLK

public long getSCLK()
Get the Date (time) of record.

Specified by:
getSCLK in class TimeSeriesRecord
Returns:
Date

getUTC

public Date getUTC()
Description copied from class: TimeSeriesRecord
Get the UTC time that this record was observed on.

Specified by:
getUTC in class TimeSeriesRecord
Returns:
UTC.

main

public static final void main(String[] args)
Demonstrates use of this class to parse an Msg EDR record.

Parameters:
args - Filename


2001 Mars Odyssey Gamma Ray Spectrometer Team