Class DbPorter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class DbPorter
    extends DbToolBase
    Database porter.
    Since:
    2.0.0
    Author:
    Lijun Liao (xipki)
    • Field Detail

      • FILENAME_CA_CONFIGURATION

        public static final java.lang.String FILENAME_CA_CONFIGURATION
        See Also:
        Constant Field Values
      • FILENAME_CA_CERTSTORE

        public static final java.lang.String FILENAME_CA_CERTSTORE
        See Also:
        Constant Field Values
      • FILENAME_OCSP_CERTSTORE

        public static final java.lang.String FILENAME_OCSP_CERTSTORE
        See Also:
        Constant Field Values
      • EXPORT_PROCESS_LOG_FILENAME

        public static final java.lang.String EXPORT_PROCESS_LOG_FILENAME
        See Also:
        Constant Field Values
      • IMPORT_PROCESS_LOG_FILENAME

        public static final java.lang.String IMPORT_PROCESS_LOG_FILENAME
        See Also:
        Constant Field Values
      • IMPORT_TO_OCSP_PROCESS_LOG_FILENAME

        public static final java.lang.String IMPORT_TO_OCSP_PROCESS_LOG_FILENAME
        See Also:
        Constant Field Values
      • dbSchemaVersion

        protected final int dbSchemaVersion
      • maxX500nameLen

        protected final int maxX500nameLen
    • Constructor Detail

      • DbPorter

        public DbPorter​(org.xipki.datasource.DataSourceWrapper datasource,
                        java.lang.String baseDir,
                        java.util.concurrent.atomic.AtomicBoolean stopMe)
                 throws org.xipki.datasource.DataAccessException
        Throws:
        org.xipki.datasource.DataAccessException
    • Method Detail

      • buildFileOrValue

        protected org.xipki.util.FileOrValue buildFileOrValue​(java.lang.String content,
                                                              java.lang.String fileName)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • buildFileOrBase64Binary

        protected org.xipki.util.FileOrBinary buildFileOrBase64Binary​(java.lang.String base64Content,
                                                                      java.lang.String fileName)
                                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • buildFileOrBinary

        protected org.xipki.util.FileOrBinary buildFileOrBinary​(byte[] content,
                                                                java.lang.String fileName)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readContent

        protected byte[] readContent​(org.xipki.util.FileOrBinary fileOrBinary)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readContent

        protected java.lang.String readContent​(org.xipki.util.FileOrValue fileOrValue)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • echoToFile

        public static void echoToFile​(java.lang.String content,
                                      java.io.File file)
                               throws java.io.IOException
        Throws:
        java.io.IOException