psdi.iface.load

Class FileLoaderProcess

  • java.lang.Object
    • psdi.iface.load.FileLoaderProcess


  • public class FileLoaderProcess
    extends java.lang.Object
    Processing class for the file Loading in MAXIMO.
    • Constructor Summary

      Constructors 
      Constructor and Description
      FileLoaderProcess(ExtSystemInfo extSysInfo, MaxExtIfaceInInfo extIfaceInInfo, boolean preview, boolean fromClientImport, boolean isFileExtract, java.lang.String fileFormat, java.lang.String fileName, java.lang.String delimiter, java.lang.String textQualifier, java.lang.String colHeader, java.lang.String processOwner)
      Construct the set
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void cleanup()
      Clean up called by flat and xml file load callers to clean up on sql statements, connection etc.
      void close()
      Close the JMS related resources.
      void commit()
      commit Queue Transaction.
      org.jdom2.Document getMasterDoc()
      Get Master Document (which is then converted into extract file)/ Applicable in case of Preview mode when Extract file is generated on the fly in memory
      java.util.List getTempFiles()
      Get list of temporary files.
      boolean isErrorOccured()
      Return the value indicating whether error occured during this instance os FileLoader
      void markDBExtractComplete()
      In case of File Extract operation in a cron task scenario, because there is an individual commit, when all records are 'read', database entry will be done to mark it as complete indicating that the file is been read completely.
      void processCleanup()
      Clean up called by flat and xml file load callers to to update database file extract entry, clean up on sql statements, connection etc.
      void processData(byte[] data, int intCurrentNoun, MboRemote npMbo)
      Process the incoming Data.
      void writeToQueue(byte[] extData) 
      void writeToQueue(byte[] extData, java.util.Map props)
      Write the data to Queue.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileLoaderProcess

        public FileLoaderProcess(ExtSystemInfo extSysInfo,
                                 MaxExtIfaceInInfo extIfaceInInfo,
                                 boolean preview,
                                 boolean fromClientImport,
                                 boolean isFileExtract,
                                 java.lang.String fileFormat,
                                 java.lang.String fileName,
                                 java.lang.String delimiter,
                                 java.lang.String textQualifier,
                                 java.lang.String colHeader,
                                 java.lang.String processOwner)
                          throws MXException
        Construct the set
        Parameters:
        extSysInfo - External system Info object
        extIfaceInInfo - Enterprise service info object
        preview - boolean indicating whether it is a UI preview mode or not.
        fromClientImport - boolean indicating whether it is from UI import or crontask
        isFileExtract - boolean indicating if File Load process is looking to do Extract functionality or not
        fileFormat - Could be XML or FLAT file format
        fileName - Input file name that is being loaded
        delimiter - Applicable in case of Flat file load operation when fields are separated by certain character
        textQualifier - Applicable in case of Flat file load operation when field value could delimiter itself and needs to be distinguished in such case
        colHeader - Applicable in case of Flat file load operation when this full string will indicate all column names in order to regenerated extract file
        processOwner - Applicable in case of Cron task file load operation and this field indicates the instance name of teh cron task
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote Exception
    • Method Detail

      • writeToQueue

        public void writeToQueue(byte[] extData,
                                 java.util.Map props)
                          throws MXException
        Write the data to Queue.
        Parameters:
        extData - the xml data
        Throws:
        MXException
      • close

        public void close()
        Close the JMS related resources.
      • processData

        public void processData(byte[] data,
                                int intCurrentNoun,
                                MboRemote npMbo)
                         throws MXException,
                                java.rmi.RemoteException
        Process the incoming Data. If the call comes from UI import preview, it will call MicService's processExternalData, otherwise it call WriteToQueue method to write into Queue.
        Parameters:
        data - Xml Data
        intCurrentNoun - the current noun (or) split noun\
        npMbo - Non-persistent Mbo which is used in Preview case to show the stats on data processing
        Throws:
        MXException
        java.rmi.RemoteException
      • markDBExtractComplete

        public void markDBExtractComplete()
                                   throws java.sql.SQLException
        In case of File Extract operation in a cron task scenario, because there is an individual commit, when all records are 'read', database entry will be done to mark it as complete indicating that the file is been read completely.
        Throws:
        java.lang.Exception
        java.sql.SQLException
      • cleanup

        public void cleanup()
        Clean up called by flat and xml file load callers to clean up on sql statements, connection etc.
      • isErrorOccured

        public boolean isErrorOccured()
        Return the value indicating whether error occured during this instance os FileLoader
        Returns:
        boolean indicating if error occured
      • getTempFiles

        public java.util.List getTempFiles()
        Get list of temporary files. Applicable in case of Preview mode when Extract file is generated on the fly in memory
        Returns:
        list List having File names
      • getMasterDoc

        public org.jdom2.Document getMasterDoc()
        Get Master Document (which is then converted into extract file)/ Applicable in case of Preview mode when Extract file is generated on the fly in memory
        Returns:
        masterDoc Full Document (master document) that has individual records with their respective error messages (if any)
      • processCleanup

        public void processCleanup()
                            throws MXApplicationException
        Clean up called by flat and xml file load callers to to update database file extract entry, clean up on sql statements, connection etc.
        Throws:
        MXApplicationException