DBMSSynchronizer).
| Modifier and Type | Class and Description |
|---|---|
| public static record | OfflineChanges.
An entry as last seen locally. |
| public static record | OfflineChanges.
Everything recorded up to a |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Path | |
| private static final Gson | |
| private static final Logger | |
| private @Nullable Map | |
| private @Nullable Map | |
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | fileName(DatabaseConnectionProperties properties)
One file per database: identified by user, host, port and database name (or the JDBC URL in expert mode), hashed so that the name is file-system safe |
| public synchronized void | forget(Collection<BibEntry> entries)
Drops the records of entries that reached the shared database after all |
| public synchronized void | |
| public synchronized void | forgetRemovals(Collection<Integer> sharedIds)
Drops the records of removals that reached the shared database (or need not, because the shared entry is gone or was kept) |
| public synchronized boolean | |
| public static OfflineChanges | load(Path directory, DatabaseConnectionProperties properties)
Loads the changes recorded for the given database, if any |
| public synchronized OfflineChanges. | |
| public synchronized void | recordAsNew(int sharedId, BibEntry entry)
Turns the record of a change into the record of a new entry, because the shared entry it was recorded against is gone and the entry is inserted afresh instead. |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | rekeyInserts(Map<String, BibEntry> restoredEntriesByRecordedId)
Re-keys the records of new entries restored after a restart under fresh local ids, so that a failed insert records them under the ids it knows instead of next to the old records |
| private void | reload()
Takes over what is on disk, so that a change is never applied to a snapshot another JabRef session has meanwhile written to. |
| private void | |
| private OfflineChanges. |
| changedEntries | back to summary |
|---|---|
| private final Map<Integer, OfflineChanges. | |
| file | back to summary |
|---|---|
| private final Path file | |
| GSON | back to summary |
|---|---|
| private static final Gson GSON | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| metaData | back to summary |
|---|---|
| private @Nullable Map<String, String> metaData | |
| metaDataBase | back to summary |
|---|---|
| private @Nullable Map<String, String> metaDataBase | |
| newEntries | back to summary |
|---|---|
| private final Map<String, OfflineChanges. | |
| removedEntries | back to summary |
|---|---|
| private final Map<Integer, Integer> removedEntries | |
| OfflineChanges | back to summary |
|---|---|
| private OfflineChanges(Path file) | |
| fileName | back to summary |
|---|---|
| pack-priv static String fileName(DatabaseConnectionProperties properties) One file per database: identified by user, host, port and database name (or the JDBC URL in expert mode), hashed so that the name is file-system safe | |
| forget | back to summary |
|---|---|
| public synchronized void forget(Collection<BibEntry> entries) Drops the records of entries that reached the shared database after all | |
| forgetMetaData | back to summary |
|---|---|
| public synchronized void forgetMetaData() Drops the recorded metadata after it reached the shared database | |
| forgetRemovals | back to summary |
|---|---|
| public synchronized void forgetRemovals(Collection<Integer> sharedIds) Drops the records of removals that reached the shared database (or need not, because the shared entry is gone or was kept) | |
| isEmpty | back to summary |
|---|---|
| public synchronized boolean isEmpty() | |
| load | back to summary |
|---|---|
| public static OfflineChanges load(Path directory, DatabaseConnectionProperties properties) Loads the changes recorded for the given database, if any | |
| peek | back to summary |
|---|---|
| public synchronized OfflineChanges. Hands out everything recorded so far. The records are kept until each of them is written
(see the | |
| recordAsNew | back to summary |
|---|---|
| public synchronized void recordAsNew(int sharedId, BibEntry entry) Turns the record of a change into the record of a new entry, because the shared entry it was recorded against is gone and the entry is inserted afresh instead. One step, so that no moment exists in which the entry is recorded as neither. | |
| recordChange | back to summary |
|---|---|
| public synchronized void recordChange(BibEntry entry) | |
| recordInsert | back to summary |
|---|---|
| public synchronized void recordInsert(List<BibEntry> entries) | |
| recordMetaData | back to summary |
|---|---|
| public synchronized void recordMetaData(Map<String, String> serializedMetaData, @Nullable Map<String, String> base) | |
| recordRemoval | back to summary |
|---|---|
| public synchronized void recordRemoval(List<BibEntry> entries) | |
| rekeyInserts | back to summary |
|---|---|
| public synchronized void rekeyInserts(Map<String, BibEntry> restoredEntriesByRecordedId) Re-keys the records of new entries restored after a restart under fresh local ids, so that a failed insert records them under the ids it knows instead of next to the old records | |
| reload | back to summary |
|---|---|
| private void reload() Takes over what is on disk, so that a change is never applied to a snapshot another JabRef session has meanwhile written to. Called before every modification. ponytail: read and write are not one atomic step - two sessions recording at the very same moment can still lose a record; a lock file would close that window | |
| save | back to summary |
|---|---|
| private void save() | |
| snapshot | back to summary |
|---|---|
| private OfflineChanges. | |
baseVersion is the shared version the change was made
against: the optimistic lock needs it to notice that the shared entry moved on meanwhile.
mergeMetaDataInto
peek. New entries are keyed by their local entry id, so
that a reconnect without restart finds them in the local library.