public void registerAddOn ( AddOnModel addOn ) { PluginDescriptor descriptor = addOn . getPlugin ( ) . getDescriptor ( ) ; String name = descriptor . getTitle ( ) ; String version = descriptor . getVersion ( ) . toString ( ) ; String provider = descriptor . getProvider ( ) ; String id = descriptor . getPluginId ( ) ; String sdkVersion = descriptor . getSdkVersion ( ) . toString ( ) ; String artifactID = descriptor . getArtifactID ( ) ; Optional < Integer > serverID = descriptor . getServerID ( ) ; try { AddOnInformation addOnInformation = new AddOnInformationImpl ( name , provider , version , id , sdkVersion , serverID , artifactID ) ; addOnInformations . add ( addOnInformation ) ; addOns . add ( addOn ) ; } catch ( MissingArgumentException e ) { error ( "Unable to register addOn: " + addOn . getID ( ) + " with the AddOnInformationManager" , e ) ; } }
Registers an addOn with the AddOnInformationManager by extracting all relevant information from the addOn and adding it the the sets .