It's all about the answers!

Ask a question

Problem getting list of components from Jazz Team Server


Atul Kumar (1872329) | asked Sep 29 '11, 1:54 a.m.
I need to fetch the components deployed on the server.

For this, I got the reference of IServerStatusRestService through JTS, and called its APIs to get the list of components (Steps detailed at the end). This works fine when I launch it through workbench. But, when the plugin is installed, it through error "missing plugin".

As a temporary fix, added the repository_service.jar in the lib folder and bundled it in the installer. Removed the plugin from the dependency list. Now the plugin gets installed. But at runtime its throwing java.lang.ArrayStoreException. If I keep the plugin in the dependency list, the connector does not get installed. But it executes from the workbench.

Is there an alternate way to get the list of components from Jazz Team Server ? (i.e., https://localhost:9443/ccm/admin#action=com.ibm.team.repository.admin.componentStatus)

*****************************************************
I used following steps to get the list of components:

1. Instantiate the team server:
ITeamServer teamServer = TeamServerFactory.INSTANCE.newTeamServerFromURL(repository.getRepositoryURI(), getCertificateHandler()); (Wrote a certificate handler to accept all certificates)

2. Set the credentials:
UsernameAndPasswordLoginInfo loginInfo = (UsernameAndPasswordLoginInfo)repository.getLoginInfo();
teamServer.setCredentials(repository.getUserId(), loginInfo.getPassword());

3. Get the REST service reference:
ITeamService service = teamServer.getService(IServerStatusRestService.class);

4. Get the method reference for components and status:
Method m = service.getMethod("getComponentsAndStatus");

5. Invoke the method:
ComponentStatusDTO[] statusDTOs = (ComponentStatusDTO[])service.invoke(service, m, new Object[]{});

6. Iterate over the components:
for(ComponentStatusDTO status:statusDTOs) System.out.println("Component ID: " + status.getComponent().getId());

Accepted answer


permanent link
Atul Kumar (1872329) | answered Nov 18 '14, 5:21 a.m.
A detailed article on using JAZZ APIs for finding components.deployed on a JTS server:

https://jazz.net/library/article/1457
Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented Nov 18 '14, 5:58 a.m. | edited Nov 18 '14, 5:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I have missed this question. http://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ also explains how to do that with the API.

Another option would be to use the RTC SCM command line.


Atul Kumar commented Nov 18 '14, 6:05 a.m.

@Ralph - There is a difference between this question, and the article I mentioned.

The word "Component" is causing confusion here. In my article, its NOT about components, as is used in source-code control, its about JTS server's components, like preconditions, and other configurable components.


Ralph Schoon commented Nov 18 '14, 6:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Ah, sorry, there are a lot of terms that are heavily overused in software.


Atul Kumar commented Nov 18 '14, 6:33 a.m.

True that :)

One other answer



permanent link
Atul Kumar (1872329) | answered Oct 10 '11, 7:12 a.m.
I just need to fetch the list of components deployed on the Jazz Team Server, is there an alternative way to do so ?

I need to fetch the components deployed on the server.

For this, I got the reference of IServerStatusRestService through JTS, and called its APIs to get the list of components (Steps detailed at the end). This works fine when I launch it through workbench. But, when the plugin is installed, it through error "missing plugin".

As a temporary fix, added the repository_service.jar in the lib folder and bundled it in the installer. Removed the plugin from the dependency list. Now the plugin gets installed. But at runtime its throwing java.lang.ArrayStoreException. If I keep the plugin in the dependency list, the connector does not get installed. But it executes from the workbench.

Is there an alternate way to get the list of components from Jazz Team Server ? (i.e., https://localhost:9443/ccm/admin#action=com.ibm.team.repository.admin.componentStatus)

*****************************************************
I used following steps to get the list of components:

1. Instantiate the team server:
ITeamServer teamServer = TeamServerFactory.INSTANCE.newTeamServerFromURL(repository.getRepositoryURI(), getCertificateHandler()); (Wrote a certificate handler to accept all certificates)

2. Set the credentials:
UsernameAndPasswordLoginInfo loginInfo = (UsernameAndPasswordLoginInfo)repository.getLoginInfo();
teamServer.setCredentials(repository.getUserId(), loginInfo.getPassword());

3. Get the REST service reference:
ITeamService service = teamServer.getService(IServerStatusRestService.class);

4. Get the method reference for components and status:
Method m = service.getMethod("getComponentsAndStatus");

5. Invoke the method:
ComponentStatusDTO[] statusDTOs = (ComponentStatusDTO[])service.invoke(service, m, new Object[]{});

6. Iterate over the components:
for(ComponentStatusDTO status:statusDTOs) System.out.println("Component ID: " + status.getComponent().getId());

Your answer


Register or to post 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.