| Modifier and Type | Class and Description |
|---|---|
| private static interface | |
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| protected final Connection | |
| protected DatabaseConnectionProperties | |
| private int | |
| private final DatabaseConnection | |
| private static final Set | |
| private @Nullable NotificationListener | |
| protected static final Logger | |
| private static final long | |
| private final String | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the structure matches the requirements, false if not.Scans the database for required tables. |
| protected boolean | Returns: true if all given tables are present, else false.Table names to be checked tableNames)Checks whether all given table names (case insensitive) exist in database. |
| public boolean | Returns: true if the structure is old, else false.Determines whether the database is using an pre-3.6 structure. |
| private Optional | |
| pack-priv int | |
| public DatabaseConnectionProperties | |
| private List | getNotYetExistingEntries(List<BibEntry> bibEntries)
Filters a list of BibEntry to those which do not yet exist in the database |
| public String | |
| public List | getSharedEntries(@NonNull List<Integer>
the list of Ids to filter. If list is empty, then no filter is applied sharedIDs)Queries the database for shared entries. |
| public List | |
| public Optional | |
| public Map | |
| public Map | |
| public void | |
| public void | |
| protected void | |
| protected void | insertIntoFieldTable(List<BibEntry>
BibEntry to be insertedInserts the given list of BibEntry into FIELD table. |
| private void | |
| private <T> T | inTransaction(DBMSProcessor.
Runs the work as one transaction on the (otherwise auto-committing) connection. |
| private boolean | |
| private void | migrateFromOldStructure()
Copies the data of a shared database created by earlier JabRef versions into the current
table structure: quoted upper-case tables in the schema |
| public List | partitionAndGetSharedEntries(List<Integer> sharedIDs)
Queries the database for the given entries in 500 element batches. |
| public void | |
| private void | removeObsoleteGroupTreeMetaData(Set<String> currentMetaDataKeys)
Removes group tree formats which are no longer present after a group update. |
| public void | setSharedMetaData(Map<String, String>
JabRef meta data as map data)Clears and sets all shared meta data. |
| public void | |
| public void | setupSharedDatabase()
Creates and sets up the needed tables and columns according to the database type and performs a check whether the needed tables are present. |
| public void | startNotificationListener(DBMSSynchronizer
DBMSSynchronizer which handles the notification.Listens for notifications from DBMS. |
| public void | |
| private boolean | |
| public void | updateEntry(BibEntry
BibEntry affected by changesReplaces the whole |
| connection | back to summary |
|---|---|
| protected final Connection connection | |
| connectionProperties | back to summary |
|---|---|
| protected DatabaseConnectionProperties connectionProperties | |
| CURRENT_VERSION_DB_STRUCT | back to summary |
|---|---|
| private int CURRENT_VERSION_DB_STRUCT | |
| dbmsConnection | back to summary |
|---|---|
| private final DatabaseConnection dbmsConnection | |
| GROUP_TREE_METADATA_KEYS | back to summary |
|---|---|
| private static final Set<String> GROUP_TREE_METADATA_KEYS | |
| listener | back to summary |
|---|---|
| private @Nullable NotificationListener listener | |
| LOGGER | back to summary |
|---|---|
| protected static final Logger LOGGER | |
| MIGRATION_ADVISORY_LOCK_ID | back to summary |
|---|---|
| private static final long MIGRATION_ADVISORY_LOCK_ID | |
| processorId | back to summary |
|---|---|
| private final String processorId | |
| VERSION_DB_STRUCT_DEFAULT | back to summary |
|---|---|
| private int VERSION_DB_STRUCT_DEFAULT | |
| DBMSProcessor | back to summary |
|---|---|
| protected DBMSProcessor(DatabaseConnection dbmsConnection) | |
| checkBaseIntegrity | back to summary |
|---|---|
| public boolean checkBaseIntegrity() throws SQLException Scans the database for required tables.
| |
| checkTableAvailability | back to summary |
|---|---|
| protected boolean checkTableAvailability(String... tableNames) throws SQLException Checks whether all given table names (case insensitive) exist in database.
| |
| databaseIsAtMostJabRef35 | back to summary |
|---|---|
| public boolean databaseIsAtMostJabRef35() throws SQLException Determines whether the database is using an pre-3.6 structure.
| |
| findOldSchema | back to summary |
|---|---|
| private Optional | |
| getCURRENT_VERSION_DB_STRUCT | back to summary |
|---|---|
| pack-priv int getCURRENT_VERSION_DB_STRUCT() | |
| getDBMSConnectionProperties | back to summary |
|---|---|
| public DatabaseConnectionProperties getDBMSConnectionProperties() | |
| getNotYetExistingEntries | back to summary |
|---|---|
| private List Filters a list of BibEntry to those which do not yet exist in the database | |
| getProcessorId | back to summary |
|---|---|
| public String getProcessorId() | |
| getSharedEntries | back to summary |
|---|---|
| public List Queries the database for shared entries. Optionally, they are filtered by the given list of sharedIds | |
| getSharedEntries | back to summary |
|---|---|
| public List | |
| getSharedEntry | back to summary |
|---|---|
| public Optional | |
| getSharedIDVersionMapping | back to summary |
|---|---|
| public Map Retrieves a mapping between the columns SHARED_ID and VERSION. | |
| getSharedMetaData | back to summary |
|---|---|
| public Map Fetches and returns all shared meta data. | |
| insertEntries | back to summary |
|---|---|
| public void insertEntries(List<BibEntry> bibEntries) throws SQLException | |
| insertEntry | back to summary |
|---|---|
| public void insertEntry(BibEntry bibEntry) throws SQLException For use in test only. Inserts the BibEntry into the shared database.
| |
| insertIntoEntryTable | back to summary |
|---|---|
| protected void insertIntoEntryTable(List<BibEntry> bibEntries) throws SQLException | |
| insertIntoFieldTable | back to summary |
|---|---|
| protected void insertIntoFieldTable(List<BibEntry> bibEntries) throws SQLException Inserts the given list of BibEntry into FIELD table. These entries do not yet exist in the remote database. | |
| inTransaction | back to summary |
|---|---|
| private void inTransaction(DBMSProcessor. | |
| inTransaction | back to summary |
|---|---|
| private <T> T inTransaction(DBMSProcessor. Runs the work as one transaction on the (otherwise auto-committing) connection. Any exception rolls back. | |
| isEntryTableEmpty | back to summary |
|---|---|
| private boolean isEntryTableEmpty() throws SQLException | |
| migrateFromOldStructure | back to summary |
|---|---|
| private void migrateFromOldStructure() throws SQLException Copies the data of a shared database created by earlier JabRef versions into the current
table structure: quoted upper-case tables in the schema The old tables are kept untouched, so older JabRef versions can still work with them. | |
| partitionAndGetSharedEntries | back to summary |
|---|---|
| public List Queries the database for the given entries in 500 element batches. Returns nothing for an empty id list. | |
| removeEntries | back to summary |
|---|---|
| public void removeEntries(@NonNull List<BibEntry> bibEntries) throws SQLException Removes the shared bibEntry. | |
| removeObsoleteGroupTreeMetaData | back to summary |
|---|---|
| private void removeObsoleteGroupTreeMetaData(Set<String> currentMetaDataKeys) throws SQLException Removes group tree formats which are no longer present after a group update. | |
| setSharedMetaData | back to summary |
|---|---|
| public void setSharedMetaData(Map<String, String> data) throws SQLException Clears and sets all shared meta data. | |
| setUp | back to summary |
|---|---|
| public void setUp() throws SQLException Creates and sets up the needed tables and columns according to the database type.
| |
| setupSharedDatabase | back to summary |
|---|---|
| public void setupSharedDatabase() throws SQLException Creates and sets up the needed tables and columns according to the database type and performs a check whether the needed tables are present.
| |
| startNotificationListener | back to summary |
|---|---|
| public void startNotificationListener(DBMSSynchronizer dbmsSynchronizer) Listens for notifications from DBMS. Needs to be implemented if LiveUpdate is supported by the DBMS
| |
| stopNotificationListener | back to summary |
|---|---|
| public void stopNotificationListener() Terminates the notification listener. Needs to be implemented if LiveUpdate is supported by the DBMS | |
| tableExists | back to summary |
|---|---|
| private boolean tableExists(String qualifiedName) throws SQLException | |
| updateEntry | back to summary |
|---|---|
| public void updateEntry(BibEntry localBibEntry) throws OfflineLockException, SharedEntryNotPresentException, SQLException Replaces the whole The version check and the increment are one statement, whose row lock serializes concurrent updates of the same entry: the second writer sees the incremented version and is refused instead of overwriting the first writer's fields with its stale copy.
| |