public interface ServiceProvider
A service provider interface that facilitates the management of music-related resources and operations, including
caching, fetching, orchestration, and type conversion. This may be switched by the Qilletni program through the use
of a
DynamicProvider.-
Method Summary
Modifier and TypeMethodDescriptionGets theMusicCachecreated after initialization.Gets theMusicFetchercreated after initialization.Gets theMusicTypeConvertercreated after initialization.getName()Gets the name of the provider.Gets thePlayActorcreated after initialization.getStringIdentifier(SongTypeFactory songTypeFactory, CollectionTypeFactory collectionTypeFactory, AlbumTypeFactory albumTypeFactory) Gets theStringIdentifier.Gets theTrackOrchestratorcreated after initialization.initialize(BiFunction<PlayActor, MusicCache, TrackOrchestrator> defaultTrackOrchestratorFunction, PackageConfig packageConfig) Initializes the service provider.voidshutdown()Shuts down the service provider.
-
Method Details
-
initialize
CompletableFuture<Void> initialize(BiFunction<PlayActor, MusicCache, TrackOrchestrator> defaultTrackOrchestratorFunction, PackageConfig packageConfig) Initializes the service provider. This populatesgetMusicCache(),getMusicFetcher(), andgetTrackOrchestrator().- Parameters:
defaultTrackOrchestratorFunction- If the service provider doesn't implement a custom,TrackOrchestrator, it should run this function to create the default implementation of one and use it.packageConfig- ThePackageConfigfor the service provider. This provides persistent storage for the package. UsePackageConfig.loadConfig()to load the configuration.- Returns:
- The created future of the initialization
-
shutdown
void shutdown()Shuts down the service provider. This should clean up any async tasks currently running. -
getName
-
getMusicCache
MusicCache getMusicCache()Gets theMusicCachecreated after initialization.- Returns:
- The created
MusicCache
-
getMusicFetcher
MusicFetcher getMusicFetcher()Gets theMusicFetchercreated after initialization.- Returns:
- The created
MusicFetcher
-
getTrackOrchestrator
TrackOrchestrator getTrackOrchestrator()Gets theTrackOrchestratorcreated after initialization.- Returns:
- The created
TrackOrchestrator
-
getMusicTypeConverter
MusicTypeConverter getMusicTypeConverter()Gets theMusicTypeConvertercreated after initialization.- Returns:
- The created
MusicTypeConverter
-
getStringIdentifier
StringIdentifier getStringIdentifier(SongTypeFactory songTypeFactory, CollectionTypeFactory collectionTypeFactory, AlbumTypeFactory albumTypeFactory) Gets theStringIdentifier.- Returns:
- The created
StringIdentifier
-
getPlayActor
-