Class DocumentFolderSqlCreator
java.lang.Object
ch.tocco.nice2.dms.impl.dbrefactoring.DocumentFolderSqlCreator
Creates "entity folders".
Given an entity and its parent folder, creates a new folder by inserting a row into the table `nice_folder`. It does so in parallel if `nthreads` is greater than 1. Also the inserts are committed in batches of `txsize`.
The `submit` method submits workers in a thread pool that insert the rows in
`nice_folder` according to the given entity. The method finish()
must
be called at last to shut down the pool (this object is not usable anymore after
this).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static class
static interface
-
Constructor Summary
ConstructorDescriptionDocumentFolderSqlCreator
(DataSource dataSource, org.slf4j.Logger log) DocumentFolderSqlCreator
(org.slf4j.Logger log, int nthreads, DataSource dataSource) -
Method Summary
-
Constructor Details
-
DocumentFolderSqlCreator
public DocumentFolderSqlCreator(org.slf4j.Logger log, int nthreads, DataSource dataSource) throws SQLException, InterruptedException - Throws:
SQLException
InterruptedException
-
DocumentFolderSqlCreator
public DocumentFolderSqlCreator(DataSource dataSource, org.slf4j.Logger log) throws SQLException, InterruptedException - Throws:
SQLException
InterruptedException
-
-
Method Details
-
submit
Creates a "documents-folder" for the given entity and its given parent node. The creation is done on a separate thread and this method returns immediately. -
makeStatusMessage
-
finish
- Throws:
SQLException
InterruptedException
-