We'd like to match Atlassian academic discount with the same discount for our plugin, but we'll need to check whether JIRA runs on an academic license from Atlassian. Looking at com.atlassian.jira.license.LicenseDetails class, I don't see any method like isAcademic().
Is it possible to tell whether JIRA runs on an academic license?
Community moderators have prevented the ability to post new answers.
Just looking at this now, from what I can see, the LicenseDetails class does implement isAcademicLicense() however, its private for some reason unlike all the others. Given the LicenseDetails class also doesn't expose the underlying JiraLicense object it's not possible to directly re-implement the method which would be 'easy'.
What I think may work, is testing for isUnlimitedNumberOfUsers() and verifying that all other known license types are not matches (ie not Commercial, not Open Source (sigh)), going to give that a spin myself. Anyone have a better idea?
Yeah, thanks - I think going through reflection for isAcademicLicense is the best way, but IF it would really return true in the case of an academic license. This needs to be verified - since it is not part of the public API, our assumption based on the sources may be wrong. For example if academic license is actually a 50% discount for a normal commercial license.
(Checking for isUnlimitedNumberOfUsers, as you suggest, does not make sense to me - can't academic license be less than unlimited?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yea quite right, best way is reflection, for anyone passing:
boolean isAcademic=false; try { Method method = jiraLicense.getClass().getDeclaredMethod("isAcademicLicense"); method.setAccessible(true); Object result = method.invoke(jiraLicense); isAcademic=((Boolean)result).booleanValue(); } catch (Exception e) { //do something e.printStackTrace(); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.