Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-08-12 19:03:22 +0000
committerfbecker2010-08-12 19:03:22 +0000
commitf764c737fbace31c9f8d0a01ba9e8298ecaa186a (patch)
tree9e786803ec7fe4b0fdeb1995b072537194ebfeaa /org.eclipse.mylyn.bugzilla.core
parentea46e03be3f0fb86adce4f035cbebe1149d3fda5 (diff)
downloadorg.eclipse.mylyn.tasks-f764c737fbace31c9f8d0a01ba9e8298ecaa186a.tar.gz
org.eclipse.mylyn.tasks-f764c737fbace31c9f8d0a01ba9e8298ecaa186a.tar.xz
org.eclipse.mylyn.tasks-f764c737fbace31c9f8d0a01ba9e8298ecaa186a.zip
ASSIGNED - bug 282211: [patch] create Webservice API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282211
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java78
4 files changed, 44 insertions, 48 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index aac67e2b1..b3b1cf6e2 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -693,12 +693,12 @@ public class BugzillaClient {
if (!repositoryConfiguration.getProducts().isEmpty()) {
repositoryConfiguration.setRepositoryUrl(repositoryUrl.toString());
- repositoryConfiguration.setValidTransitions(
+ repositoryConfiguration.setValidTransitions(monitor,
configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE),
useXml);
return repositoryConfiguration;
} else {
- repositoryConfiguration.setValidTransitions(
+ repositoryConfiguration.setValidTransitions(monitor,
configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE),
useXml);
if (attempt == 0) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
index 07adba388..87647fa2d 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.apache.xmlrpc.XmlRpcException;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -318,7 +319,7 @@ public class CustomTransitionManager implements Serializable {
}
}
- public void parse(BugzillaXmlRpcClient xmlClient) {
+ public void parse(IProgressMonitor monitor, BugzillaXmlRpcClient xmlClient) {
// if (usedXml) {
// //XMLRPC should not change, don't look it up again
// return;
@@ -335,7 +336,7 @@ public class CustomTransitionManager implements Serializable {
try {
String[] fields = new String[1];
fields[0] = "bug_status"; //$NON-NLS-1$
- for (Object raw : xmlClient.getFieldsWithNames(fields)) {
+ for (Object raw : xmlClient.getFieldsWithNames(monitor, fields)) {
if (raw instanceof HashMap<?, ?>) {
Object[] values = (Object[]) ((HashMap<?, ?>) raw).get("values"); //$NON-NLS-1$
if (values == null) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index 711f18f1f..8df2b5c7a 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
@@ -345,7 +346,7 @@ public class RepositoryConfiguration implements Serializable {
*
* @param fileName
*/
- public void setValidTransitions(String fileName, boolean useXmlRpc) {
+ public void setValidTransitions(IProgressMonitor monitor, String fileName, boolean useXmlRpc) {
//Custom transitions only possible for newer versions of Bugzilla
if (getInstallVersion() != null && getInstallVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0) {
return;
@@ -359,7 +360,7 @@ public class RepositoryConfiguration implements Serializable {
}
WebLocation webLocation = new WebLocation(getRepositoryUrl() + "/xmlrpc.cgi"); //$NON-NLS-1$
BugzillaXmlRpcClient xmlClient = new BugzillaXmlRpcClient(webLocation);
- validTransitions.parse(xmlClient);
+ validTransitions.parse(monitor, xmlClient);
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index 64114533a..c81180b51 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -16,7 +16,7 @@ import java.util.HashMap;
import org.apache.commons.httpclient.HttpClient;
import org.apache.xmlrpc.XmlRpcException;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
@@ -98,51 +98,47 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
super(location);
}
- public String getVersion() throws XmlRpcException {
+ public String getVersion(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<String>(this) {
@Override
public String execute() throws XmlRpcException {
String result = ""; //$NON-NLS-1$
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_BUGZILLA_VERSION,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_BUGZILLA_VERSION, (Object[]) null);
result = response2String(response, XML_RESPONSE_VERSION);
return result;
}
}).execute();
}
- public Date getDBTime() throws XmlRpcException {
+ public Date getDBTime(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Date>(this) {
@Override
public Date execute() throws XmlRpcException {
Date result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_BUGZILLA_TIME,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_BUGZILLA_TIME, (Object[]) null);
result = response2Date(response, XML_RESPONSE_DB_TIME);
return result;
}
}).execute();
}
- public Date getWebTime() throws XmlRpcException {
+ public Date getWebTime(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Date>(this) {
@Override
public Date execute() throws XmlRpcException {
Date result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_BUGZILLA_TIME,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_BUGZILLA_TIME, (Object[]) null);
result = response2Date(response, XML_RESPONSE_WEB_TIME);
return result;
}
}).execute();
}
- public HashMap<?, ?> getTime() throws XmlRpcException {
+ public HashMap<?, ?> getTime(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<HashMap<?, ?>>(this) {
@Override
public HashMap<?, ?> execute() throws XmlRpcException {
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_BUGZILLA_TIME,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_BUGZILLA_TIME, (Object[]) null);
if (response != null) {
for (String exclude : XML_BUGZILLA_TIME_RESPONSE_TO_REMOVE) {
response.remove(exclude);
@@ -153,7 +149,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}).execute();
}
- public int login() throws XmlRpcException {
+ public int login(final IProgressMonitor monitor) throws XmlRpcException {
userID = -1;
final AuthenticationCredentials credentials = this.getLocation().getCredentials(AuthenticationType.REPOSITORY);
if (credentials != null) {
@@ -161,7 +157,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
@SuppressWarnings("serial")
@Override
public Integer execute() throws XmlRpcException {
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_USER_LOGIN,
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_USER_LOGIN,
new Object[] { new HashMap<String, Object>() {
{
put(XML_PARAMETER_LOGIN, credentials.getUserName());
@@ -180,12 +176,13 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
return userID;
}
- private Object[] getUserInfoInternal(final Object[] callParm) throws XmlRpcException {
+ private Object[] getUserInfoInternal(final IProgressMonitor monitor, final Object[] callParm)
+ throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_USER_GET, callParm);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_USER_GET, callParm);
result = response2ObjectArray(response, XML_RESPONSE_USERS);
return result;
}
@@ -193,8 +190,8 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
@SuppressWarnings("serial")
- public Object[] getUserInfoFromIDs(final Integer[] ids) throws XmlRpcException {
- return getUserInfoInternal(new Object[] { new HashMap<String, Object[]>() {
+ public Object[] getUserInfoFromIDs(final IProgressMonitor monitor, final Integer[] ids) throws XmlRpcException {
+ return getUserInfoInternal(monitor, new Object[] { new HashMap<String, Object[]>() {
{
put(XML_PARAMETER_IDS, ids);
}
@@ -202,40 +199,40 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
@SuppressWarnings("serial")
- public Object[] getUserInfoFromNames(final String[] names) throws XmlRpcException {
- return getUserInfoInternal(new Object[] { new HashMap<String, Object[]>() {
+ public Object[] getUserInfoFromNames(final IProgressMonitor monitor, final String[] names) throws XmlRpcException {
+ return getUserInfoInternal(monitor, new Object[] { new HashMap<String, Object[]>() {
{
put(XML_PARAMETER_NAMES, names);
}
} });
}
- public Object[] getUserInfoWithMatch(String[] matchs) throws XmlRpcException {
+ public Object[] getUserInfoWithMatch(final IProgressMonitor monitor, String[] matchs) throws XmlRpcException {
HashMap<String, Object[]> parmArray = new HashMap<String, Object[]>();
Object[] callParm = new Object[] { parmArray };
parmArray.put(XML_PARAMETER_MATCH, matchs);
- return getUserInfoInternal(callParm);
+ return getUserInfoInternal(monitor, callParm);
}
- private Object[] getFieldsInternal(final Object[] callParm) throws XmlRpcException {
+ private Object[] getFieldsInternal(final IProgressMonitor monitor, final Object[] callParm) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_BUG_FIELDS, callParm);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_BUG_FIELDS, callParm);
result = response2ObjectArray(response, XML_RESPONSE_FIELDS);
return result;
}
}).execute();
}
- public Object[] getAllFields() throws XmlRpcException {
- return getFieldsInternal(null);
+ public Object[] getAllFields(final IProgressMonitor monitor) throws XmlRpcException {
+ return getFieldsInternal(monitor, null);
}
@SuppressWarnings("serial")
- public Object[] getFieldsWithNames(final String[] names) throws XmlRpcException {
- return getFieldsInternal(new Object[] { new HashMap<String, Object[]>() {
+ public Object[] getFieldsWithNames(final IProgressMonitor monitor, final String[] names) throws XmlRpcException {
+ return getFieldsInternal(monitor, new Object[] { new HashMap<String, Object[]>() {
{
put(XML_PARAMETER_NAMES, names);
}
@@ -243,60 +240,57 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
@SuppressWarnings("serial")
- public Object[] getFieldsWithIDs(final Integer[] ids) throws XmlRpcException {
- return getFieldsInternal(new Object[] { new HashMap<String, Object[]>() {
+ public Object[] getFieldsWithIDs(final IProgressMonitor monitor, final Integer[] ids) throws XmlRpcException {
+ return getFieldsInternal(monitor, new Object[] { new HashMap<String, Object[]>() {
{
put(XML_PARAMETER_IDS, ids);
}
} });
}
- public Object[] getSelectableProducts() throws XmlRpcException {
+ public Object[] getSelectableProducts(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_PRODUCT_GET_SELECTABLE,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET_SELECTABLE, (Object[]) null);
result = response2ObjectArray(response, XML_RESPONSE_IDS);
return result;
}
}).execute();
}
- public Object[] getEnterableProducts() throws XmlRpcException {
+ public Object[] getEnterableProducts(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_PRODUCT_GET_ENTERABLE,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET_ENTERABLE, (Object[]) null);
result = response2ObjectArray(response, XML_RESPONSE_IDS);
return result;
}
}).execute();
}
- public Object[] getAccessibleProducts() throws XmlRpcException {
+ public Object[] getAccessibleProducts(final IProgressMonitor monitor) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_PRODUCT_GET_ACCESSIBLE,
- (Object[]) null);
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET_ACCESSIBLE, (Object[]) null);
result = response2ObjectArray(response, XML_RESPONSE_IDS);
return result;
}
}).execute();
}
- public Object[] getProducts(final Integer[] ids) throws XmlRpcException {
+ public Object[] getProducts(final IProgressMonitor monitor, final Integer[] ids) throws XmlRpcException {
return (new BugzillaXmlRpcOperation<Object[]>(this) {
@SuppressWarnings("serial")
@Override
public Object[] execute() throws XmlRpcException {
Object[] result = null;
- HashMap<?, ?> response = (HashMap<?, ?>) call(new NullProgressMonitor(), XML_PRODUCT_GET,
+ HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET,
new Object[] { new HashMap<String, Object[]>() {
{
put(XML_PARAMETER_IDS, ids);

Back to the top