Class UserProfileImporter

    • Constructor Detail

      • UserProfileImporter

        public UserProfileImporter()
    • Method Detail

      • doImport

        public void doImport​(CoreSession session)
      • getResourceAsStream

        protected InputStream getResourceAsStream​(String resource)
      • importLine

        protected boolean importLine​(org.apache.commons.csv.CSVRecord record,
                                     long lineNumber,
                                     Integer nameIndex,
                                     DocumentType docType,
                                     CoreSession session,
                                     UserProfileService userProfileService,
                                     Map<String,​Integer> headerValues)
        Import a line from the CSV file.
        Returns:
        true if a document has been created or updated, false otherwise.
      • getDateFormat

        protected DateFormat getDateFormat()
      • commitOrRollbackTransaction

        protected void commitOrRollbackTransaction()
        Releases the transaction resources by committing the existing transaction (if any). This is recommended before running a long process.
      • startTransaction

        protected boolean startTransaction()
        Starts a new transaction.

        Usually called after commitOrRollbackTransaction(), for instance for saving back the results of a long process.

        Returns:
        true if a new transaction was started
      • logImportError

        protected void logImportError​(long lineNumber,
                                      String message,
                                      String... params)
      • logImportInfo

        protected void logImportInfo​(long lineNumber,
                                     String message,
                                     String... params)
      • getTotalRecords

        public long getTotalRecords()
      • getCurrentRecord

        public long getCurrentRecord()