Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.logic.search

public Class LinkedFilesIndexManager

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.io.IOException, java.util.List, .Optional, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicBoolean, javafx.beans.property.BooleanProperty, javafx.beans.value.ChangeListener, org.jabref.logic.FilePreferences, org.jabref.logic.search.sqlbased.LuceneIndexer, org.jabref.logic.search.sqlbased.indexing.DefaultLinkedFilesIndexer, .ReadOnlyLinkedFilesIndexer, org.jabref.logic.search.sqlbased.retrieval.LinkedFilesSearcher, org.jabref.logic.util.BackgroundTask, .DelayTaskThrottler, .TaskExecutor, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.entry.event.FieldChangedEvent, org.jabref.model.entry.field.StandardField, org.jabref.model.search.query.SearchQuery, .SearchResults, org.jspecify.annotations.NullMarked, .Nullable, org.slf4j.Logger, .LoggerFactory

Maintains the Lucene index for linked files independently of the metadata search backend.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final DelayTaskThrottler
private final LuceneIndexer
private final LinkedFilesSearcher
private static final Logger
private final ConcurrentHashMap<String, LinkedFilesIndexManager.FileDelta>
private final ChangeListener<Boolean>
private final BooleanProperty
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
LinkedFilesIndexManager(BibDatabaseContext databaseContext, TaskExecutor taskExecutor, FilePreferences filePreferences)

Method Summary

Modifier and TypeMethod and Description
public void
private void
bindToPreferences(boolean newValue)

public void
public void
private void
closeThrottler(boolean waitForShutdown)

private static String
public void
public void
public SearchResults
public void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
private final AtomicBoolean closed
indexUpdateThrottlerback to summary
private final DelayTaskThrottler indexUpdateThrottler
linkedFilesIndexerback to summary
private final LuceneIndexer linkedFilesIndexer
linkedFilesSearcherback to summary
private final LinkedFilesSearcher linkedFilesSearcher
LOGGERback to summary
private static final Logger LOGGER
pendingFileValuesByEntryback to summary
private final ConcurrentHashMap<String, LinkedFilesIndexManager.FileDelta> pendingFileValuesByEntry
preferencesListenerback to summary
private final ChangeListener<Boolean> preferencesListener
shouldIndexLinkedFilesback to summary
private final BooleanProperty shouldIndexLinkedFiles
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

LinkedFilesIndexManagerback to summary
public LinkedFilesIndexManager(BibDatabaseContext databaseContext, TaskExecutor taskExecutor, FilePreferences filePreferences)

Method Detail

addToIndexback to summary
public void addToIndex(List<BibEntry> entries)
bindToPreferencesback to summary
private void bindToPreferences(boolean newValue)
closeback to summary
public void close()
closeAndWaitback to summary
public void closeAndWait()
closeThrottlerback to summary
private void closeThrottler(boolean waitForShutdown)
normalizeNullToEmptyback to summary
private static String normalizeNullToEmpty(@Nullable String value)
rebuildIndexback to summary
public void rebuildIndex()
removeFromIndexback to summary
public void removeFromIndex(List<BibEntry> entries)
searchback to summary
public SearchResults search(SearchQuery query)
updateEntryback to summary
public void updateEntry(FieldChangedEvent event)
updateOnStartback to summary
private void updateOnStart()
org.jabref.logic.search back to summary

private final Record LinkedFilesIndexManager.FileDelta

extends Record
Class Inheritance
Record Components
oldValue:String 
newValue:String 

Field Summary

Modifier and TypeField and Description
private final String
newValue

Record Component accessed by newValue().

private final String
oldValue

Record Component accessed by oldValue().

Constructor Summary

AccessConstructor and Description
private
FileDelta(String oldValue, String newValue)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String
newValue()

Record Component getter of newValue.

public String
oldValue()

Record Component getter of oldValue.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

newValueback to summary
private final String newValue

Record Component accessed by newValue().

oldValueback to summary
private final String oldValue

Record Component accessed by oldValue().

Constructor Detail

FileDeltaback to summary
private FileDelta(String oldValue, String newValue)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

newValueback to summary
public String newValue()

Record Component getter of newValue.

oldValueback to summary
public String oldValue()

Record Component getter of oldValue.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.