Package com.io7m.coffeepick.api
Interface CoffeePickCatalogType
-
- All Known Implementing Classes:
CoffeePickCatalog
public interface CoffeePickCatalogTypeThe interface exposed by the catalog. A catalog represents an aggregated set of repositories over which searches can be performed. Essentially, the catalog is the set of runtimes that the user can get. Contrast this to the inventory, which represents the set of runtimes that the user currently has.- See Also:
CoffeePickInventoryType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Observable<CoffeePickCatalogEventType>events()Access the stream of events published by the catalog when the state of the catalog changes.java.io.InputStreamfetch(java.lang.String id)java.util.List<RuntimeRepositoryType>listRepositories()java.util.Map<java.lang.String,RuntimeDescription>search(CoffeePickSearch parameters)Search for all runtimes matching the given parameters.default java.util.Map<java.lang.String,RuntimeDescription>searchAll()default java.util.Optional<RuntimeDescription>searchExact(java.lang.String id)default RuntimeDescriptionsearchExactOrFail(java.lang.String id)default voidupdateRepository(java.net.URI uri)Update the repository with the given URI.voidupdateRepository(java.net.URI uri, CoffeePickIsCancelledType cancelled)Update the repository with the given URI.
-
-
-
Method Detail
-
events
io.reactivex.rxjava3.core.Observable<CoffeePickCatalogEventType> events()
Access the stream of events published by the catalog when the state of the catalog changes.- Returns:
- A stream of events
-
search
java.util.Map<java.lang.String,RuntimeDescription> search(CoffeePickSearch parameters)
Search for all runtimes matching the given parameters.- Parameters:
parameters- The parameters- Returns:
- The matching runtimes
-
searchAll
default java.util.Map<java.lang.String,RuntimeDescription> searchAll()
- Returns:
- All runtimes in the inventory
-
searchExact
default java.util.Optional<RuntimeDescription> searchExact(java.lang.String id)
- Parameters:
id- The ID of the runtime- Returns:
- The runtime with the given ID
-
searchExactOrFail
default RuntimeDescription searchExactOrFail(java.lang.String id) throws java.io.FileNotFoundException
- Parameters:
id- The ID of the runtime- Returns:
- The runtime with the given ID
- Throws:
java.io.FileNotFoundException- If no runtime exists with the given ID
-
fetch
java.io.InputStream fetch(java.lang.String id) throws java.io.IOException- Parameters:
id- The ID of the runtime- Returns:
- An input stream representing the archive of the runtime
- Throws:
java.io.IOException- On I/O errors
-
updateRepository
void updateRepository(java.net.URI uri, CoffeePickIsCancelledType cancelled) throws java.lang.Exception, java.util.concurrent.CancellationExceptionUpdate the repository with the given URI. The method takes a functioncancelledthat will be evaluated repeatedly and, if the function returnstrueat any point, the operation will be cancelled.- Parameters:
uri- The URIcancelled- A function that returnstrueif the operation should be cancelled- Throws:
java.lang.Exception- On errorsjava.util.concurrent.CancellationException- Ifcancelledreturnstruewhile the operation is running
-
updateRepository
default void updateRepository(java.net.URI uri) throws java.lang.ExceptionUpdate the repository with the given URI.- Parameters:
uri- The URI- Throws:
java.lang.Exception- On errors
-
listRepositories
java.util.List<RuntimeRepositoryType> listRepositories()
- Returns:
- An immutable snapshot of the current repositories
-
-