Class SystemLogImpl

  • All Implemented Interfaces:
    SystemLog, java.io.Serializable, java.rmi.Remote

    public class SystemLogImpl
    extends APIRemoteObject
    implements SystemLog
    This class implements various methods for getting system log information.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.rmi.server.RemoteObject

        ref
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String cleanALLogs​(java.lang.String aConfigId, java.lang.String aALName, java.lang.String[] logsToBeDeleted)
      Deletes all the logs which are specified in " logsToBeDeleted" array.
      void cleanAllOldALLogs​(int aKeepNum)
      Deletes all AssemblyLines' log files except those generated on the " aKeepNum" latest runs of all AssemblyLines.
      void cleanAllOldALLogs​(java.util.Date aMinDate)
      Deletes all AssemblyLines' 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.
      void cleanAllOldLogs​(java.util.Date aMinDate)
      Deletes all log files older than the specified date.
      java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId, java.lang.String aALName, int aKeepNum)
      Deletes all log files of the specified AssemblyLine except those generated on the "aKeepNum" latest AssemblyLine runs.
      java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId, java.lang.String aALName, java.util.Date aMinDate)
      Deletes those log files of the specified AssemblyLine, that are older than the specified date.
      java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId, java.lang.String aALName, java.util.Date aMinDate, java.util.Date aMaxDate)
      Deletes those log files of the specified AssemblyLine, that are older than the specified date.
      static SystemLogImpl createInstance​(SystemLog aLocalSystemLog, SessionImpl aSession)
      Creates new instance of this class.
      java.lang.String getALLastLogFileName​(java.lang.String aConfigId, java.lang.String aALName)
      Returns the name of the log file created on the last run of a given AssemblyLine.
      java.lang.String getALLog​(java.lang.String aConfigId, java.lang.String aALName, java.lang.String aLogFileName)
      Given an AssemblyLine identification, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file.
      java.lang.String[] getALLogFileNames​(java.lang.String aConfigId, java.lang.String aALName)
      Returns the names of all available log files for a given AssemblyLine.
      java.lang.String[] getALLogFileNames​(java.lang.String aConfigId, java.lang.String aALName, int iNumber)
      Returns the names of first 'n' log files for a given AssemblyLine.
      java.lang.String[] getALLogFileNames​(java.lang.String aConfigId, java.lang.String aALName, java.util.Date dDate)
      Returns the names of all available log files prior to the specified 'date' for a given AssemblyLine.
      java.lang.String[] getALLogFileNames​(java.lang.String aConfigId, java.lang.String aALName, java.util.Date startDate, java.util.Date endDate)
      Returns the names of all available log files prior to the specified 'date' for a given AssemblyLine.
      java.lang.String getALLogLastChunk​(java.lang.String aConfigId, java.lang.String aALName, java.lang.String aLogFileName, int aKilobytes)
      Retrieves the last chunk from a specified AssemblyLine's log file.
      • Methods inherited from class java.rmi.server.UnicastRemoteObject

        clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
      • Methods inherited from class java.rmi.server.RemoteServer

        getClientHost, getLog, setLog
      • Methods inherited from class java.rmi.server.RemoteObject

        equals, getRef, hashCode, toString, toStub
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getALLogFileNames

        public java.lang.String[] getALLogFileNames​(java.lang.String aConfigId,
                                                    java.lang.String aALName)
                                             throws DIException,
                                                    java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLastLogFileName

        public java.lang.String getALLastLogFileName​(java.lang.String aConfigId,
                                                     java.lang.String aALName)
                                              throws DIException,
                                                     java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLog

        public java.lang.String getALLog​(java.lang.String aConfigId,
                                         java.lang.String aALName,
                                         java.lang.String aLogFileName)
                                  throws DIException,
                                         java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLogFileNames

        public java.lang.String[] getALLogFileNames​(java.lang.String aConfigId,
                                                    java.lang.String aALName,
                                                    int iNumber)
                                             throws DIException,
                                                    java.rmi.RemoteException
        Returns the names of first 'n' 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 max number of log files to be returned. If iNumber exceeds the number of available log files then all the log files names are returned.
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLogFileNames

        public java.lang.String[] getALLogFileNames​(java.lang.String aConfigId,
                                                    java.lang.String aALName,
                                                    java.util.Date dDate)
                                             throws DIException,
                                                    java.rmi.RemoteException
        Returns the names of all available log files prior to the specified 'date' 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 - all the log files prior to this date will e listed.
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLogFileNames

        public java.lang.String[] getALLogFileNames​(java.lang.String aConfigId,
                                                    java.lang.String aALName,
                                                    java.util.Date startDate,
                                                    java.util.Date endDate)
                                             throws DIException,
                                                    java.rmi.RemoteException
        Returns the names of all available log files prior to the specified 'date' 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 - all the log files after this date will be listed.
        endDate - all the log files before this date will be listed.
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • getALLogLastChunk

        public java.lang.String getALLogLastChunk​(java.lang.String aConfigId,
                                                  java.lang.String aALName,
                                                  java.lang.String aLogFileName,
                                                  int aKilobytes)
                                           throws DIException,
                                                  java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanAllOldLogs

        public void cleanAllOldLogs​(java.util.Date aMinDate)
                             throws DIException,
                                    java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanAllOldLogs

        public void cleanAllOldLogs​(int aKeepNum)
                             throws DIException,
                                    java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanAllOldALLogs

        public void cleanAllOldALLogs​(java.util.Date aMinDate)
                               throws DIException,
                                      java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanAllOldALLogs

        public void cleanAllOldALLogs​(int aKeepNum)
                               throws DIException,
                                      java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanOldALLogs

        public java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId,
                                                java.lang.String aALName,
                                                java.util.Date aMinDate)
                                         throws DIException,
                                                java.rmi.RemoteException
        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.
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanOldALLogs

        public java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId,
                                                java.lang.String aALName,
                                                java.util.Date aMinDate,
                                                java.util.Date aMaxDate)
                                         throws DIException,
                                                java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanOldALLogs

        public java.lang.Boolean cleanOldALLogs​(java.lang.String aConfigId,
                                                java.lang.String aALName,
                                                int aKeepNum)
                                         throws DIException,
                                                java.rmi.RemoteException
        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.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • createInstance

        public static SystemLogImpl createInstance​(SystemLog aLocalSystemLog,
                                                   SessionImpl aSession)
                                            throws DIException,
                                                   java.rmi.RemoteException
        Creates new instance of this class.
        Parameters:
        aLocalSystemLog - local system log
        aSession - the SessionImpl object
        Returns:
        SystemLogImpl object
        Throws:
        DIException - if Runtime or Security exception occurs
        java.rmi.RemoteException - if a communication-related exception occurs.
      • cleanALLogs

        public java.lang.String cleanALLogs​(java.lang.String aConfigId,
                                            java.lang.String aALName,
                                            java.lang.String[] logsToBeDeleted)
                                     throws DIException,
                                            java.rmi.RemoteException
        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 seperated names of the log files which are not deleted.
        Throws:
        DIException - if an error occurs while deleting log files.
        java.rmi.RemoteException - if a communication-related exception occurs.