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
provider
The 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.
result
The result of the returned provider’s attempt to retrieve configuration data (see
ConfigurationProviding.provideConfiguration(input:)
).true
if data was found; otherwise,false
. -
Delegate method called by
ConfigurationLoader
when an error is encountered during the call to a provider’sConfigurationProviding.provideConfiguration(input:)
.Declaration
Swift
func configurationProvider(_ provider: ConfigurationProviding, didEncounter error: Error)
Parameters
provider
The configuration provider in the loader’s queue that encountered the error.
error
The
Error
encountered 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
input
object for aDiscoveryServiceConfigurationProvider
; note the empty value for theemailAddress
key: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)