How to get RTC Stream URL from Java API
Hello All,
I need to get the Stream URL from Java API.
This URL will be stored for documentation purpose and when user paste this link in browser, it should get resolved and navigate to corresponding stream in browser
Regards,
Chandan
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Nov 18 '21, 8:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I am not totally sure if this works for you, but I would suggest to look into logger.info("Publish links to build result..."); IBuildResult buildResult = BuildUtil.getBuildResult(teamRepository, buildResultUUID, monitor); Chandan M B selected this answer as the correct answer
Comments
Chandan M B
commented Nov 18 '21, 8:42 a.m.
Thanks Ralph.
I will test this. How about getting the component url. Is it the similar way ?
My current output based on above code will lead like below
Look at the URIUtil it uses available code to get the URI from a handle. The API know how to make the rest.
public static URI getURIForItem(IItemHandle item) {
Location location = Location.itemLocation(item, getPublicURI(item));
return location.toAbsoluteUri();
}
Should not be too difficult to get the code and test it.
Chandan M B
commented Nov 18 '21, 11:22 a.m.
Thanks Ralph.
Both the way works. I opted for URIUtil to get both Stream and Component URI.
|
One other answer
I tried the constructing the Stream URL from Java API.
Thanks to Ralph blog scm
Code Snippet
private static String BASE_STREAM_URL = "resource/itemOid/com.ibm.team.scm.Workspace/"; TeamPlatform.startup(); String repositoryURI = "https://xxx/ccm"; String userId = "xxx"; String password = "xxx"; ITeamRepository teamRepository = TeamPlatform .getTeamRepositoryService().getTeamRepository(repositoryURI); teamRepository.registerLoginHandler(new LoginHandler(userId, password)); teamRepository.login(null); private static List<IWorkspaceHandle> findConnections(IWorkspaceManager workspaceManager,IWorkspaceSearchCriteria criteria) throws TeamRepositoryException { List<IWorkspaceHandle> connections = workspaceManager.findWorkspaces(criteria, Integer.MAX_VALUE, null); return connections; } |
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.