ConfigurationLoaderDelegate
public protocol ConfigurationLoaderDelegate : AnyObject
Delegate pattern used by ConfigurationLoader.
-
Delegate method called by
ConfigurationLoader.loadConfiguration(userInputs:)when configuration data is found, or when the queue has been exhausted with no data found.Declaration
Swift
func configurationProvider(_ provider: ConfigurationProviding?, didCompleteWith result: Bool)Parameters
providerThe configuration provider in the loader’s queue that obtained configuration data, or the last item in the queue if no data was found. Optional to support case where an empty queue was submitted.
resultThe result of the returned provider’s attempt to retrieve configuration data (see
ConfigurationProviding.provideConfiguration(input:)).trueif data was found; otherwise,false. -
Delegate method called by
ConfigurationLoaderwhen an error is encountered during the call to a provider’sConfigurationProviding.provideConfiguration(input:).Declaration
Swift
func configurationProvider(_ provider: ConfigurationProviding, didEncounter error: Error)Parameters
providerThe configuration provider in the loader’s queue that encountered the error.
errorThe
Errorencountered by the configuration provider. -
Delegate method called by
ConfigurationLoader.loadConfiguration(userInputs:)after its queue’s input requirements have been gathered. This method will only be called if input is needed and was not supplied duringConfigurationLoader.loadConfiguration(userInputs:).Example of
inputobject for aDiscoveryServiceConfigurationProvider; note the empty value for theemailAddresskey:var input = ["com.sap.configuration.provider.discoveryservice": ["emailAddress": ""]]Declaration
Swift
func configurationProvider(_ loader: ConfigurationLoader, requestedInput: [String : [String : Any]], completionHandler: @escaping (_ input: [String : [String : Any]]) -> Void)