RetrievedProvider

data class RetrievedProvider(val json: Provider) : Validatable

This class represents a "retrieved" provider (i.e., the roles "publisher", "provider" and "trusted provider"), including its metadata (in the form of Provider) as well as functionality to retrieve its documents.

Constructors

Link copied to clipboard
constructor(json: Provider)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val json: Provider
Link copied to clipboard
open override val role: Role

The role of this RetrievedProvider (publisher, provider, trusted provider), required for checking the validity of the provider itself and the documents downloaded by it.

Functions

Link copied to clipboard
suspend fun countExpectedDocuments(loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY, startingFrom: Instant? = null): Int

This function sums up the expected number of RetrievedDocuments that will be fetched from this Provider.

Link copied to clipboard
fun countExpectedDocumentsBlocking(startingFrom: Instant? = null, loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY): <Error class: unknown class>

This function sums up the expected number of RetrievedDocuments that will be fetched from this Provider, blocking the calling Thread for Java compatibility.

Link copied to clipboard
fun fetchAllDocumentUrls(loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY, startingFrom: Instant? = null): ReceiveChannel<Result<String>>

Returns a channel that produces all URLs from ROLIE feeds and directory indices without duplicates.

Link copied to clipboard
fun fetchDocumentIndices(loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY, useChangesCsv: Boolean = false): ReceiveChannel<Pair<String, Result<String>>>

This function fetches all directory indices or changes.csv files referenced by this provider and sends them to a ReceiveChannel.

Link copied to clipboard
fun fetchDocuments(loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY, startingFrom: Instant? = null): ReceiveChannel<Result<RetrievedDocument>>

This function fetches all CSAF documents that are listed by this provider.

Link copied to clipboard
fun fetchRolieFeeds(loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY): ReceiveChannel<Pair<Provider.Feed, Result<ROLIEFeed>>>

This function fetches all ROLIE feeds referenced by this provider and sends them to a ReceiveChannel.

Link copied to clipboard
fun streamDocuments(startingFrom: Instant? = null, loader: CsafLoader = lazyLoader, channelCapacity: Int = DEFAULT_CHANNEL_CAPACITY): Stream<ResultCompat<RetrievedDocument>>

This method provides the Results of fetchDocuments as a Java Stream for usage in non-Kotlin environments.

Link copied to clipboard
open fun validate(retrievalContext: RetrievalContext)

Validates this Validatable according to the CSAF standard.