com.eurotech.framework.protocol.pcn
Class LogEntry

java.lang.Object
  extended by com.eurotech.framework.protocol.pcn.LogEntry
Direct Known Subclasses:
ErrStatsLogEntry, GpsLogEntry

public class LogEntry
extends Object

Defines Log entry.

Author:
ilya.binshtok

Constructor Summary
LogEntry()
          LogEntry default constructor.
LogEntry(String vehicleID, Calendar timestamp, String loggingPath, String publishTopic, int publishQoS)
          LogEntry constructor
 
Method Summary
 String formLogFilename()
          Forms an absolute path to a log filename.
protected  String generateHHMMSS()
          Generates time log in the form HHMMSS.
protected  String generateHHMMSS(Calendar calendar)
          Generates time log in the form HHMMSS.
protected  String generateYYYYMMDD()
          Generates date log in the form YYYYMMDD
protected  String generateYYYYMMDD(Calendar calendar)
          Generates date log in the form YYYYMMDD
 String getLoggingPath()
          Reports absolute logging path.
 int getPublishQoS()
          Reports publish QoS.
 String getPublishTopic()
          Reports publish topic.
 Calendar getTimestamp()
          Reports time stamp.
 String getVehicleID()
          Reports vehicle ID.
 boolean isPublished()
          Reports if log entry has been published
 void setLoggingPath(String loggingPath)
          Sets absolute logging path.
 void setPublished(boolean published)
          Sets 'published' flag
 void setTimestamp(Calendar timestamp)
          Sets time stamp
 void setVehicleID(String vehicleID)
          Sets vehicle ID.
 String toMQttPayload()
          Reports MQtt payload representation of this object
 String toString()
          Reports string representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogEntry

public LogEntry()
LogEntry default constructor.


LogEntry

public LogEntry(String vehicleID,
                Calendar timestamp,
                String loggingPath,
                String publishTopic,
                int publishQoS)
LogEntry constructor

Parameters:
vehicleID - - vehicle IS as String
timestamp - - time stamp as Calendar
loggingPath - - absolute logging path as String
publishTopic - - publish topic as String
publishQoS - - publish QoS as int
Method Detail

getVehicleID

public String getVehicleID()
Reports vehicle ID.

Returns:
vehicle ID as String

setVehicleID

public void setVehicleID(String vehicleID)
Sets vehicle ID.

Parameters:
vehicleID - - vehicle ID as String

getTimestamp

public Calendar getTimestamp()
Reports time stamp.

Returns:
time stamp as Calendar

getLoggingPath

public String getLoggingPath()
Reports absolute logging path.

Returns:
absolute logging path as String

setLoggingPath

public void setLoggingPath(String loggingPath)
Sets absolute logging path.

Parameters:
loggingPath - - absolute logging path as String

setTimestamp

public void setTimestamp(Calendar timestamp)
Sets time stamp

Parameters:
timestamp - - time stamp as Calendar

toString

public String toString()
Reports string representation of this object

Overrides:
toString in class Object
Returns:
string representation of this object as String

toMQttPayload

public String toMQttPayload()
Reports MQtt payload representation of this object

Returns:
MQtt payload representation of this object as String

formLogFilename

public String formLogFilename()
Forms an absolute path to a log filename.


isPublished

public boolean isPublished()
Reports if log entry has been published

Returns:
boolean

setPublished

public void setPublished(boolean published)
Sets 'published' flag

Parameters:
published - - 'published' flag as boolean

getPublishTopic

public String getPublishTopic()
Reports publish topic.

Returns:
publish topic as String

getPublishQoS

public int getPublishQoS()
Reports publish QoS.

Returns:
publish QoS as int

generateYYYYMMDD

protected String generateYYYYMMDD()
Generates date log in the form YYYYMMDD

Returns:
date log as String

generateYYYYMMDD

protected String generateYYYYMMDD(Calendar calendar)
Generates date log in the form YYYYMMDD

Parameters:
calendar - - time stamp as Calendar
Returns:
date log as String

generateHHMMSS

protected String generateHHMMSS()
Generates time log in the form HHMMSS.

Returns:
time log as

generateHHMMSS

protected String generateHHMMSS(Calendar calendar)
Generates time log in the form HHMMSS.

Parameters:
calendar - - time stamp as Calendar
Returns:
time log as


Copyright © 2013. All Rights Reserved.