Hi,
We are trying to make use of Licensing framework in our plugin (for marketplace).
We are running this plugin in standalone version of Jira.
Before we can go to the next step we must ensure that we understand licensing process correctly.
Assume the license is invalid becouse number of users is mismatch.
Who is responsible for locking (disabling) plugin functionality - framework itself or maybe we should include additional code which check if license is valid and if no then disable some functionality?
Is there any api available for such kind of task?
Best Regards
Community moderators have prevented the ability to post new answers.
Ahh, I think I've found the missing link. If add my internal class as a component in atlassian-plugin.xml, then I looks like can use constructor injection there as well.
How do I get ahold of the ThirdPartyPluginLicenseStorageManager object ? I can't get it to autowire.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should include additional code to check the license and to eventually disable some functionality or display helpful information.
Just use the ThirdPartyPluginLicenseStorageManager and the methods provided to check the license state, you can find its javadocs here: https://developer.atlassian.com/static/javadoc/upm/plugin-license-storage-lib/2.1/reference/com/atlassian/upm/license/storage/lib/ThirdPartyPluginLicenseStorageManager.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do I get ahold of the ThirdPartyPluginLicenseStorageManager object ? I can't get it to autowire.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Take a look at this tutorial. It should get you started.
https://developer.atlassian.com/display/UPM/How+to+Add+Licensing+Support+to+Your+Add-on
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've already been there, and the example classes work fine, but when I autowire one of my internal classes with ContainerManager.autowireComponent, the ThirdPartyPluginLicenseStorageManager field continues to be null. I haven't been able to find any useful documentation on that object at all, especially not on how it is autowired.
I've since found out that I can use constructor injection in my macro class to get the ThirdPartyPluginLicenseStorageManager, then inject it into my internal class. This seems to go against good practice, and is also just plain undesirable in my setup, where I have a bunch of macro classes that use the same internal class.
Why doesn't ContainerManager.autowireComponent work as expected?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know much about ContainerManager.autowireComponent and as a result I can't speak about it in full confidence. But what I do know is that there are several rather complex components within the License API which may cause something like this to happen. For example, the License API uses OSGi's dynamic import packages and also has several optional services. Neither of these are typically used for most plugin components.
I can't say if any of these differences between the License API and regular plugin components would make a difference, but they may.
As for using ContainerManager versus constructor injection, there is nothing wrong with using constructor injection at all - in fact, it makes many things (testing, for example) much easier and flexible. There are many many documents out there describing why constructor injection (or dependency injection in general) is a good practice. I'd recommend you use constructor injection for the License API regardless.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.