License & repo permission information using RTC Plain Java API ?
Is there a way to get a list of assigned licenses and repository roles (jazzUser, jazzAdmin ...) from the RTC Plain Java Client ?
I found some info for the server-side API: ILicenseAdminService licAdminService = (ILicenseAdminService) ((TeamRepository) teamRepository).getServiceInterface(ILicenseAdminService.class); However, this does not work on the client side. The only thing I can get is teamRepository.getClientLibrary(ILicenseClient.class) This does not seem to provide API for finding out enough about license assignments for contributors. |
Accepted answer
Jared Burns (4.5k●2●9)
| answered Jul 16 '13, 11:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 16 '13, 11:36 a.m.
There isn't a client library for the license admin service, but your client code can invoke the remote service itself. In your client library, it would look something like this:
public IContributorLicenseType[] getLicenseTypes(IProgressMonitor monitor) throws TeamRepositoryException {
final ILicenseAdminService licenseAdminService = (ILicenseAdminService) clientLibraryContext.getServiceInterface(ILicenseAdminService.class);
return (IContributorLicenseType[]) clientLibraryContext.callCancelableService(new IClientLibraryContext.IServiceRunnable() {
public Object run(IProgressMonitor monitor) throws TeamRepositoryException {
return licenseAdminService.getLicenseTypes();
}
}, monitor);
}
Florian Georg selected this answer as the correct answer
Comments
Florian Georg
commented Jul 16 '13, 12:06 p.m.
thanks, but from where do I get the "clientLibraryContext" from your example?
object, which for example provides
|
2 other answers
Hey ,
with the same context I am getting null pointer exception on line 3 of code below. remeber my teamRepository object is not null and logged in before I come to this line of code. ============================================================== System.out.println("Logged In "+teamRepository.loggedIn()); IClientLibraryContext clientLibraryContext = (IClientLibraryContext) teamRepository.getClientLibrary(IClientLibraryContext.class); final ILicenseAdminService licenseAdminService = (ILicenseAdminService) clientLibraryContext.getServiceInterface(ILicenseAdminService.class); ============================================================== it says true NULL pointer Exception. ============================================================ Am I missing something ? Thanks - Praveen |
Ralph Schoon (63.5k●3●36●46)
| answered Mar 29 '17, 8:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER See https://rsjazz.wordpress.com/2017/03/29/managing-contributor-licenses-using-the-plain-java-client-libraries/ for how to get the ILicenseAdminService |
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.