Profile Provider
Profile provider classes are created by profile provider factory objects
. They know how to read profiles from a source and add them to the Jancy profileRegistry
.
Methods
Profile providers must have the following methods.
profileProvider.getInfo()
Should return a string that describes the current state of provider. Used for display purposes.
profileProvider.getName()
Should return a string that will be used in various parts of the application.
profileProvider.getState()
Should return data specific to this instance that will be serialized to disk and passed back to recreate the instance when Jancy restarts.
profileProvider.loadProfiles(providerId)
providerId
(string
) this providers unique ID assigned by Jancy.
This method will be called to load profiles from the source represented by the provider. This method should return a promise
that resolves when all the profiles have been loaded with a boolean
value that indicates if the profiles have been loaded or not.
Profiles found by the provider should added to Jancy using profileRegistry.addProfile()
method.