Class JDBCSequentialFileFactoryDriver
java.lang.Object
org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver
org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactoryDriver
- Direct Known Subclasses:
Db2SequentialFileDriver, PostgresSequentialSequentialFileDriver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Integerprotected Integerprotected Stringprotected Stringprotected intprotected String[]protected Stringprotected Stringprotected Stringprotected Stringprotected StringFields inherited from class AbstractJDBCDriver
connectionProvider, sqlProvider -
Method Summary
Modifier and TypeMethodDescriptionlongcalculateReadLength(long objectLength, int bufferSpace, long readPosition) voidcopyFileData(JDBCSequentialFile fileFrom, JDBCSequentialFile fileTo) Copy the data content of FileFrom to FileTovoidcreateFile(JDBCSequentialFile file) Creates a new database row representing the supplied file.protected voidvoiddeleteFile(JDBCSequentialFile file) Deletes the associated row in the database.voiddestroy()Drop all tables and datalonggetFileID(JDBCSequentialFile file) Checks to see if a file with filename and extension exists.longvoidloadFile(JDBCSequentialFile file) Loads an existing file.voidopenFile(JDBCSequentialFile file) Opens the supplied file.protected voidintreadFromFile(JDBCSequentialFile file, ByteBuffer bytes) Reads data from the file (at file.readPosition) into the byteBuffer.voidrenameFile(JDBCSequentialFile file, String newFileName) Updates the fileName field to the new value.intwriteToFile(JDBCSequentialFile file, byte[] data, boolean append) Persists data to this files associated database mapping.Methods inherited from class AbstractJDBCDriver
createTable, getJdbcConnectionProvider, getSqlProvider, setJdbcConnectionProvider, setSqlProvider, start, stop
-
Field Details
-
deleteFile
-
createFile
-
createFileColumnNames
-
createFileAutogeneratedKeys
protected int createFileAutogeneratedKeys -
selectFileByFileName
-
copyFileRecord
-
renameFile
-
readLargeObject
-
appendToLargeObject
-
appendToLargeObjectResultSetType
-
appendToLargeObjectResultSetConcurrency
-
selectFileNamesByExtension
-
-
Method Details
-
createSchema
- Specified by:
createSchemain classAbstractJDBCDriver- Throws:
SQLException
-
prepareStatements
protected void prepareStatements()- Specified by:
prepareStatementsin classAbstractJDBCDriver
-
listFiles
-
openFile
Opens the supplied file. If the file does not exist in the database it will create a new one.- Throws:
SQLException
-
getFileID
Checks to see if a file with filename and extension exists. If so returns the ID of the file or returns -1.- Throws:
SQLException
-
loadFile
Loads an existing file.- Throws:
SQLException
-
createFile
Creates a new database row representing the supplied file.- Throws:
SQLException
-
renameFile
Updates the fileName field to the new value.- Throws:
SQLException
-
deleteFile
Deletes the associated row in the database.- Throws:
SQLException
-
writeToFile
Persists data to this files associated database mapping.- Throws:
SQLException
-
readFromFile
Reads data from the file (at file.readPosition) into the byteBuffer.- Throws:
SQLException
-
copyFileData
public void copyFileData(JDBCSequentialFile fileFrom, JDBCSequentialFile fileTo) throws SQLException Copy the data content of FileFrom to FileTo- Throws:
SQLException
-
destroy
Drop all tables and data- Overrides:
destroyin classAbstractJDBCDriver- Throws:
SQLException
-
calculateReadLength
public long calculateReadLength(long objectLength, int bufferSpace, long readPosition) -
getMaxSize
public long getMaxSize()
-