com.ibm.di.api.local.impl
Class SystemLogImpl

java.lang.Object
  extended by com.ibm.di.api.local.impl.SystemLogImpl
All Implemented Interfaces:
SystemLog

public class SystemLogImpl
extends Object
implements SystemLog

This class implements various methods for getting system log information.


Constructor Summary
SystemLogImpl(SessionImpl aSession)
           
 
Method Summary
 String cleanALLogs(String aConfigId, String aALName, String[] logsToBeDeleted)
          Deletes all the logs which are specified in " logsToBeDeleted" array.
 void cleanAllOldALLogs(Date aMinDate)
          Deletes all AssemblyLines' log files older than the specified date.
 void cleanAllOldALLogs(int aKeepNum)
          Deletes all AssemblyLines' log files except those generated on the " aKeepNum" latest runs of all AssemblyLines.
 void cleanAllOldLogs(Date aMinDate)
          Deletes all log files older than the specified date.
 void cleanAllOldLogs(int aKeepNum)
          Deletes all log files except those generated on the " aKeepNum" latest runs of all components.
 Boolean cleanOldALLogs(String aConfigId, String aALName, Date aMinDate)
          Deletes those log files of the specified AssemblyLine, that are older than the specified date.
 Boolean cleanOldALLogs(String aConfigId, String aALName, Date aMinDate, Date aMaxDate)
          Deletes those log files of the specified AssemblyLine, that are older than the specified date.
 Boolean cleanOldALLogs(String aConfigId, String aALName, int aKeepNum)
          Deletes all log files of the specified AssemblyLine except those generated on the "aKeepNum" latest AssemblyLine runs.
 String getALLastLogFileName(String aConfigId, String aALName)
          Returns the name of the log file created on the last run of a given AssemblyLine.
 String getALLog(String aConfigId, String aALName, String aLogFileName)
          Given an AssemblyLine identification, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file.
 String[] getALLogFileNames(String aConfigId, String aALName)
          Returns the names of all available log files for a given AssemblyLine.
 String[] getALLogFileNames(String aConfigId, String aALName, Date dDate)
          Returns the names of all available log files for a given AssemblyLine.
 String[] getALLogFileNames(String aConfigId, String aALName, Date startDate, Date endDate)
          Returns the names of all available log files for a given AssemblyLine.
 String[] getALLogFileNames(String aConfigId, String aALName, int iNumber)
          Returns the names of all available log files for a given AssemblyLine.
 String getALLogLastChunk(String aConfigId, String aALName, String aLogFileName, int aKilobytes)
          Retrieves the last chunk from a specified AssemblyLine's log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemLogImpl

public SystemLogImpl(SessionImpl aSession)
Parameters:
aSession -
Method Detail

getALLogFileNames

public String[] getALLogFileNames(String aConfigId,
                                  String aALName)
                           throws DIException
Returns the names of all available log files for a given AssemblyLine.

Specified by:
getALLogFileNames in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
Returns:
a String array, each of its elements specifying the name of a log file.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log file names.

getALLogFileNames

public String[] getALLogFileNames(String aConfigId,
                                  String aALName,
                                  int iNumber)
                           throws DIException
Returns the names of all available log files for a given AssemblyLine.

Specified by:
getALLogFileNames in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
iNumber - the number of the logs
Returns:
a String array, each of its elements specifying the name of a log file.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log file names.

getALLogFileNames

public String[] getALLogFileNames(String aConfigId,
                                  String aALName,
                                  Date dDate)
                           throws DIException
Returns the names of all available log files for a given AssemblyLine.

Specified by:
getALLogFileNames in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
dDate - the date of the logs
Returns:
a String array, each of its elements specifying the name of a log file.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log file names.

getALLogFileNames

public String[] getALLogFileNames(String aConfigId,
                                  String aALName,
                                  Date startDate,
                                  Date endDate)
                           throws DIException
Returns the names of all available log files for a given AssemblyLine.

Specified by:
getALLogFileNames in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
startDate - the start date of the logs
endDate - the end date of the logs
Returns:
a String array, each of its elements specifying the name of a log file.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log file names.

getALLastLogFileName

public String getALLastLogFileName(String aConfigId,
                                   String aALName)
                            throws DIException
Returns the name of the log file created on the last run of a given AssemblyLine.

Specified by:
getALLastLogFileName in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
Returns:
the name of the log file created on the last AssemblyLine's run.
Throws:
DIException - if an error occurs while obtaining the log file name.

getALLog

public String getALLog(String aConfigId,
                       String aALName,
                       String aLogFileName)
                throws DIException
Given an AssemblyLine identification, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file.

Specified by:
getALLog in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
aLogFileName - the name of the log file; no file path should be specified - just the file name.
Returns:
the specified log of the AssemblyLine.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log.

