Class HarvestSourceCatalog
java.lang.Object
org.javastro.ivoa.registry.internal.HarvestSourceCatalog
Persistent catalog of known harvest sources, backed by a BaseX XML document at
Registry/harvest/sources.xml.
An in-memory ConcurrentHashMap is kept in sync with BaseX so that
hot-path reads never need a database round-trip. All mutating operations
persist the full catalog document back to BaseX immediately. Serialization
and deserialization are handled by JAXB.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRunRecord(String sourceKey, HarvestRunRecord record) booleanintcount()getAll()voidinit()Idempotent initialisation.voidupdateLastAttempted(String sourceKey, Instant ts) voidupdateLastSuccessful(String sourceKey, Instant ts) voidupdateStatus(String sourceKey, SourceStatus status) voidupdateStatus(String sourceKey, SourceStatus status, String rejectionReason) upsert(HarvestSource source) Insert or update a source.
-
Constructor Details
-
HarvestSourceCatalog
-
-
Method Details
-
init
public void init()Idempotent initialisation. Creates the catalog document in BaseX if it does not yet exist, then loads any previously persisted sources into the in-memory cache. -
upsert
Insert or update a source. If a source with the samesourceKeyalready exists itsstatus,lastSeen,identifier, andoaiUrlfields are refreshed; provenance (discoveredFromSourceKey,depth,firstSeen) is preserved.- Returns:
- the stored source (after merge)
-
get
-
getAll
-
count
public int count() -
contains
-
updateStatus
-
updateStatus
-
updateLastAttempted
-
updateLastSuccessful
-
appendRunRecord
-