Commits

Jacek Jaroczynski committed 4e7d8c4

rest (components via REST)

Comments (0)

Files changed (3)

com.atlassian.connector.eclipse.jira.core/src/com/atlassian/connector/eclipse/internal/jira/core/service/JiraClient.java

 
 	public Component[] getComponents(String projectKey, IProgressMonitor monitor) throws JiraException {
 		JiraCorePlugin.getMonitoring().logJob("getComponents", null); //$NON-NLS-1$
-		return soapClient.getComponents(projectKey, monitor);
+
+		return restClient.getComponents(projectKey);
+
+//		return soapClient.getComponents(projectKey, monitor);
 	}
 
 	public synchronized JiraLocalConfiguration getLocalConfiguration() {
 	 */
 	public String getKeyFromId(final String issueId, IProgressMonitor monitor) throws JiraException {
 		JiraCorePlugin.getMonitoring().logJob("getKeyFromId", null); //$NON-NLS-1$
+		// it is used only in tests
 		return soapClient.getKeyFromId(issueId, monitor);
 	}
 

com.atlassian.connector.eclipse.jira.core/src/com/atlassian/connector/eclipse/internal/jira/core/service/rest/JiraRestClientAdapter.java

 
 import org.eclipse.core.runtime.IProgressMonitor;
 
+import com.atlassian.connector.eclipse.internal.jira.core.model.Component;
 import com.atlassian.connector.eclipse.internal.jira.core.model.IssueType;
 import com.atlassian.connector.eclipse.internal.jira.core.model.JiraIssue;
 import com.atlassian.connector.eclipse.internal.jira.core.model.JiraStatus;
 
 		return fullIssues;
 	}
+
+	public Component[] getComponents(String projectKey) {
+		return JiraRestConverter.convertComponents(restClient.getProjectClient()
+				.getProject(projectKey, new NullProgressMonitor())
+				.getComponents());
+	}
 }

com.atlassian.connector.eclipse.jira.core/src/com/atlassian/connector/eclipse/internal/jira/core/service/rest/JiraRestConverter.java

 		return outVersion;
 	}
 
-	private static Component[] convertComponents(Iterable<BasicComponent> components) {
+	static Component[] convertComponents(Iterable<BasicComponent> components) {
 
 		List<Component> outComponents = new ArrayList<Component>();