getALLogLastChunk

public String getALLogLastChunk(String aConfigId,
                                String aALName,
                                String aLogFileName,
                                int aKilobytes)
                         throws DIException
Retrieves the last chunk from a specified AssemblyLine's log file.

Specified by:
getALLogLastChunk in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine.
aLogFileName - the name of the log file; no file path should be specified - just the file name.
aKilobytes - specifies in kilobytes the size of the log's last chunk that will be read.
Returns:
the last chunk of the specified AssemblyLine's log.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log.

cleanAllOldLogs

public void cleanAllOldLogs(Date aMinDate)
                     throws DIException
Deletes all log files older than the specified date.

Specified by:
cleanAllOldLogs in interface SystemLog
Parameters:
aMinDate - only log files that were last modified before this date will be deleted.
Throws:
DIException - if an error occurs while deleting log files.

cleanAllOldLogs

public void cleanAllOldLogs(int aKeepNum)
                     throws DIException
Deletes all log files except those generated on the " aKeepNum" latest runs of all components.

Specified by:
cleanAllOldLogs in interface SystemLog
Parameters:
aKeepNum - specifies the number of the latest log files that should not be deleted; If for example, aKeepNum == 5, for each component only the 5 latest log files will not be deleted.
Throws:
DIException - if an error occurs while deleting log files.

cleanAllOldALLogs

public void cleanAllOldALLogs(Date aMinDate)
                       throws DIException
Deletes all AssemblyLines' log files older than the specified date.

Specified by:
cleanAllOldALLogs in interface SystemLog
Parameters:
aMinDate - only log files that were last modified before this date will be deleted.
Throws:
DIException - if an error occurs while deleting log files.

cleanAllOldALLogs

public void cleanAllOldALLogs(int aKeepNum)
                       throws DIException
Deletes all AssemblyLines' log files except those generated on the " aKeepNum" latest runs of all AssemblyLines.

Specified by:
cleanAllOldALLogs in interface SystemLog
Parameters:
aKeepNum - specifies the number of the latest log files that should not be deleted; If for example, aKeepNum == 5, for each AssemblyLine only the 5 latest log files will not be deleted.
Throws:
DIException - if an error occurs while deleting log files.

cleanOldALLogs

public Boolean cleanOldALLogs(String aConfigId,
                              String aALName,
                              Date aMinDate)
                       throws DIException
Deletes those log files of the specified AssemblyLine, that are older than the specified date.

Specified by:
cleanOldALLogs in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine whose logs will be cleaned up.
aMinDate - only log files that were last modified before this date will be deleted.
Returns:
a Boolean that holds true if the log files were deleted successfully; and null if there is no log folder for the specified AssemblyLine.
Throws:
DIException - if an error occurs while deleting log files.

cleanOldALLogs

public Boolean cleanOldALLogs(String aConfigId,
                              String aALName,
                              Date aMinDate,
                              Date aMaxDate)
                       throws DIException
Deletes those log files of the specified AssemblyLine, that are older than the specified date.

Specified by:
cleanOldALLogs in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine whose logs will be cleaned up.
aMinDate - only log files that were last modified after this date will be deleted.
aMaxDate - only log files that were last modified before this date will be deleted.
Returns:
a Boolean that holds true if the log files were deleted successfully; and null if there is no log folder for the specified AssemblyLine.
Throws:
DIException - if an error occurs while deleting log files.

cleanOldALLogs

public Boolean cleanOldALLogs(String aConfigId,
                              String aALName,
                              int aKeepNum)
                       throws DIException
Deletes all log files of the specified AssemblyLine except those generated on the "aKeepNum" latest AssemblyLine runs.

Specified by:
cleanOldALLogs in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine whose logs will be cleaned up.
aKeepNum - specifies the number of the latest log files that should not be deleted; If for example, aKeepNum == 5 only the 5 latest AssemblyLine's log files will not be deleted.
Returns:
a Boolean that holds true if the log files were deleted successfully; and null if there is no log folder for the specified AssemblyLine.
Throws:
DIException - if an error occurs while deleting log files.

cleanALLogs

public String cleanALLogs(String aConfigId,
                          String aALName,
                          String[] logsToBeDeleted)
                   throws DIException
Deletes all the logs which are specified in " logsToBeDeleted" array.

Specified by:
cleanALLogs in interface SystemLog
Parameters:
aConfigId - identification of the AssemblyLine's Config Instance.
aALName - the name of the AssemblyLine whose logs will be cleaned up.
logsToBeDeleted - name of the log files which are to be deleted.
Returns:
a String that holds null if the log files are deleted successfully; else comma separated names of the log files which are not deleted.
Throws:
DIException - if an error occurs while deleting log files.