org.processmining.framework.log
Class LogReaderFactory

java.lang.Object
  extended by org.processmining.framework.log.LogReaderFactory

public class LogReaderFactory
extends java.lang.Object

This class provides an abstraction layer to the creation and derivation of LogReader instances. It provides static facilities for setting a specific log reader implementation, which is then transparently used when requesting log reader creation by the provided static methods.

Author:
Christian W. Guenther (christian at deckfour dot org)

Field Summary
protected static java.lang.Class logReaderClass
           
 
Constructor Summary
LogReaderFactory()
           
 
Method Summary
static LogReader createInstance(LogFilter filter, LogFile file)
          Creates a new instance of the currently configured log reader implementation.
static LogReader createInstance(LogFilter filter, LogReader reader)
          Creates a new instance of the currently configured log reader implementation.
static LogReader createInstance(LogReader reader, int[] processInstancesToKeep)
          Creates a new instance of the currently configured log reader implementation.
static java.lang.Class getLogReaderClass()
          Gets the LogReader implementation class, which is to be used for future creation and derivation of log readers.
static void setLogReaderClass(java.lang.Class readerClass)
          Sets the LogReader implementation class, which is to be used for future creation and derivation of log readers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logReaderClass

protected static java.lang.Class logReaderClass
Constructor Detail

LogReaderFactory

public LogReaderFactory()
Method Detail

createInstance

public static LogReader createInstance(LogFilter filter,
                                       LogReader reader)
                                throws java.lang.Exception
Creates a new instance of the currently configured log reader implementation. This method creates a log reader based on a specified log filter and provided log reader's original data.

Use this method preferably to the one based on a filter and log file. It generally performs faster, as the original log file does not have to be parsed and interpreted over again.

Parameters:
filter - The filter which which the log reader is equipped.
reader - Log reader from which to copy original event data.
Returns:
The newly created log reader.
Throws:
java.lang.Exception

createInstance

public static LogReader createInstance(LogFilter filter,
                                       LogFile file)
                                throws java.lang.Exception
Creates a new instance of the currently configured log reader implementation. This method creates a log reader based on a specified log filter and log file.

Parameters:
filter - The filter which which the log reader is equipped.
file - Log file from which to read event data.
Returns:
The newly created log reader.
Throws:
java.lang.Exception

createInstance

public static LogReader createInstance(LogReader reader,
                                       int[] processInstancesToKeep)
                                throws java.lang.Exception
Creates a new instance of the currently configured log reader implementation. This method creates a log reader based on a parent log reader (whose settings are copied to the newly created instance) and an array containing the indices of process instances from the old log reader, which are to be contained in the newly created one.

Parameters:
reader - Parent log reader on which to base the new instance.
processInstancesToKeep - Array containing the indices of process instances in the parent log reader, which are to be used as well in the newly created instance.
Returns:
The derived log reader which is newly created.
Throws:
java.lang.Exception

setLogReaderClass

public static void setLogReaderClass(java.lang.Class readerClass)
                              throws java.lang.Exception
Sets the LogReader implementation class, which is to be used for future creation and derivation of log readers.

Parameters:
readerClass - A class derived from LogReader
Throws:
java.lang.Exception

getLogReaderClass

public static java.lang.Class getLogReaderClass()
Gets the LogReader implementation class, which is to be used for future creation and derivation of log readers.

Throws:
java.lang.Exception