org.csc.phynixx.loggersystem.logger.channellogger
Class FileChannelDataLoggerFactory

java.lang.Object
  extended by org.csc.phynixx.loggersystem.logger.channellogger.FileChannelDataLoggerFactory
All Implemented Interfaces:
IDataLoggerFactory

public class FileChannelDataLoggerFactory
extends Object
implements IDataLoggerFactory

create DataLogger using Files to store data. A logger is qualified by its name and a subsequent integer qualifier. It is possible to have more than one log file for a given logger. The logfile differ in the qualifier.

  A log file is named according to the follwing pattern
  'loggerSystemName'_'loggerName'_'qualifier'.log

 The different parts of the name make i possible to deduce the following information from the logfile name
 1.) loggerSystem
 2.) loggername
 3.) qualifier pof the logfile for the logger
 

A logical logger name has to unique for all logfile of the current loggerfactory. Diese Factory erzeugt FileChannelDataLogger . Es wird ein logischer Name mitgegeben und es wird im Verzeichnis eine datei mit diesem namen angelegt und auf dieser Datei eine TAEnabledRandomAccessFile instanziert.

The logic Name is unique concerning the loggerssytem


Constructor Summary
FileChannelDataLoggerFactory(String loggerSystemName, File directory)
           
FileChannelDataLoggerFactory(String loggerSystemName, String directoryName)
           
 
Method Summary
 void cleanup()
          destroys a logfiles
 void destroyLogger(String loggerName)
          destroys the logger an all is associated resources an information
 Set<String> findLoggerNames()
           
 String getLoggerSystemName()
           
 File getLoggingDirectory()
           
 IDataLogger instanciateLogger(String loggerName)
          open the logger with mode AccessMode.APPEND
 IDataLogger instanciateLogger(String loggerName, AccessMode accessMode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileChannelDataLoggerFactory

public FileChannelDataLoggerFactory(String loggerSystemName,
                                    String directoryName)
Parameters:
loggerSystemName -
directoryName - logfile are created in this directory

FileChannelDataLoggerFactory

public FileChannelDataLoggerFactory(String loggerSystemName,
                                    File directory)
Parameters:
loggerSystemName -
directory - logfile are created in this directory
Method Detail

getLoggerSystemName

public String getLoggerSystemName()
Specified by:
getLoggerSystemName in interface IDataLoggerFactory
Returns:
Name of the loggerSystem

getLoggingDirectory

public File getLoggingDirectory()
Returns:
directory containing the logfiles

instanciateLogger

public IDataLogger instanciateLogger(String loggerName)
                              throws IOException
Description copied from interface: IDataLoggerFactory
open the logger with mode AccessMode.APPEND

Specified by:
instanciateLogger in interface IDataLoggerFactory
Parameters:
loggerName - unique Identifier of the logger (concering to the logger system)
Returns:
dataLogger encapsulating the logfile
Throws:
IOException

instanciateLogger

public IDataLogger instanciateLogger(String loggerName,
                                     AccessMode accessMode)
                              throws IOException
Specified by:
instanciateLogger in interface IDataLoggerFactory
Parameters:
loggerName - unique Identifier of the logger (concering to the logger system)
Returns:
dataLogger encapsulating the logfile
Throws:
IOException

cleanup

public void cleanup()
destroys a logfiles

Specified by:
cleanup in interface IDataLoggerFactory

destroyLogger

public void destroyLogger(String loggerName)
Description copied from interface: IDataLoggerFactory
destroys the logger an all is associated resources an information

Specified by:
destroyLogger in interface IDataLoggerFactory

findLoggerNames

public Set<String> findLoggerNames()
                            throws IOException
Specified by:
findLoggerNames in interface IDataLoggerFactory
Returns:
the loggernames of all loggers of the logger system
Throws:
IOException


Copyright © 2015. All rights reserved.