pl.edu.agh.cast.data.logging
Class FileRawDataLogger

java.lang.Object
  extended by pl.edu.agh.cast.data.logging.FileRawDataLogger
All Implemented Interfaces:
IRawDataObserver

public class FileRawDataLogger
extends Object
implements IRawDataObserver

An observer which logs events to file.

Author:
AGH CAST Team

Constructor Summary
FileRawDataLogger()
           
 
Method Summary
 void finish(String projectLocation, String dataSetId)
          Writes the content of the buffer into the log file logFilePath.
static String generateLogFilePath(String projectLocation, String dataSetId)
          Generates a path to a log file for the current project location and data set id.
 void initialize(String importedFilePath, String templateName)
          Logs the start of the import operation into the buffer.
static boolean logFileExists(String projectLocation, String dateSetId)
          Checks whether a log file for the current project location and data set id already exists.
 void notifyRemoved(DataRow row)
          Notifies when row is removed.
 void notifyRestored(DataRow row)
          Notifies when row is restored.
 void notifyValueChanged(DataRow row, String oldValue, String newValue)
          Notifies when new value is set in specified row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRawDataLogger

public FileRawDataLogger()
Method Detail

finish

public void finish(String projectLocation,
                   String dataSetId)
Writes the content of the buffer into the log file logFilePath.

Parameters:
projectLocation - the location of the project
dataSetId - the id of the data set

initialize

public void initialize(String importedFilePath,
                       String templateName)
Logs the start of the import operation into the buffer.

Parameters:
importedFilePath - the path to the imported file
templateName - the template name used by the import operation

notifyRemoved

public void notifyRemoved(DataRow row)
Notifies when row is removed.

Specified by:
notifyRemoved in interface IRawDataObserver
Parameters:
row - row which is removed
See Also:
IRawDataObserver.notifyRemoved(pl.edu.agh.cast.rawdata.DataRow)

notifyRestored

public void notifyRestored(DataRow row)
Notifies when row is restored.

Specified by:
notifyRestored in interface IRawDataObserver
Parameters:
row - row which is restored
See Also:
IRawDataObserver.notifyRestored(pl.edu.agh.cast.rawdata.DataRow)

notifyValueChanged

public void notifyValueChanged(DataRow row,
                               String oldValue,
                               String newValue)
Notifies when new value is set in specified row.

Specified by:
notifyValueChanged in interface IRawDataObserver
Parameters:
row - row which is edited
oldValue - old value
newValue - new value
See Also:
IRawDataObserver.notifyValueChanged(pl.edu.agh.cast.rawdata.DataRow, java.lang.String, java.lang.String)

logFileExists

public static boolean logFileExists(String projectLocation,
                                    String dateSetId)
Checks whether a log file for the current project location and data set id already exists.

Parameters:
projectLocation - the location of the project
dateSetId - the id of the data set
Returns:
true if the logger file exists; false otherwise

generateLogFilePath

public static String generateLogFilePath(String projectLocation,
                                         String dataSetId)
Generates a path to a log file for the current project location and data set id.

Parameters:
projectLocation - the location of the project
dataSetId - the is of the data set
Returns:
the path to the logger file


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.