Package org.xipki.ca.mgmt.db.port
Class DbPorter
- java.lang.Object
-
- org.xipki.ca.mgmt.db.DbToolBase
-
- org.xipki.ca.mgmt.db.port.DbPorter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class DbPorter extends DbToolBase
Database porter.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbPorter.CaDbEntryTypestatic classDbPorter.DbPortFileNameIteratorstatic classDbPorter.OcspDbEntryType
-
Field Summary
Fields Modifier and Type Field Description protected DbSchemaInfodbSchemaInfoprotected intdbSchemaVersionstatic StringEXPORT_PROCESS_LOG_FILENAMEstatic StringFILENAME_CA_CERTSTOREstatic StringFILENAME_CA_CONFIGURATIONstatic StringFILENAME_OCSP_CERTSTOREstatic StringIMPORT_PROCESS_LOG_FILENAMEstatic StringIMPORT_TO_OCSP_PROCESS_LOG_FILENAMEprotected intmaxX500nameLenstatic intVERSION_V1For XiPKI Version 5.3.xstatic intVERSION_V2For XiPKI Version 5.4.x-
Fields inherited from class org.xipki.ca.mgmt.db.DbToolBase
baseDir, connection, datasource, stopMe
-
-
Constructor Summary
Constructors Constructor Description DbPorter(org.xipki.datasource.DataSourceWrapper datasource, String baseDir, AtomicBoolean stopMe)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.xipki.util.FileOrBinarybuildFileOrBase64Binary(String base64Content, String fileName)protected org.xipki.util.FileOrBinarybuildFileOrBinary(byte[] content, String fileName)protected org.xipki.util.FileOrValuebuildFileOrValue(String content, String fileName)static voidechoToFile(String content, File file)protected byte[]readContent(org.xipki.util.FileOrBinary fileOrBinary)protected StringreadContent(org.xipki.util.FileOrValue fileOrValue)-
Methods inherited from class org.xipki.ca.mgmt.db.DbToolBase
buildFilename, close, commit, count, deleteFromTableWithLargerId, deleteTmpFiles, disableAutoCommit, getDbConfProperties, getZipOutputStream, max, max, min, min, prepareStatement, recoverAutoCommit, releaseResources, rollback, setBoolean, setInt, setLong, setSavepoint, tableExists, tableHasColumn, translate, writeLine
-
-
-
-
Field Detail
-
FILENAME_CA_CONFIGURATION
public static final String FILENAME_CA_CONFIGURATION
- See Also:
- Constant Field Values
-
FILENAME_CA_CERTSTORE
public static final String FILENAME_CA_CERTSTORE
- See Also:
- Constant Field Values
-
FILENAME_OCSP_CERTSTORE
public static final String FILENAME_OCSP_CERTSTORE
- See Also:
- Constant Field Values
-
EXPORT_PROCESS_LOG_FILENAME
public static final String EXPORT_PROCESS_LOG_FILENAME
- See Also:
- Constant Field Values
-
IMPORT_PROCESS_LOG_FILENAME
public static final String IMPORT_PROCESS_LOG_FILENAME
- See Also:
- Constant Field Values
-
IMPORT_TO_OCSP_PROCESS_LOG_FILENAME
public static final String IMPORT_TO_OCSP_PROCESS_LOG_FILENAME
- See Also:
- Constant Field Values
-
VERSION_V1
public static final int VERSION_V1
For XiPKI Version 5.3.x- See Also:
- Constant Field Values
-
VERSION_V2
public static final int VERSION_V2
For XiPKI Version 5.4.x- See Also:
- Constant Field Values
-
dbSchemaVersion
protected final int dbSchemaVersion
-
maxX500nameLen
protected final int maxX500nameLen
-
dbSchemaInfo
protected final DbSchemaInfo dbSchemaInfo
-
-
Constructor Detail
-
DbPorter
public DbPorter(org.xipki.datasource.DataSourceWrapper datasource, String baseDir, AtomicBoolean stopMe) throws org.xipki.datasource.DataAccessException- Throws:
org.xipki.datasource.DataAccessException
-
-
Method Detail
-
buildFileOrValue
protected org.xipki.util.FileOrValue buildFileOrValue(String content, String fileName) throws IOException
- Throws:
IOException
-
buildFileOrBase64Binary
protected org.xipki.util.FileOrBinary buildFileOrBase64Binary(String base64Content, String fileName) throws IOException
- Throws:
IOException
-
buildFileOrBinary
protected org.xipki.util.FileOrBinary buildFileOrBinary(byte[] content, String fileName) throws IOException- Throws:
IOException
-
readContent
protected byte[] readContent(org.xipki.util.FileOrBinary fileOrBinary) throws IOException- Throws:
IOException
-
readContent
protected String readContent(org.xipki.util.FileOrValue fileOrValue) throws IOException
- Throws:
IOException
-
echoToFile
public static void echoToFile(String content, File file) throws IOException
- Throws:
IOException
-
-