Is it possible to retrieve license information using the plain java API?
Jared Russell (1.3k●1●20●19)
| asked Sep 04 '12, 10:26 a.m.
retagged Oct 04 '12, 5:06 p.m. by Guido Schneider (3.4k●14●91●115)
Using the plain java API I'd like to get information about what licenses a particular IContributor has assigned to them. Looking at the javadocs, the ILicenseAdminService interface provides the methods I'm after, however as far as I can tell this is only available to server side participants because calling ITeamRepository#getClientLibrary(ILicenseAdminService.class) returns null.
Is there any way of getting a handle to an ILicenseAdminService instance using the client-side java API, or are there any alternative APIs that would allow me to achieve the same result?
Thanks
|
Accepted answer
Here is some code I am using on the client to allocate a license
public boolean allocateLicense(Contributor contributor, String license) throws Exception Ralph Schoon selected this answer as the correct answer
|
3 other answers
Ralph Schoon (63.3k●3●36●46)
| answered Mar 29 '17, 8:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Here a working example with downloadable code: https://rsjazz.wordpress.com/2017/03/29/managing-contributor-licenses-using-the-plain-java-client-libraries/ |
This does not work with the RTC Plain Java API.
There's something like repository.getClientLibrary(ILicenseClient.class).. however, it does not seem to be too useful. Comments
Kevin Mayfield
commented Jul 18 '13, 12:28 p.m.
it works for me. I wrote getTeamRepository() method, but the rest is Plain Java lib calls.
Florian Georg
commented Jul 18 '13, 3:54 p.m.
Found out - the trick is that you have to do a cast to internal API:
com.ibm.team.repository.client.ITeamRepository must be cast to com.ibm.team.repository.client.internal.TeamRepositoryas this implements com.ibm.team.repository.client.util.IClientLibraryContext. Then the necessary method getServiceInterface(Class) will be available and works as described above. This took me some time to figure out and is not nice, as it depends on internal non-public API. |
from the client side it would be in the SDK\plugins folder, com.ibm.team.repository.common.
because its in the common jar, its usable by both (typically) |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.