Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestAuthenticatedGetRequest.java28
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestClient.java54
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java29
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestHttpClient.java8
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestRequestGetVersion.java40
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestUnauthenticatedGetRequest.java8
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestValidateRequest.java16
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/ListenableFutureJob.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/ErrorResponse.java (renamed from connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestErrorResponse.java)2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Field.java96
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldResponse.java20
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldValues.java62
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/LoginToken.java (renamed from connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestLoginToken.java)2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Named.java6
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/StatusTransition.java31
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/VersionResponse.java (renamed from connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestVersionResponse.java)2
16 files changed, 327 insertions, 79 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestAuthenticatedGetRequest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestAuthenticatedGetRequest.java
index e8c46b2d8..9c111ae97 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestAuthenticatedGetRequest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestAuthenticatedGetRequest.java
@@ -27,15 +27,21 @@ import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
import org.eclipse.mylyn.commons.repositories.http.core.CommonHttpResponse;
import org.eclipse.mylyn.commons.repositories.http.core.HttpUtil;
-import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.BugzillaRestLoginToken;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.LoginToken;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
-public abstract class BugzillaRestAuthenticatedGetRequest<T> extends BugzillaRestRequest<T> {
+public class BugzillaRestAuthenticatedGetRequest<T> extends BugzillaRestRequest<T> {
- public BugzillaRestAuthenticatedGetRequest(BugzillaRestHttpClient client) {
+ private final String urlSuffix;
+
+ private final TypeToken responseType;
+
+ public BugzillaRestAuthenticatedGetRequest(BugzillaRestHttpClient client, String urlSuffix, TypeToken responseType) {
super(client);
+ this.urlSuffix = urlSuffix;
+ this.responseType = responseType;
}
@Override
@@ -57,11 +63,11 @@ public abstract class BugzillaRestAuthenticatedGetRequest<T> extends BugzillaRes
new AuthenticationRequest<AuthenticationType<UserCredentials>>(getClient().getLocation(),
AuthenticationType.REPOSITORY));
} else {
- TypeToken<BugzillaRestLoginToken> type = new TypeToken<BugzillaRestLoginToken>() {
+ TypeToken<LoginToken> type = new TypeToken<LoginToken>() {
};
InputStream is = response.getEntity().getContent();
InputStreamReader in = new InputStreamReader(is);
- BugzillaRestLoginToken loginToken = new Gson().fromJson(in, type.getType());
+ LoginToken loginToken = new Gson().fromJson(in, type.getType());
((BugzillaRestHttpClient) getClient()).setLoginToken(loginToken);
getClient().setAuthenticated(true);
}
@@ -73,7 +79,7 @@ public abstract class BugzillaRestAuthenticatedGetRequest<T> extends BugzillaRes
@Override
protected HttpRequestBase createHttpRequestBase() {
String bugUrl = getUrlSuffix();
- BugzillaRestLoginToken token = ((BugzillaRestHttpClient) getClient()).getLoginToken();
+ LoginToken token = ((BugzillaRestHttpClient) getClient()).getLoginToken();
if ((!(this instanceof BugzillaRestValidateRequest) && !(this instanceof BugzillaRestUnauthenticatedGetRequest))
&& token != null && bugUrl.length() > 0) {
if (!bugUrl.endsWith("?")) {
@@ -97,4 +103,14 @@ public abstract class BugzillaRestAuthenticatedGetRequest<T> extends BugzillaRes
return processAndRelease(response, monitor);
}
+ @Override
+ protected T parseFromJson(InputStreamReader in) {
+ return new Gson().fromJson(in, responseType.getType());
+ }
+
+ @Override
+ protected String getUrlSuffix() {
+ return urlSuffix;
+ }
+
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestClient.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestClient.java
index c52e3f5c7..bcb739795 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestClient.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestClient.java
@@ -11,11 +11,25 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.core.operations.IOperationMonitor;
import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation;
-import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.BugzillaRestErrorResponse;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.ErrorResponse;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.Field;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.FieldResponse;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.Named;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.VersionResponse;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.reflect.TypeToken;
+
public class BugzillaRestClient {
private final BugzillaRestHttpClient client;
@@ -29,16 +43,48 @@ public class BugzillaRestClient {
}
public BugzillaRestVersion getVersion(IOperationMonitor monitor) throws BugzillaRestException {
- return new BugzillaRestRequestGetVersion(client).run(monitor);
+
+ VersionResponse versionResponse = new BugzillaRestUnauthenticatedGetRequest<VersionResponse>(client,
+ "/version", new TypeToken<VersionResponse>() {
+ }).run(monitor);
+ return new BugzillaRestVersion(versionResponse.getVersion());
}
public boolean validate(IOperationMonitor monitor) throws BugzillaRestException {
- BugzillaRestErrorResponse validateResponse = new BugzillaRestValidateRequest(client).run(monitor);
+ ErrorResponse validateResponse = new BugzillaRestValidateRequest(client).run(monitor);
return validateResponse.isError() && validateResponse.getCode() == 32614;
}
public BugzillaRestConfiguration getConfiguration(TaskRepository repository, IOperationMonitor monitor) {
- return null;
+ try {
+ BugzillaRestConfiguration config = new BugzillaRestConfiguration(repository.getUrl());
+ config.setFields(getFields(monitor));
+ return config;
+ } catch (Exception e) {
+ StatusHandler.log(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN,
+ "Could not get the Configuration", e)); //$NON-NLS-1$
+ return null;
+ }
+ }
+
+ public <R, E extends Named> Map<String, E> retrieveItems(IOperationMonitor monitor, String path,
+ Function<R, E[]> attributeProvider, TypeToken typeToken) throws BugzillaRestException {
+ R response = new BugzillaRestAuthenticatedGetRequest<R>(client, path, typeToken).run(monitor);
+ E[] members = attributeProvider.apply(response);
+ return Maps.uniqueIndex(Lists.newArrayList(members), new Function<E, String>() {
+ public String apply(E input) {
+ return input.getName();
+ };
+ });
+ }
+
+ public Map<String, Field> getFields(IOperationMonitor monitor) throws BugzillaRestException {
+ return retrieveItems(monitor, "/field/bug?", new Function<FieldResponse, Field[]>() {
+ public Field[] apply(FieldResponse input) {
+ return input.getFields();
+ }
+ }, new TypeToken<FieldResponse>() {
+ });
}
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
index f765edfba..5e954326a 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
@@ -12,19 +12,36 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core;
import java.io.Serializable;
+import java.util.Map;
+
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.Field;
public class BugzillaRestConfiguration implements Serializable {
- private static final long serialVersionUID = 3433667217913466746L;
+ private static final long serialVersionUID = -4658602653003624954L;
+
+ private final String repositoryId;
+
+ private Map<String, Field> fields;
+
+ public BugzillaRestConfiguration(String repositoryId) {
+ this.repositoryId = repositoryId;
+ }
+
+ public String getRepositoryId() {
+ return repositoryId;
+ }
- private final String url;
+ void setFields(Map<String, Field> fields) {
+ this.fields = fields;
+ }
- public BugzillaRestConfiguration(String url) {
- this.url = url;
+ public Map<String, Field> getFields() {
+ return fields;
}
- public String getUrl() {
- return url;
+ public Field getFieldWithName(String fieldName) {
+ return fields.get(fieldName);
}
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestHttpClient.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestHttpClient.java
index 0e497f9dd..86bc5109b 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestHttpClient.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestHttpClient.java
@@ -13,20 +13,20 @@ package org.eclipse.mylyn.internal.bugzilla.rest.core;
import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation;
import org.eclipse.mylyn.commons.repositories.http.core.CommonHttpClient;
-import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.BugzillaRestLoginToken;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.LoginToken;
public class BugzillaRestHttpClient extends CommonHttpClient {
- private BugzillaRestLoginToken loginToken = null;
+ private LoginToken loginToken = null;
public BugzillaRestHttpClient(RepositoryLocation location) {
super(location);
}
- public BugzillaRestLoginToken getLoginToken() {
+ public LoginToken getLoginToken() {
return loginToken;
}
- public void setLoginToken(BugzillaRestLoginToken loginToken) {
+ public void setLoginToken(LoginToken loginToken) {
this.loginToken = loginToken;
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestRequestGetVersion.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestRequestGetVersion.java
deleted file mode 100644
index ce7fa08b3..000000000
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestRequestGetVersion.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Frank Becker and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Frank Becker - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.rest.core;
-
-import java.io.InputStreamReader;
-
-import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.BugzillaRestVersionResponse;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-
-public class BugzillaRestRequestGetVersion extends BugzillaRestUnauthenticatedGetRequest<BugzillaRestVersion> {
-
- public BugzillaRestRequestGetVersion(BugzillaRestHttpClient client) {
- super(client);
- }
-
- @Override
- protected String getUrlSuffix() {
- return "/version"; //$NON-NLS-1$
- }
-
- @Override
- protected BugzillaRestVersion parseFromJson(InputStreamReader in) {
- TypeToken<BugzillaRestVersionResponse> type = new TypeToken<BugzillaRestVersionResponse>() {
- };
- BugzillaRestVersionResponse versionResponse = new Gson().fromJson(in, type.getType());
- return new BugzillaRestVersion(versionResponse.getVersion());
- }
-
-}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestUnauthenticatedGetRequest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestUnauthenticatedGetRequest.java
index 3c3213b52..d1afb2803 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestUnauthenticatedGetRequest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestUnauthenticatedGetRequest.java
@@ -11,10 +11,12 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core;
-public abstract class BugzillaRestUnauthenticatedGetRequest<T> extends BugzillaRestAuthenticatedGetRequest<T> {
+import com.google.gson.reflect.TypeToken;
- public BugzillaRestUnauthenticatedGetRequest(BugzillaRestHttpClient client) {
- super(client);
+public class BugzillaRestUnauthenticatedGetRequest<T> extends BugzillaRestAuthenticatedGetRequest<T> {
+
+ public BugzillaRestUnauthenticatedGetRequest(BugzillaRestHttpClient client, String urlSuffix, TypeToken responseType) {
+ super(client, urlSuffix, responseType);
}
@Override
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestValidateRequest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestValidateRequest.java
index 795bf4e32..407b32244 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestValidateRequest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestValidateRequest.java
@@ -12,20 +12,19 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core;
import java.io.IOException;
-import java.io.InputStreamReader;
import org.apache.http.HttpStatus;
import org.eclipse.mylyn.commons.core.operations.IOperationMonitor;
import org.eclipse.mylyn.commons.repositories.http.core.CommonHttpResponse;
-import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.BugzillaRestErrorResponse;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.ErrorResponse;
-import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
-public class BugzillaRestValidateRequest extends BugzillaRestAuthenticatedGetRequest<BugzillaRestErrorResponse> {
+public class BugzillaRestValidateRequest extends BugzillaRestAuthenticatedGetRequest<ErrorResponse> {
public BugzillaRestValidateRequest(BugzillaRestHttpClient client) {
- super(client);
+ super(client, "", new TypeToken<ErrorResponse>() {
+ });
}
@Override
@@ -37,11 +36,4 @@ public class BugzillaRestValidateRequest extends BugzillaRestAuthenticatedGetReq
: HttpStatus.SC_BAD_REQUEST, monitor);
}
- @Override
- protected BugzillaRestErrorResponse parseFromJson(InputStreamReader in) {
- TypeToken<BugzillaRestErrorResponse> type = new TypeToken<BugzillaRestErrorResponse>() {
- };
- return new Gson().fromJson(in, type.getType());
- }
-
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/ListenableFutureJob.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/ListenableFutureJob.java
index 5770e0264..138210a15 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/ListenableFutureJob.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/ListenableFutureJob.java
@@ -108,4 +108,4 @@ public abstract class ListenableFutureJob<V> extends Job implements ListenableFu
public void addListener(Runnable listener, Executor executor) {
listeners.add(new Listener(listener, executor));
}
-} \ No newline at end of file
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestErrorResponse.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/ErrorResponse.java
index 3e467fe88..03fb6572b 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestErrorResponse.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/ErrorResponse.java
@@ -11,7 +11,7 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
-public class BugzillaRestErrorResponse {
+public class ErrorResponse {
private boolean error;
private String message;
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Field.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Field.java
new file mode 100644
index 000000000..de56aedbf
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Field.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
+
+import java.io.Serializable;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Field implements Named, Serializable {
+
+ private static final long serialVersionUID = -5578410875657273067L;
+
+ private int id;
+
+ private int type;
+
+ @SerializedName("is_custom")
+ private boolean custom;
+
+ private String name;
+
+ @SerializedName("display_name")
+ private String displayName;
+
+ @SerializedName("is_mandatory")
+ private boolean mandatory;
+
+ @SerializedName("is_on_bug_entry")
+ private boolean onBugEntry;
+
+ @SerializedName("visibility_field")
+ private String visibilityField;
+
+ @SerializedName("visibility_values")
+ private String[] visibilityValues;
+
+ @SerializedName("value_field")
+ private String valueField;
+
+ private FieldValues[] values;
+
+ public int getId() {
+ return id;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public boolean isCustom() {
+ return custom;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public boolean isMandatory() {
+ return mandatory;
+ }
+
+ public boolean isOnBugEntry() {
+ return onBugEntry;
+ }
+
+ public String getVisibilityField() {
+ return visibilityField;
+ }
+
+ public String[] getVisibilityValues() {
+ return visibilityValues;
+ }
+
+ public String getValueField() {
+ return valueField;
+ }
+
+ public FieldValues[] getValues() {
+ return values;
+ }
+
+} \ No newline at end of file
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldResponse.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldResponse.java
new file mode 100644
index 000000000..158a5871c
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldResponse.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
+
+public class FieldResponse {
+ private Field[] fields;
+
+ public Field[] getFields() {
+ return fields;
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldValues.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldValues.java
new file mode 100644
index 000000000..4f7af8bcc
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/FieldValues.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
+
+import java.io.Serializable;
+
+public class FieldValues implements Serializable {
+
+ private static final long serialVersionUID = -7596294082190197659L;
+
+ private String name;
+
+ private int sort_key;
+
+ private String[] visibility_values;
+
+ private boolean is_active;
+
+ private String description;
+
+ private boolean is_open;
+
+ private StatusTransition[] can_change_to;
+
+ public String getName() {
+ return name;
+ }
+
+ public int getSortKey() {
+ return sort_key;
+ }
+
+ public String[] getVisibilityValues() {
+ return visibility_values;
+ }
+
+ public boolean isActive() {
+ return is_active;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public boolean isOpen() {
+ return is_open;
+ }
+
+ public StatusTransition[] getCanChangeTo() {
+ return can_change_to;
+ }
+
+} \ No newline at end of file
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestLoginToken.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/LoginToken.java
index a8cbe0baa..d8a3c0e17 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestLoginToken.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/LoginToken.java
@@ -11,7 +11,7 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
-public class BugzillaRestLoginToken {
+public class LoginToken {
private String id;
private String token;
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Named.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Named.java
new file mode 100644
index 000000000..9dc53ebac
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/Named.java
@@ -0,0 +1,6 @@
+package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
+
+
+public interface Named {
+ public String getName();
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/StatusTransition.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/StatusTransition.java
new file mode 100644
index 000000000..dd711a8a3
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/StatusTransition.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
+
+import java.io.Serializable;
+
+public class StatusTransition implements Serializable {
+
+ private static final long serialVersionUID = 791312498240951654L;
+
+ public String name;
+
+ public boolean comment_required;
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean isCommentRequired() {
+ return comment_required;
+ }
+} \ No newline at end of file
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestVersionResponse.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/VersionResponse.java
index 8adf5eea6..d6c5732a8 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/BugzillaRestVersionResponse.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/response/data/VersionResponse.java
@@ -11,7 +11,7 @@
package org.eclipse.mylyn.internal.bugzilla.rest.core.response.data;
-public class BugzillaRestVersionResponse {
+public class VersionResponse {
private String version;

Back to the top