org.mbari.siam.distributed
Interface DeviceLogIF

All Known Subinterfaces:
FilteredDeviceLogIF
All Known Implementing Classes:
FilteredDeviceLog

public interface DeviceLogIF

DeviceLogIF is the interface for a DevicePacket logger

Author:
Bob Herlien
See Also:
DeviceLog

Method Summary
 void appendPacket(DevicePacket packet)
          This method appends the specified DevicePacket object to the log that is being maintained.
 void appendPacket(DevicePacket packet, boolean setSequenceNos, boolean checkTime)
          This method appends the specified DevicePacket object to the log that is being maintained.
 void close()
          Close the DeviceLog and associated files.
 long getDeviceId()
          returns the ISI deviceId associated with this DeviceLog
 long getLastMetadataRef()
          Return last metadata reference number.
 DevicePacket getLastPacket()
          Return the last sequential packet in the log.
 long getMaxTimestamp()
          returns the maximum key that has been registered by all DevicePacket storage operations
 long getMinTimestamp()
          returns the minimum key that has been registered by all DevicePacket storage operations
 DevicePacket getNextPacket()
          returns the next unread DevicePacket in sequential order.
 int getNumUnreadPackets()
          returns the number of unread packets remaining if packets are retrieved using the getNextPacket() method
 DevicePacketSet getPacketKeyRange(long startKey, long endKey, int maxEntries)
          Call getPacketKeyRange() - calls getPackets().
 DevicePacketSet getPackets(long startKey, long endKey, int maxEntries)
           
 int nPackets()
          Return total number of packets in log.
 

Method Detail

getLastMetadataRef

long getLastMetadataRef()
Return last metadata reference number.


getDeviceId

long getDeviceId()
returns the ISI deviceId associated with this DeviceLog


appendPacket

void appendPacket(DevicePacket packet,
                  boolean setSequenceNos,
                  boolean checkTime)
This method appends the specified DevicePacket object to the log that is being maintained. The object is serialized and subsequently written to a data file while indexing information is maintained. If argument setSequenceNos is set to 'true', then appendPacket() will automatically set the packet's sequence number and metadata reference.

Parameters:
packet - DevicePacket object to append to active log

appendPacket

void appendPacket(DevicePacket packet)
This method appends the specified DevicePacket object to the log that is being maintained. The object is serialized and subsequently written to a data file while indexing information is maintained. This version of appendPacket() will automatically set the packet's sequence number and metadata reference.

Parameters:
packet - DevicePacket object to append to active log

getPackets

DevicePacketSet getPackets(long startKey,
                           long endKey,
                           int maxEntries)
                           throws NoDataException
Throws:
NoDataException

getPacketKeyRange

DevicePacketSet getPacketKeyRange(long startKey,
                                  long endKey,
                                  int maxEntries)
                                  throws NoDataException
Call getPacketKeyRange() - calls getPackets(). getPacketKeyRange() is an obsolete method name, but we keep it for patch compatibility.

Throws:
NoDataException

getLastPacket

DevicePacket getLastPacket()
                           throws NoDataException
Return the last sequential packet in the log.

Returns:
last sequential packet in log (DevicePacket)
Throws:
NoDataException

getNextPacket

DevicePacket getNextPacket()
                           throws NoDataException
returns the next unread DevicePacket in sequential order.

Throws:
NoDataException
See Also:
DevicePacket

nPackets

int nPackets()
Return total number of packets in log.


getNumUnreadPackets

int getNumUnreadPackets()
returns the number of unread packets remaining if packets are retrieved using the getNextPacket() method

See Also:
getNextPacket()

getMinTimestamp

long getMinTimestamp()
returns the minimum key that has been registered by all DevicePacket storage operations

See Also:
DeviceLog.getPacketKeyRange(long, long, int)

getMaxTimestamp

long getMaxTimestamp()
returns the maximum key that has been registered by all DevicePacket storage operations

See Also:
DeviceLog.getPacketKeyRange(long, long, int)

close

void close()
           throws java.io.IOException
Close the DeviceLog and associated files. This DeviceLog instance is no longer usable after close() has been called.

Throws:
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.