From 3fca2b7bd76048d825fe21d036bd2df8130bca56 Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Feb 2017 13:45:16 -0600 Subject: [PATCH 1/9] Allow for Pre-Configured HTTP Client and Basic Auth Changes This change allows a user to provide a pre-configured HTTP Client to be used for managing connections to CA Agile Central. The is primarily useful in long running processes, such as code running inside of a container. This providers several benefits : 1. Connection reuse and simplified resource handling (can centralize connection creation and clean up only on shutdown rather than needing to explicitly close connections) 2. Connection Pooling Options 3. Client SSL Configuration Options -- Updated Basic Auth Client to always provide Basic Auth Crendetials to avoid blind duplicate calls. Since we know that all requests require authorization, we should always send the credentials. --- .../java/com/rallydev/rest/RallyRestApi.java | 46 ++++++++++++++++--- .../rallydev/rest/client/ApiKeyClient.java | 15 +++++- .../rallydev/rest/client/BasicAuthClient.java | 38 +++++++++++---- .../com/rallydev/rest/client/HttpClient.java | 31 +++++++++---- .../rest/client/ApiKeyClientTest.java | 34 +++++++++++--- .../rest/client/BasicAuthClientTest.java | 46 +++++++++++++++---- 6 files changed, 170 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/rallydev/rest/RallyRestApi.java b/src/main/java/com/rallydev/rest/RallyRestApi.java index 6a0eaa8..c3fa7ab 100644 --- a/src/main/java/com/rallydev/rest/RallyRestApi.java +++ b/src/main/java/com/rallydev/rest/RallyRestApi.java @@ -1,15 +1,25 @@ package com.rallydev.rest; +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; + import com.google.gson.JsonArray; import com.rallydev.rest.client.ApiKeyClient; import com.rallydev.rest.client.BasicAuthClient; import com.rallydev.rest.client.HttpClient; -import com.rallydev.rest.request.*; -import com.rallydev.rest.response.*; - -import java.io.Closeable; -import java.io.IOException; -import java.net.URI; +import com.rallydev.rest.request.CollectionUpdateRequest; +import com.rallydev.rest.request.CreateRequest; +import com.rallydev.rest.request.DeleteRequest; +import com.rallydev.rest.request.GetRequest; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.request.UpdateRequest; +import com.rallydev.rest.response.CollectionUpdateResponse; +import com.rallydev.rest.response.CreateResponse; +import com.rallydev.rest.response.DeleteResponse; +import com.rallydev.rest.response.GetResponse; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.response.UpdateResponse; /** *

The main interface to the Rest API.

@@ -30,6 +40,19 @@ public class RallyRestApi implements Closeable { public RallyRestApi(URI server, String userName, String password) { this(new BasicAuthClient(server, userName, password)); } + + /** + * Creates a new instance for the specified server using the specified credentials. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param userName The username to be used for authentication. + * @param password The password to be used for authentication. + * @param httpClient The pre-configured httpClient. + * @deprecated Use the api key constructor instead. + */ + public RallyRestApi(URI server, String userName, String password, org.apache.http.client.HttpClient httpClient) { + this(new BasicAuthClient(server, userName, password, httpClient)); + } /** * Creates a new instance for the specified server using the specified API Key. @@ -41,6 +64,17 @@ public RallyRestApi(URI server, String apiKey) { this(new ApiKeyClient(server, apiKey)); } + /** + * Creates a new instance for the specified server using the specified API Key and a pre-configured httpClient. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param apiKey The API Key to be used for authentication. + * @param httpClient The pre-configured httpClient. + */ + public RallyRestApi(URI server, String apiKey, org.apache.http.client.HttpClient httpClient) { + this(new ApiKeyClient(server, apiKey, httpClient)); + } + protected RallyRestApi(HttpClient httpClient) { this.client = httpClient; } diff --git a/src/main/java/com/rallydev/rest/client/ApiKeyClient.java b/src/main/java/com/rallydev/rest/client/ApiKeyClient.java index 2295824..80209f9 100644 --- a/src/main/java/com/rallydev/rest/client/ApiKeyClient.java +++ b/src/main/java/com/rallydev/rest/client/ApiKeyClient.java @@ -1,10 +1,10 @@ package com.rallydev.rest.client; -import org.apache.http.client.methods.HttpRequestBase; - import java.io.IOException; import java.net.URI; +import org.apache.http.client.methods.HttpRequestBase; + /** * A HttpClient which authenticates using an API Key. */ @@ -23,6 +23,17 @@ public ApiKeyClient(URI server, String apiKey) { this.apiKey = apiKey; } + /** + * Construct a new client with a pre-configured HttpClient. + * + * @param server the server to connect to + * @param apiKey the key to be used for authentication + */ + public ApiKeyClient(URI server, String apiKey, org.apache.http.client.HttpClient httpClient) { + super(server, httpClient); + this.apiKey = apiKey; + } + /** * Execute a request against the WSAPI * diff --git a/src/main/java/com/rallydev/rest/client/BasicAuthClient.java b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java index 2b6d04a..215e506 100644 --- a/src/main/java/com/rallydev/rest/client/BasicAuthClient.java +++ b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java @@ -1,16 +1,18 @@ package com.rallydev.rest.client; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.rallydev.rest.response.GetResponse; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + import org.apache.http.auth.Credentials; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.auth.BasicScheme; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; + +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.rallydev.rest.response.GetResponse; /** * A HttpClient which authenticates using basic authentication (username/password). @@ -34,17 +36,36 @@ public BasicAuthClient(URI server, String userName, String password) { super(server); credentials = setClientCredentials(server, userName, password); } + + /** + * Construct a new client with a pre-configured HttpClient. + * + * @param server the server to connect to + * @param userName the username to be used for authentication + * @param password the password to be used for authentication + */ + public BasicAuthClient(URI server, String userName, String password, org.apache.http.client.HttpClient client) { + super(server, client); + credentials = setClientCredentials(server, userName, password); + } /** - * Execute a request against the WSAPI + * Execute a request against the WSAPI. + * + * Always attaches the Basic Authentication header to avoid HTTP Spec handling. + * + * Traditionally, all requests are attempted without authorization, + * however we know that all resources are protected, so we can force pre-authentication. * * @param request the request to be executed * @return the JSON encoded string response * @throws java.io.IOException if a non-200 response code is returned or if some other - * problem occurs while executing the request + * problem occurs while executing the request */ @Override protected String doRequest(HttpRequestBase request) throws IOException { + request.addHeader(BasicScheme.authenticate(credentials, "utf-8", false)); + if(!request.getMethod().equals(HttpGet.METHOD_NAME) && !this.getWsapiVersion().matches("^1[.]\\d+")) { try { @@ -72,7 +93,6 @@ protected void attachSecurityInfo(HttpRequestBase request) throws IOException, U try { if (securityToken == null) { HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL); - httpGet.addHeader(BasicScheme.authenticate(credentials, "utf-8", false)); GetResponse getResponse = new GetResponse(doRequest(httpGet)); JsonObject operationResult = getResponse.getObject(); JsonPrimitive securityTokenPrimitive = operationResult.getAsJsonPrimitive(SECURITY_TOKEN_KEY); diff --git a/src/main/java/com/rallydev/rest/client/HttpClient.java b/src/main/java/com/rallydev/rest/client/HttpClient.java index 3bc4a9a..d657088 100644 --- a/src/main/java/com/rallydev/rest/client/HttpClient.java +++ b/src/main/java/com/rallydev/rest/client/HttpClient.java @@ -1,24 +1,28 @@ package com.rallydev.rest.client; +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.methods.*; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.conn.params.ConnRoutePNames; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DecompressingHttpClient; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; -import java.io.Closeable; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - /** * A HttpClient implementation providing connectivity to Rally. This class does not * provide any authentication on its own but instead relies on a concrete subclass to do so. @@ -28,7 +32,7 @@ public class HttpClient extends DefaultHttpClient protected URI server; protected String wsapiVersion = "v2.0"; - protected DecompressingHttpClient client; + protected org.apache.http.client.HttpClient client; private enum Header { Library, @@ -51,6 +55,17 @@ protected HttpClient(URI server) { client = new DecompressingHttpClient(this); } + /** + * Allow the user to specify a compliant HttpClient + * + * @param server The URI of the remote server + * @param client A pre-configured HttpClient implementation + */ + public HttpClient(URI server, org.apache.http.client.HttpClient client) { + this.server = server; + this.client = client; + } + /** * Set the unauthenticated proxy server to use. By default no proxy is configured. * diff --git a/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java b/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java index 84ca9e6..93ea0b7 100644 --- a/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java +++ b/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java @@ -1,18 +1,23 @@ package com.rallydev.rest.client; -import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +import java.net.URI; +import java.net.URISyntaxException; + import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.impl.client.DefaultHttpClient; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.net.URI; -import java.net.URISyntaxException; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.argThat; -import static org.mockito.Mockito.*; +import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; public class ApiKeyClientTest { @@ -31,10 +36,25 @@ public void shouldIntialize() { Assert.assertEquals(client.getServer(), server); } + @SuppressWarnings("resource") + @Test + public void shouldIntializePreConfiguredClient() throws URISyntaxException { + HttpClient mockClient = mock(HttpClient.class); + ApiKeyClient client = new ApiKeyClient(new URI(server), apiKey, mockClient); + Assert.assertEquals(client.getServer(), server); + } + @Test public void shouldIncludeApiKeyOnRequest() throws Exception { doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); client.doRequest(new HttpGet()); verify(client).doRequest(argThat(new HttpRequestHeaderMatcher("zsessionid", apiKey))); } + + @Test + public void shouldReturnPreConfiguredClient() throws Exception { + DefaultHttpClient mockClient = mock(DefaultHttpClient.class); + ApiKeyClient spiedClient = spy(new ApiKeyClient(new URI(server), apiKey, mockClient)); + Assert.assertEquals(spiedClient.client, mockClient); + } } diff --git a/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java b/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java index e661892..51a7798 100644 --- a/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java +++ b/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java @@ -1,18 +1,28 @@ package com.rallydev.rest.client; -import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import java.net.URI; +import java.net.URISyntaxException; + import org.apache.http.Header; -import org.apache.http.client.methods.*; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.impl.auth.BasicScheme; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.net.URI; -import java.net.URISyntaxException; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.*; +import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; public class BasicAuthClientTest { @@ -36,11 +46,31 @@ public void shouldIntialize() { Assert.assertEquals(client.credentials.getUserPrincipal().getName(), userName); } + @SuppressWarnings("resource") + @Test + public void shouldIntializePreConfiguredClient() throws URISyntaxException { + HttpClient mockClient = mock(HttpClient.class); + BasicAuthClient client = new BasicAuthClient(new URI(server), userName, password, mockClient); + Assert.assertEquals(client.getServer(), server); + Assert.assertEquals(client.credentials.getPassword(), password); + Assert.assertEquals(client.credentials.getUserPrincipal().getName(), userName); + } + + @Test + public void shouldIncludeAuthHeaderOnGet() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.doRequest(new HttpGet()); + Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); + verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); + } + @Test public void shouldNotIncludeCSRFTokenOnGet() throws Exception { doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); client.doRequest(new HttpGet()); verify(client, times(0)).attachSecurityInfo(any(HttpRequestBase.class)); + Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); + verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); } @Test @@ -57,7 +87,7 @@ public void shouldRequestCSRFToken() throws Exception { doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class)); client.doRequest(new HttpPost(server)); Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); - verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); + verify(client, times(2)).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); } @Test From 06e180afb1fb2bd7cedaf75d31398de659425927 Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Feb 2017 14:06:00 -0600 Subject: [PATCH 2/9] initial commit --- .classpath | 32 + .gitignore | 6 + .project | 36 + LICENSE | 7 + README.md | 26 + RallyRestToolkitForJava.iml | 31 + RallyRestToolkitForJava.ipr | 357 ++++++++++ pom.xml | 118 +++ src/main/java/META-INF/MANIFEST.MF | 9 + .../java/com/rallydev/rest/RallyRestApi.java | 255 +++++++ .../rallydev/rest/client/ApiKeyClient.java | 50 ++ .../rallydev/rest/client/BasicAuthClient.java | 109 +++ .../com/rallydev/rest/client/HttpClient.java | 262 +++++++ .../rallydev/rest/client/package-info.java | 4 + .../java/com/rallydev/rest/package-info.java | 4 + .../rest/request/CollectionUpdateRequest.java | 96 +++ .../rallydev/rest/request/CreateRequest.java | 77 ++ .../rallydev/rest/request/DeleteRequest.java | 32 + .../com/rallydev/rest/request/GetRequest.java | 75 ++ .../rallydev/rest/request/QueryRequest.java | 305 ++++++++ .../com/rallydev/rest/request/Request.java | 83 +++ .../rallydev/rest/request/UpdateRequest.java | 79 ++ .../rallydev/rest/request/package-info.java | 4 + .../response/CollectionUpdateResponse.java | 37 + .../rest/response/CreateResponse.java | 38 + .../rest/response/DeleteResponse.java | 26 + .../rallydev/rest/response/GetResponse.java | 46 ++ .../rallydev/rest/response/QueryResponse.java | 65 ++ .../com/rallydev/rest/response/Response.java | 69 ++ .../rest/response/UpdateResponse.java | 37 + .../rallydev/rest/response/package-info.java | 4 + .../java/com/rallydev/rest/util/Fetch.java | 40 ++ .../com/rallydev/rest/util/QueryFilter.java | 115 +++ src/main/java/com/rallydev/rest/util/Ref.java | 103 +++ .../com/rallydev/rest/util/package-info.java | 4 + src/main/resources/doc/allclasses-frame.html | 38 + .../resources/doc/allclasses-noframe.html | 38 + .../rallydev/rest/CollectionAddExample.html | 261 +++++++ .../rallydev/rest/CollectionQueryExample.html | 261 +++++++ .../rest/CollectionSummaryExample.html | 261 +++++++ .../doc/com/rallydev/rest/CrudExample.html | 261 +++++++ .../doc/com/rallydev/rest/QueryExample.html | 261 +++++++ .../doc/com/rallydev/rest/RallyRestApi.html | 578 +++++++++++++++ .../com/rallydev/rest/RallyRestApiTest.html | 567 +++++++++++++++ .../doc/com/rallydev/rest/RestApiFactory.html | 259 +++++++ .../rest/class-use/CollectionAddExample.html | 115 +++ .../class-use/CollectionQueryExample.html | 115 +++ .../class-use/CollectionSummaryExample.html | 115 +++ .../rallydev/rest/class-use/CrudExample.html | 115 +++ .../rallydev/rest/class-use/QueryExample.html | 115 +++ .../rallydev/rest/class-use/RallyRestApi.html | 115 +++ .../rest/class-use/RallyRestApiTest.html | 115 +++ .../rest/class-use/RestApiFactory.html | 115 +++ .../rallydev/rest/client/ApiKeyClient.html | 275 +++++++ .../rest/client/ApiKeyClientTest.html | 288 ++++++++ .../rallydev/rest/client/BasicAuthClient.html | 277 +++++++ .../rest/client/BasicAuthClientTest.html | 368 ++++++++++ .../com/rallydev/rest/client/HttpClient.html | 520 ++++++++++++++ .../rallydev/rest/client/HttpClientTest.html | 490 +++++++++++++ .../rest/client/class-use/ApiKeyClient.html | 115 +++ .../client/class-use/ApiKeyClientTest.html | 115 +++ .../client/class-use/BasicAuthClient.html | 115 +++ .../client/class-use/BasicAuthClientTest.html | 115 +++ .../rest/client/class-use/HttpClient.html | 191 +++++ .../rest/client/class-use/HttpClientTest.html | 115 +++ .../rallydev/rest/client/package-frame.html | 21 + .../rallydev/rest/client/package-summary.html | 156 ++++ .../rallydev/rest/client/package-tree.html | 141 ++++ .../com/rallydev/rest/client/package-use.html | 175 +++++ .../rest/matchers/HttpRequestBodyMatcher.html | 292 ++++++++ .../matchers/HttpRequestHeaderMatcher.html | 292 ++++++++ .../rest/matchers/HttpRequestUrlMatcher.html | 290 ++++++++ .../class-use/HttpRequestBodyMatcher.html | 115 +++ .../class-use/HttpRequestHeaderMatcher.html | 115 +++ .../class-use/HttpRequestUrlMatcher.html | 115 +++ .../rallydev/rest/matchers/package-frame.html | 21 + .../rest/matchers/package-summary.html | 141 ++++ .../rallydev/rest/matchers/package-tree.html | 138 ++++ .../rallydev/rest/matchers/package-use.html | 115 +++ .../doc/com/rallydev/rest/package-frame.html | 19 + .../com/rallydev/rest/package-summary.html | 144 ++++ .../doc/com/rallydev/rest/package-tree.html | 128 ++++ .../doc/com/rallydev/rest/package-use.html | 115 +++ .../rest/request/CollectionUpdateRequest.html | 358 ++++++++++ .../request/CollectionUpdateRequestTest.html | 295 ++++++++ .../rallydev/rest/request/CreateRequest.html | 335 +++++++++ .../rest/request/CreateRequestTest.html | 321 +++++++++ .../rallydev/rest/request/DeleteRequest.html | 281 ++++++++ .../rest/request/DeleteRequestTest.html | 282 ++++++++ .../com/rallydev/rest/request/GetRequest.html | 317 +++++++++ .../rallydev/rest/request/GetRequestTest.html | 308 ++++++++ .../rallydev/rest/request/QueryRequest.html | 673 ++++++++++++++++++ .../rest/request/QueryRequestTest.html | 451 ++++++++++++ .../com/rallydev/rest/request/Request.html | 357 ++++++++++ .../rallydev/rest/request/RequestTest.html | 282 ++++++++ .../rallydev/rest/request/UpdateRequest.html | 335 +++++++++ .../rest/request/UpdateRequestTest.html | 308 ++++++++ .../class-use/CollectionUpdateRequest.html | 159 +++++ .../CollectionUpdateRequestTest.html | 115 +++ .../rest/request/class-use/CreateRequest.html | 159 +++++ .../request/class-use/CreateRequestTest.html | 115 +++ .../rest/request/class-use/DeleteRequest.html | 159 +++++ .../request/class-use/DeleteRequestTest.html | 115 +++ .../rest/request/class-use/GetRequest.html | 159 +++++ .../request/class-use/GetRequestTest.html | 115 +++ .../rest/request/class-use/QueryRequest.html | 185 +++++ .../request/class-use/QueryRequestTest.html | 115 +++ .../rest/request/class-use/Request.html | 189 +++++ .../rest/request/class-use/RequestTest.html | 115 +++ .../rest/request/class-use/UpdateRequest.html | 159 +++++ .../request/class-use/UpdateRequestTest.html | 115 +++ .../rallydev/rest/request/package-frame.html | 25 + .../rest/request/package-summary.html | 180 +++++ .../rallydev/rest/request/package-tree.html | 137 ++++ .../rallydev/rest/request/package-use.html | 205 ++++++ .../response/CollectionUpdateResponse.html | 278 ++++++++ .../CollectionUpdateResponseTest.html | 269 +++++++ .../rest/response/CreateResponse.html | 278 ++++++++ .../rest/response/CreateResponseTest.html | 269 +++++++ .../rest/response/DeleteResponse.html | 245 +++++++ .../rest/response/DeleteResponseTest.html | 269 +++++++ .../rallydev/rest/response/GetResponse.html | 278 ++++++++ .../rest/response/GetResponseTest.html | 269 +++++++ .../rallydev/rest/response/QueryResponse.html | 329 +++++++++ .../rest/response/QueryResponseTest.html | 269 +++++++ .../com/rallydev/rest/response/Response.html | 303 ++++++++ .../rallydev/rest/response/ResponseTest.html | 295 ++++++++ .../rest/response/UpdateResponse.html | 278 ++++++++ .../rest/response/UpdateResponseTest.html | 269 +++++++ .../class-use/CollectionUpdateResponse.html | 159 +++++ .../CollectionUpdateResponseTest.html | 115 +++ .../response/class-use/CreateResponse.html | 159 +++++ .../class-use/CreateResponseTest.html | 115 +++ .../response/class-use/DeleteResponse.html | 159 +++++ .../class-use/DeleteResponseTest.html | 115 +++ .../rest/response/class-use/GetResponse.html | 159 +++++ .../response/class-use/GetResponseTest.html | 115 +++ .../response/class-use/QueryResponse.html | 159 +++++ .../response/class-use/QueryResponseTest.html | 115 +++ .../rest/response/class-use/Response.html | 189 +++++ .../rest/response/class-use/ResponseTest.html | 115 +++ .../response/class-use/UpdateResponse.html | 159 +++++ .../class-use/UpdateResponseTest.html | 115 +++ .../rallydev/rest/response/package-frame.html | 25 + .../rest/response/package-summary.html | 180 +++++ .../rallydev/rest/response/package-tree.html | 137 ++++ .../rallydev/rest/response/package-use.html | 200 ++++++ .../doc/com/rallydev/rest/util/Fetch.html | 317 +++++++++ .../doc/com/rallydev/rest/util/FetchTest.html | 282 ++++++++ .../rest/util/InvalidURLException.html | 255 +++++++ .../com/rallydev/rest/util/QueryFilter.html | 355 +++++++++ .../rallydev/rest/util/QueryFilterTest.html | 360 ++++++++++ .../doc/com/rallydev/rest/util/Ref.html | 316 ++++++++ .../doc/com/rallydev/rest/util/RefTest.html | 451 ++++++++++++ .../rallydev/rest/util/class-use/Fetch.html | 222 ++++++ .../rest/util/class-use/FetchTest.html | 115 +++ .../util/class-use/InvalidURLException.html | 115 +++ .../rest/util/class-use/QueryFilter.html | 251 +++++++ .../rest/util/class-use/QueryFilterTest.html | 115 +++ .../com/rallydev/rest/util/class-use/Ref.html | 115 +++ .../rallydev/rest/util/class-use/RefTest.html | 115 +++ .../com/rallydev/rest/util/package-frame.html | 21 + .../rallydev/rest/util/package-summary.html | 156 ++++ .../com/rallydev/rest/util/package-tree.html | 142 ++++ .../com/rallydev/rest/util/package-use.html | 180 +++++ src/main/resources/doc/constant-values.html | 115 +++ src/main/resources/doc/deprecated-list.html | 139 ++++ src/main/resources/doc/help-doc.html | 220 ++++++ .../resources/doc/index-files/index-1.html | 138 ++++ .../resources/doc/index-files/index-10.html | 150 ++++ .../resources/doc/index-files/index-11.html | 154 ++++ .../resources/doc/index-files/index-12.html | 230 ++++++ .../resources/doc/index-files/index-13.html | 154 ++++ .../resources/doc/index-files/index-14.html | 142 ++++ .../resources/doc/index-files/index-15.html | 122 ++++ .../resources/doc/index-files/index-16.html | 122 ++++ .../resources/doc/index-files/index-2.html | 126 ++++ .../resources/doc/index-files/index-3.html | 190 +++++ .../resources/doc/index-files/index-4.html | 154 ++++ .../resources/doc/index-files/index-5.html | 126 ++++ .../resources/doc/index-files/index-6.html | 278 ++++++++ .../resources/doc/index-files/index-7.html | 122 ++++ .../resources/doc/index-files/index-8.html | 130 ++++ .../resources/doc/index-files/index-9.html | 126 ++++ src/main/resources/doc/index.html | 67 ++ src/main/resources/doc/overview-frame.html | 24 + src/main/resources/doc/overview-summary.html | 155 ++++ src/main/resources/doc/overview-tree.html | 181 +++++ src/main/resources/doc/package-list | 5 + .../resources/doc/resources/background.gif | Bin 0 -> 2313 bytes src/main/resources/doc/resources/tab.gif | Bin 0 -> 291 bytes src/main/resources/doc/resources/titlebar.gif | Bin 0 -> 10701 bytes .../resources/doc/resources/titlebar_end.gif | Bin 0 -> 849 bytes src/main/resources/doc/serialized-form.html | 128 ++++ src/main/resources/doc/stylesheet.css | 474 ++++++++++++ .../rallydev/rest/CollectionAddExample.java | 63 ++ .../rallydev/rest/CollectionQueryExample.java | 56 ++ .../rest/CollectionSummaryExample.java | 54 ++ .../com/rallydev/rest/CrudExample.java | 63 ++ .../com/rallydev/rest/QueryExample.java | 59 ++ .../com/rallydev/rest/RestApiFactory.java | 50 ++ .../com/rallydev/rest/RallyRestApiTest.java | 301 ++++++++ .../rest/client/ApiKeyClientTest.java | 60 ++ .../rest/client/BasicAuthClientTest.java | 122 ++++ .../rallydev/rest/client/HttpClientTest.java | 162 +++++ .../rest/matchers/HttpRequestBodyMatcher.java | 27 + .../matchers/HttpRequestHeaderMatcher.java | 24 + .../rest/matchers/HttpRequestUrlMatcher.java | 22 + .../request/CollectionUpdateRequestTest.java | 45 ++ .../rest/request/CreateRequestTest.java | 61 ++ .../rest/request/DeleteRequestTest.java | 26 + .../rallydev/rest/request/GetRequestTest.java | 45 ++ .../rest/request/QueryRequestTest.java | 165 +++++ .../rallydev/rest/request/RequestTest.java | 64 ++ .../rest/request/UpdateRequestTest.java | 50 ++ .../CollectionUpdateResponseTest.java | 43 ++ .../rest/response/CreateResponseTest.java | 32 + .../rest/response/DeleteResponseTest.java | 31 + .../rest/response/GetResponseTest.java | 35 + .../rest/response/QueryResponseTest.java | 47 ++ .../rallydev/rest/response/ResponseTest.java | 50 ++ .../rest/response/UpdateResponseTest.java | 32 + .../com/rallydev/rest/util/FetchTest.java | 31 + .../rallydev/rest/util/QueryFilterTest.java | 72 ++ .../java/com/rallydev/rest/util/RefTest.java | 125 ++++ 225 files changed, 35547 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 LICENSE create mode 100644 README.md create mode 100644 RallyRestToolkitForJava.iml create mode 100644 RallyRestToolkitForJava.ipr create mode 100644 pom.xml create mode 100644 src/main/java/META-INF/MANIFEST.MF create mode 100644 src/main/java/com/rallydev/rest/RallyRestApi.java create mode 100644 src/main/java/com/rallydev/rest/client/ApiKeyClient.java create mode 100644 src/main/java/com/rallydev/rest/client/BasicAuthClient.java create mode 100644 src/main/java/com/rallydev/rest/client/HttpClient.java create mode 100644 src/main/java/com/rallydev/rest/client/package-info.java create mode 100644 src/main/java/com/rallydev/rest/package-info.java create mode 100644 src/main/java/com/rallydev/rest/request/CollectionUpdateRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/CreateRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/DeleteRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/GetRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/QueryRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/Request.java create mode 100644 src/main/java/com/rallydev/rest/request/UpdateRequest.java create mode 100644 src/main/java/com/rallydev/rest/request/package-info.java create mode 100644 src/main/java/com/rallydev/rest/response/CollectionUpdateResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/CreateResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/DeleteResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/GetResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/QueryResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/Response.java create mode 100644 src/main/java/com/rallydev/rest/response/UpdateResponse.java create mode 100644 src/main/java/com/rallydev/rest/response/package-info.java create mode 100644 src/main/java/com/rallydev/rest/util/Fetch.java create mode 100644 src/main/java/com/rallydev/rest/util/QueryFilter.java create mode 100644 src/main/java/com/rallydev/rest/util/Ref.java create mode 100644 src/main/java/com/rallydev/rest/util/package-info.java create mode 100644 src/main/resources/doc/allclasses-frame.html create mode 100644 src/main/resources/doc/allclasses-noframe.html create mode 100644 src/main/resources/doc/com/rallydev/rest/CollectionAddExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/CollectionQueryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/CollectionSummaryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/CrudExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/QueryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/RallyRestApi.html create mode 100644 src/main/resources/doc/com/rallydev/rest/RallyRestApiTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/RestApiFactory.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/CollectionAddExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/CollectionQueryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/CollectionSummaryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/CrudExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/QueryExample.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApi.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApiTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/class-use/RestApiFactory.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/ApiKeyClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/ApiKeyClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/BasicAuthClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/BasicAuthClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/HttpClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/HttpClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClient.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClientTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/client/package-use.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestBodyMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestUrlMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestBodyMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestHeaderMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestUrlMatcher.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/matchers/package-use.html create mode 100644 src/main/resources/doc/com/rallydev/rest/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/package-use.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/CreateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/CreateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/DeleteRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/DeleteRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/GetRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/GetRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/QueryRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/QueryRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/Request.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/RequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/UpdateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/UpdateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/Request.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/RequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequestTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/request/package-use.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/CreateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/CreateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/DeleteResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/DeleteResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/GetResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/GetResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/QueryResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/QueryResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/Response.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/ResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/UpdateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/UpdateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/Response.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/ResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponse.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponseTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/response/package-use.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/Fetch.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/FetchTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/InvalidURLException.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/QueryFilter.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/QueryFilterTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/Ref.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/RefTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/Fetch.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/FetchTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/InvalidURLException.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilter.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilterTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/Ref.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/class-use/RefTest.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/package-frame.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/package-summary.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/package-tree.html create mode 100644 src/main/resources/doc/com/rallydev/rest/util/package-use.html create mode 100644 src/main/resources/doc/constant-values.html create mode 100644 src/main/resources/doc/deprecated-list.html create mode 100644 src/main/resources/doc/help-doc.html create mode 100644 src/main/resources/doc/index-files/index-1.html create mode 100644 src/main/resources/doc/index-files/index-10.html create mode 100644 src/main/resources/doc/index-files/index-11.html create mode 100644 src/main/resources/doc/index-files/index-12.html create mode 100644 src/main/resources/doc/index-files/index-13.html create mode 100644 src/main/resources/doc/index-files/index-14.html create mode 100644 src/main/resources/doc/index-files/index-15.html create mode 100644 src/main/resources/doc/index-files/index-16.html create mode 100644 src/main/resources/doc/index-files/index-2.html create mode 100644 src/main/resources/doc/index-files/index-3.html create mode 100644 src/main/resources/doc/index-files/index-4.html create mode 100644 src/main/resources/doc/index-files/index-5.html create mode 100644 src/main/resources/doc/index-files/index-6.html create mode 100644 src/main/resources/doc/index-files/index-7.html create mode 100644 src/main/resources/doc/index-files/index-8.html create mode 100644 src/main/resources/doc/index-files/index-9.html create mode 100644 src/main/resources/doc/index.html create mode 100644 src/main/resources/doc/overview-frame.html create mode 100644 src/main/resources/doc/overview-summary.html create mode 100644 src/main/resources/doc/overview-tree.html create mode 100644 src/main/resources/doc/package-list create mode 100644 src/main/resources/doc/resources/background.gif create mode 100644 src/main/resources/doc/resources/tab.gif create mode 100644 src/main/resources/doc/resources/titlebar.gif create mode 100644 src/main/resources/doc/resources/titlebar_end.gif create mode 100644 src/main/resources/doc/serialized-form.html create mode 100644 src/main/resources/doc/stylesheet.css create mode 100644 src/main/resources/examples/com/rallydev/rest/CollectionAddExample.java create mode 100644 src/main/resources/examples/com/rallydev/rest/CollectionQueryExample.java create mode 100644 src/main/resources/examples/com/rallydev/rest/CollectionSummaryExample.java create mode 100644 src/main/resources/examples/com/rallydev/rest/CrudExample.java create mode 100644 src/main/resources/examples/com/rallydev/rest/QueryExample.java create mode 100644 src/main/resources/examples/com/rallydev/rest/RestApiFactory.java create mode 100644 src/test/java/com/rallydev/rest/RallyRestApiTest.java create mode 100644 src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java create mode 100644 src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java create mode 100644 src/test/java/com/rallydev/rest/client/HttpClientTest.java create mode 100644 src/test/java/com/rallydev/rest/matchers/HttpRequestBodyMatcher.java create mode 100644 src/test/java/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.java create mode 100644 src/test/java/com/rallydev/rest/matchers/HttpRequestUrlMatcher.java create mode 100644 src/test/java/com/rallydev/rest/request/CollectionUpdateRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/CreateRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/DeleteRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/GetRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/QueryRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/RequestTest.java create mode 100644 src/test/java/com/rallydev/rest/request/UpdateRequestTest.java create mode 100644 src/test/java/com/rallydev/rest/response/CollectionUpdateResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/CreateResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/DeleteResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/GetResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/QueryResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/ResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/response/UpdateResponseTest.java create mode 100644 src/test/java/com/rallydev/rest/util/FetchTest.java create mode 100644 src/test/java/com/rallydev/rest/util/QueryFilterTest.java create mode 100644 src/test/java/com/rallydev/rest/util/RefTest.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..8b5a9fa --- /dev/null +++ b/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0213e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +out/ +.DS_Store +/target +.idea +*.iws +/test-output/ diff --git a/.project b/.project new file mode 100644 index 0000000..00e227e --- /dev/null +++ b/.project @@ -0,0 +1,36 @@ + + + RallyRestToolkitForJava + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bb49c9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2002-2012 Rally Software Development Corp. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5deef6c --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +## License + +Copyright (c) Rally Software Development Corp. 2013 Distributed under the MIT License. + +## Warranty + +The Java Toolkit for Rally REST API is available on an as-is basis. + +## Support + +Rally Software does not actively maintain or support this toolkit. If you have a question or problem, we recommend posting it to Stack Overflow: http://stackoverflow.com/questions/ask?tags=rally + +## Download + +[Download REST API jar and dependencies](https://github.com/RallyTools/RallyRestToolkitForJava/wiki/User-Guide#setup) + +## User Guide + +Please view the [Java Toolkit for Rally REST API User Guide](https://github.com/RallyTools/RallyRestToolkitForJava/wiki/User-Guide) in the attached wiki + +[Java Toolkit for Rally REST API javadocs](http://rallytools.github.io/RallyRestToolkitForJava/) + +[Web Services API documentation](https://rally1.rallydev.com/slm/doc/webservice) + +## Developer Guide +Please view the [Developer Guide](https://github.com/RallyTools/RallyRestToolkitForJava/wiki/Developer-Guide) in the attached wiki diff --git a/RallyRestToolkitForJava.iml b/RallyRestToolkitForJava.iml new file mode 100644 index 0000000..59304dc --- /dev/null +++ b/RallyRestToolkitForJava.iml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RallyRestToolkitForJava.ipr b/RallyRestToolkitForJava.ipr new file mode 100644 index 0000000..60e64fe --- /dev/null +++ b/RallyRestToolkitForJava.ipr @@ -0,0 +1,357 @@ + + + + + $PROJECT_DIR$/out/artifacts/rally_rest_api_2_2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4c8291a --- /dev/null +++ b/pom.xml @@ -0,0 +1,118 @@ + + + 4.0.0 + + com.mastercard.fusion.application + parent + 0.7 + + + com.mastercard.devservices.alm + jar + Rally Rest Toolkit For Java + rally-rest-api + 2.2.2-SNAPSHOT + + A java toolkit for interacting with the Rally Rest API + + https://github.com/RallyTools/RallyRestToolkitForJava + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + + krmorse + Kyle Morse + + + + + scm:git:git@github.com:RallyTools/RallyRestToolkitForJava.git + scm:git:git@github.com:RallyTools/RallyRestToolkitForJava.git + git@github.com:RallyTools/RallyRestToolkitForJava.git + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.2 + true + + sonatype-nexus-staging + + https://oss.sonatype.org/ + + + + + + + + org.apache.httpcomponents + httpclient + 4.2.5 + + + com.google.code.gson + gson + 2.2.4 + + + org.testng + testng + 6.1.1 + test + + + org.mockito + mockito-core + 1.9.5 + test + + + + + diff --git a/src/main/java/META-INF/MANIFEST.MF b/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000..e2ce639 --- /dev/null +++ b/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: "1.2" +Implementation-Vendor: "Rally Software, Inc." +Implementation-Title: "com.rallydev.rest" +Implementation-Version: "2.2.1" +Class-Path: "httpcore-4.2.4.jar httpclient-4.2.5.jar commons-logging-1.1.1.jar commons-codec-1.6.jar gson-2.2.4.jar" +Specification-Vendor: "Rally Software, Inc." +Name: "com/rallydev/rest/" +Specification-Title: "Rally Rest API for Java" +Specification-Version: "2.2.1" diff --git a/src/main/java/com/rallydev/rest/RallyRestApi.java b/src/main/java/com/rallydev/rest/RallyRestApi.java new file mode 100644 index 0000000..c3fa7ab --- /dev/null +++ b/src/main/java/com/rallydev/rest/RallyRestApi.java @@ -0,0 +1,255 @@ +package com.rallydev.rest; + +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; + +import com.google.gson.JsonArray; +import com.rallydev.rest.client.ApiKeyClient; +import com.rallydev.rest.client.BasicAuthClient; +import com.rallydev.rest.client.HttpClient; +import com.rallydev.rest.request.CollectionUpdateRequest; +import com.rallydev.rest.request.CreateRequest; +import com.rallydev.rest.request.DeleteRequest; +import com.rallydev.rest.request.GetRequest; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.request.UpdateRequest; +import com.rallydev.rest.response.CollectionUpdateResponse; +import com.rallydev.rest.response.CreateResponse; +import com.rallydev.rest.response.DeleteResponse; +import com.rallydev.rest.response.GetResponse; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.response.UpdateResponse; + +/** + *

The main interface to the Rest API.

+ *

Provides CRUD and query operations.

+ */ +public class RallyRestApi implements Closeable { + + protected HttpClient client; + + /** + * Creates a new instance for the specified server using the specified credentials. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param userName The username to be used for authentication. + * @param password The password to be used for authentication. + * @deprecated Use the api key constructor instead. + */ + public RallyRestApi(URI server, String userName, String password) { + this(new BasicAuthClient(server, userName, password)); + } + + /** + * Creates a new instance for the specified server using the specified credentials. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param userName The username to be used for authentication. + * @param password The password to be used for authentication. + * @param httpClient The pre-configured httpClient. + * @deprecated Use the api key constructor instead. + */ + public RallyRestApi(URI server, String userName, String password, org.apache.http.client.HttpClient httpClient) { + this(new BasicAuthClient(server, userName, password, httpClient)); + } + + /** + * Creates a new instance for the specified server using the specified API Key. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param apiKey The API Key to be used for authentication. + */ + public RallyRestApi(URI server, String apiKey) { + this(new ApiKeyClient(server, apiKey)); + } + + /** + * Creates a new instance for the specified server using the specified API Key and a pre-configured httpClient. + * + * @param server The server to connect to, e.g. {@code new URI("https://rally1.rallydev.com")} + * @param apiKey The API Key to be used for authentication. + * @param httpClient The pre-configured httpClient. + */ + public RallyRestApi(URI server, String apiKey, org.apache.http.client.HttpClient httpClient) { + this(new ApiKeyClient(server, apiKey, httpClient)); + } + + protected RallyRestApi(HttpClient httpClient) { + this.client = httpClient; + } + + /** + * Set the unauthenticated proxy server to use. By default no proxy is configured. + * + * @param proxy The proxy server, e.g. {@code new URI("http://my.proxy.com:8000")} + */ + public void setProxy(URI proxy) { + client.setProxy(proxy); + } + + /** + * Set the authenticated proxy server to use. By default no proxy is configured. + * + * @param proxy The proxy server, e.g. {@code new URI("http://my.proxy.com:8000")} + * @param userName The username to be used for authentication. + * @param password The password to be used for authentication. + */ + public void setProxy(URI proxy, String userName, String password) { + client.setProxy(proxy, userName, password); + } + + /** + * Set the value of the X-RallyIntegrationVendor header included on all requests. + * This should be set to your company name. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationVendor(String value) { + client.setApplicationVendor(value); + } + + /** + * Set the value of the X-RallyIntegrationVersion header included on all requests. + * This should be set to the version of your application. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationVersion(String value) { + client.setApplicationVersion(value); + } + + /** + * Set the value of the X-RallyIntegrationName header included on all requests. + * This should be set to the name of your application. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationName(String value) { + client.setApplicationName(value); + } + + /** + * Get the current version of the WSAPI being targeted. + * Defaults to v2.0 + * + * @return the current WSAPI version. + */ + public String getWsapiVersion() { + return client.getWsapiVersion(); + } + + /** + * Set the current version of the WSAPI being targeted. + * + * @param wsapiVersion the new version, e.g. {@code "1.30"} + */ + public void setWsapiVersion(String wsapiVersion) { + client.setWsapiVersion(wsapiVersion); + } + + /** + * Create the specified object. + * + * @param request the {@link CreateRequest} specifying the object to be created. + * @return the resulting {@link CreateResponse} + * @throws IOException if an error occurs during the creation. + */ + public CreateResponse create(CreateRequest request) throws IOException { + return new CreateResponse(client.doPost(request.toUrl(), request.getBody())); + } + + /** + * Update the specified object. + * + * @param request the {@link UpdateRequest} specifying the object to be updated. + * @return the resulting {@link UpdateResponse} + * @throws IOException if an error occurs during the update. + */ + public UpdateResponse update(UpdateRequest request) throws IOException { + return new UpdateResponse(client.doPost(request.toUrl(), request.getBody())); + } + + /** + * Update the specified collection. + * Note that this method is only usable with WSAPI versions 2.0 and above. + * + * @param request the {@link CollectionUpdateRequest} specifying the collection to be updated. + * @return the resulting {@link CollectionUpdateResponse} + * @throws IOException if an error occurs during the update. + */ + public CollectionUpdateResponse updateCollection(CollectionUpdateRequest request) throws IOException { + return new CollectionUpdateResponse(client.doPost(request.toUrl(), request.getBody())); + } + + /** + * Delete the specified object. + * + * @param request the {@link DeleteRequest} specifying the object to be deleted. + * @return the resulting {@link DeleteResponse} + * @throws IOException if an error occurs during the deletion. + */ + public DeleteResponse delete(DeleteRequest request) throws IOException { + return new DeleteResponse(client.doDelete(request.toUrl())); + } + + /** + * Query for objects matching the specified request. + * By default one page of data will be returned. + * Paging will automatically be performed if a limit is set on the request. + * + * @param request the {@link QueryRequest} specifying the object to be created. + * @return the resulting {@link QueryResponse} + * @throws IOException if an error occurs during the query. + */ + public QueryResponse query(QueryRequest request) throws IOException { + QueryResponse queryResponse = new QueryResponse(client.doGet(request.toUrl())); + if (queryResponse.wasSuccessful()) { + int receivedRecords = request.getPageSize(); + while (receivedRecords < request.getLimit() && + (receivedRecords + request.getStart() - 1) < queryResponse.getTotalResultCount()) { + QueryRequest pageRequest = request.clone(); + pageRequest.setStart(receivedRecords + request.getStart()); + QueryResponse pageResponse = new QueryResponse(client.doGet(pageRequest.toUrl())); + if (pageResponse.wasSuccessful()) { + JsonArray results = queryResponse.getResults(); + results.addAll(pageResponse.getResults()); + receivedRecords += pageRequest.getPageSize(); + } + } + } + + return queryResponse; + } + + /** + * Get the specified object. + * + * @param request the {@link GetRequest} specifying the object to be retrieved. + * @return the resulting {@link GetResponse} + * @throws IOException if an error occurs during the retrieval. + */ + public GetResponse get(GetRequest request) throws IOException { + return new GetResponse(client.doGet(request.toUrl())); + } + + /** + * Release all resources associated with this instance. + * + * @throws IOException if an error occurs releasing resources + */ + public void close() throws IOException { + client.close(); + } + + /** + * Get the underlying http client implementation. + * This is exposed with the intent of providing the ability to supply additional configuration to the client. + * It should not be used to directly make i/o calls. + * + * @return the raw http client + */ + public HttpClient getClient() { + return client; + } +} \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/client/ApiKeyClient.java b/src/main/java/com/rallydev/rest/client/ApiKeyClient.java new file mode 100644 index 0000000..80209f9 --- /dev/null +++ b/src/main/java/com/rallydev/rest/client/ApiKeyClient.java @@ -0,0 +1,50 @@ +package com.rallydev.rest.client; + +import java.io.IOException; +import java.net.URI; + +import org.apache.http.client.methods.HttpRequestBase; + +/** + * A HttpClient which authenticates using an API Key. + */ +public class ApiKeyClient extends HttpClient { + + protected String apiKey; + protected static final String API_KEY_HEADER = "zsessionid"; + + /** + * Construct a new client. + * @param server the server to connect to + * @param apiKey the key to be used for authentication + */ + public ApiKeyClient(URI server, String apiKey) { + super(server); + this.apiKey = apiKey; + } + + /** + * Construct a new client with a pre-configured HttpClient. + * + * @param server the server to connect to + * @param apiKey the key to be used for authentication + */ + public ApiKeyClient(URI server, String apiKey, org.apache.http.client.HttpClient httpClient) { + super(server, httpClient); + this.apiKey = apiKey; + } + + /** + * Execute a request against the WSAPI + * + * @param request the request to be executed + * @return the JSON encoded string response + * @throws java.io.IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + @Override + protected String doRequest(HttpRequestBase request) throws IOException { + request.setHeader(API_KEY_HEADER, this.apiKey); + return super.doRequest(request); + } +} \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/client/BasicAuthClient.java b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java new file mode 100644 index 0000000..215e506 --- /dev/null +++ b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java @@ -0,0 +1,109 @@ +package com.rallydev.rest.client; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.http.auth.Credentials; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.auth.BasicScheme; + +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.rallydev.rest.response.GetResponse; + +/** + * A HttpClient which authenticates using basic authentication (username/password). + */ +public class BasicAuthClient extends HttpClient { + + protected static final String SECURITY_ENDPOINT_DOES_NOT_EXIST = "SECURITY_ENDPOINT_DOES_NOT_EXIST"; + protected static final String SECURITY_TOKEN_PARAM_KEY = "key"; + private static final String SECURITY_TOKEN_URL = "/security/authorize"; + protected static final String SECURITY_TOKEN_KEY = "SecurityToken"; + protected String securityToken; + protected Credentials credentials; + + /** + * Construct a new client. + * @param server the server to connect to + * @param userName the username to be used for authentication + * @param password the password to be used for authentication + */ + public BasicAuthClient(URI server, String userName, String password) { + super(server); + credentials = setClientCredentials(server, userName, password); + } + + /** + * Construct a new client with a pre-configured HttpClient. + * + * @param server the server to connect to + * @param userName the username to be used for authentication + * @param password the password to be used for authentication + */ + public BasicAuthClient(URI server, String userName, String password, org.apache.http.client.HttpClient client) { + super(server, client); + credentials = setClientCredentials(server, userName, password); + } + + /** + * Execute a request against the WSAPI. + * + * Always attaches the Basic Authentication header to avoid HTTP Spec handling. + * + * Traditionally, all requests are attempted without authorization, + * however we know that all resources are protected, so we can force pre-authentication. + * + * @param request the request to be executed + * @return the JSON encoded string response + * @throws java.io.IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + @Override + protected String doRequest(HttpRequestBase request) throws IOException { + request.addHeader(BasicScheme.authenticate(credentials, "utf-8", false)); + + if(!request.getMethod().equals(HttpGet.METHOD_NAME) && + !this.getWsapiVersion().matches("^1[.]\\d+")) { + try { + attachSecurityInfo(request); + } catch (URISyntaxException e) { + throw new IOException("Unable to build URI with security token", e); + } + } + return super.doRequest(request); + } + + /** + * Attach the security token parameter to the request. + * + * Response Structure: + * {"OperationResult": {"SecurityToken": "UUID"}} + * + * @param request the request to be modified + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + * @throws URISyntaxException if there is a problem with the url in the request + */ + protected void attachSecurityInfo(HttpRequestBase request) throws IOException, URISyntaxException { + if (!SECURITY_ENDPOINT_DOES_NOT_EXIST.equals(securityToken)) { + try { + if (securityToken == null) { + HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL); + GetResponse getResponse = new GetResponse(doRequest(httpGet)); + JsonObject operationResult = getResponse.getObject(); + JsonPrimitive securityTokenPrimitive = operationResult.getAsJsonPrimitive(SECURITY_TOKEN_KEY); + securityToken = securityTokenPrimitive.getAsString(); + } + request.setURI(new URIBuilder(request.getURI()).addParameter(SECURITY_TOKEN_PARAM_KEY, securityToken).build()); + } catch (IOException e) { + //swallow the exception in this case as url does not exist indicates running and old version of + //ALM without the security endpoint + securityToken = SECURITY_ENDPOINT_DOES_NOT_EXIST; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/client/HttpClient.java b/src/main/java/com/rallydev/rest/client/HttpClient.java new file mode 100644 index 0000000..d657088 --- /dev/null +++ b/src/main/java/com/rallydev/rest/client/HttpClient.java @@ -0,0 +1,262 @@ +package com.rallydev.rest.client; + +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpHost; +import org.apache.http.HttpResponse; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.Credentials; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.conn.params.ConnRoutePNames; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DecompressingHttpClient; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.util.EntityUtils; + +/** + * A HttpClient implementation providing connectivity to Rally. This class does not + * provide any authentication on its own but instead relies on a concrete subclass to do so. + */ +public class HttpClient extends DefaultHttpClient + implements Closeable { + + protected URI server; + protected String wsapiVersion = "v2.0"; + protected org.apache.http.client.HttpClient client; + + private enum Header { + Library, + Name, + Vendor, + Version + } + + private Map headers = new HashMap() { + { + put(Header.Library, "Rally Rest API for Java v2.2.1"); + put(Header.Name, "Rally Rest API for Java"); + put(Header.Vendor, "Rally Software, Inc."); + put(Header.Version, "2.2.1"); + } + }; + + protected HttpClient(URI server) { + this.server = server; + client = new DecompressingHttpClient(this); + } + + /** + * Allow the user to specify a compliant HttpClient + * + * @param server The URI of the remote server + * @param client A pre-configured HttpClient implementation + */ + public HttpClient(URI server, org.apache.http.client.HttpClient client) { + this.server = server; + this.client = client; + } + + /** + * Set the unauthenticated proxy server to use. By default no proxy is configured. + * + * @param proxy The proxy server, e.g. {@code new URI("http://my.proxy.com:8000")} + */ + public void setProxy(URI proxy) { + this.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme())); + } + + /** + * Set the authenticated proxy server to use. By default no proxy is configured. + * + * @param proxy The proxy server, e.g. {@code new URI("http://my.proxy.com:8000")} + * @param userName The username to be used for authentication. + * @param password The password to be used for authentication. + */ + public void setProxy(URI proxy, String userName, String password) { + setProxy(proxy); + setClientCredentials(proxy, userName, password); + } + + /** + * Set the value of the X-RallyIntegrationVendor header included on all requests. + * This should be set to your company name. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationVendor(String value) { + headers.put(Header.Vendor, value); + } + + /** + * Set the value of the X-RallyIntegrationVersion header included on all requests. + * This should be set to the version of your application. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationVersion(String value) { + headers.put(Header.Version, value); + } + + /** + * Set the value of the X-RallyIntegrationName header included on all requests. + * This should be set to the name of your application. + * + * @param value The vendor header to be included on all requests. + */ + public void setApplicationName(String value) { + headers.put(Header.Name, value); + } + + /** + * Get the current server being targeted. + * + * @return the current server. + */ + public String getServer() { + return server.toString(); + } + + /** + * Get the current version of the WSAPI being targeted. + * + * @return the current WSAPI version. + */ + public String getWsapiVersion() { + return wsapiVersion; + } + + /** + * Set the current version of the WSAPI being targeted. + * + * @param wsapiVersion the new version, e.g. {@code "1.30"} + */ + public void setWsapiVersion(String wsapiVersion) { + this.wsapiVersion = wsapiVersion; + } + + /** + * Execute a request against the WSAPI + * + * @param request the request to be executed + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + protected String doRequest(HttpRequestBase request) throws IOException { + for (Map.Entry header : headers.entrySet()) { + request.setHeader("X-RallyIntegration" + header.getKey().name(), header.getValue()); + } + + return this.executeRequest(request); + } + + /** + * Execute a request against the WSAPI + * + * @param request the request to be executed + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + protected String executeRequest(HttpRequestBase request) throws IOException { + HttpResponse response = client.execute(request); + HttpEntity entity = response.getEntity(); + if (response.getStatusLine().getStatusCode() == 200) { + return EntityUtils.toString(entity, "utf-8"); + } else { + EntityUtils.consumeQuietly(entity); + throw new IOException(response.getStatusLine().toString()); + } + } + + /** + * Perform a post against the WSAPI + * + * @param url the request url + * @param body the body of the post + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + public String doPost(String url, String body) throws IOException { + HttpPost httpPost = new HttpPost(getWsapiUrl() + url); + httpPost.setEntity(new StringEntity(body, "utf-8")); + return doRequest(httpPost); + } + + + /** + * Perform a put against the WSAPI + * + * @param url the request url + * @param body the body of the put + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + public String doPut(String url, String body) throws IOException { + HttpPut httpPut = new HttpPut(getWsapiUrl() + url); + httpPut.setEntity(new StringEntity(body, "utf-8")); + return doRequest(httpPut); + } + + /** + * Perform a delete against the WSAPI + * + * @param url the request url + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + public String doDelete(String url) throws IOException { + HttpDelete httpDelete = new HttpDelete(getWsapiUrl() + url); + return doRequest(httpDelete); + } + + /** + * Perform a get against the WSAPI + * + * @param url the request url + * @return the JSON encoded string response + * @throws IOException if a non-200 response code is returned or if some other + * problem occurs while executing the request + */ + public String doGet(String url) throws IOException { + HttpGet httpGet = new HttpGet(getWsapiUrl() + url); + return doRequest(httpGet); + } + + /** + * Release all resources associated with this instance. + * + * @throws IOException if an error occurs releasing resources + */ + public void close() throws IOException { + client.getConnectionManager().shutdown(); + } + + protected Credentials setClientCredentials(URI server, String userName, String password) { + UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(userName, password); + this.getCredentialsProvider().setCredentials(new AuthScope(server.getHost(), server.getPort()), credentials); + return credentials; + } + + /** + * Get the WSAPI base url based on the current server and WSAPI version + * + * @return the fully qualified WSAPI base url, e.g. https://rally1.rallydev.com/slm/webservice/1.33 + */ + public String getWsapiUrl() { + return getServer() + "/slm/webservice/" + getWsapiVersion(); + } +} diff --git a/src/main/java/com/rallydev/rest/client/package-info.java b/src/main/java/com/rallydev/rest/client/package-info.java new file mode 100644 index 0000000..2b38cbd --- /dev/null +++ b/src/main/java/com/rallydev/rest/client/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides the underlying http client implementations. + */ +package com.rallydev.rest.client; \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/package-info.java b/src/main/java/com/rallydev/rest/package-info.java new file mode 100644 index 0000000..f9d15fc --- /dev/null +++ b/src/main/java/com/rallydev/rest/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides the main interface to the Rest API. + */ +package com.rallydev.rest; \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/request/CollectionUpdateRequest.java b/src/main/java/com/rallydev/rest/request/CollectionUpdateRequest.java new file mode 100644 index 0000000..4b162b1 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/CollectionUpdateRequest.java @@ -0,0 +1,96 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.Ref; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI request to update a collection. + */ +public class CollectionUpdateRequest extends Request { + + private String ref; + private JsonArray items; + private boolean adding; + private Fetch fetch = new Fetch(); + + /** + * Create a new update request for the specified collection and values. + * Note that this class is only usable with WSAPI versions 2.0 and above. + * + * @param collection the collection to be updated + * @param items the items to be added or removed + * @param add true if adding, false if removing + */ + public CollectionUpdateRequest(JsonObject collection, JsonArray items, boolean add) { + this(collection.get("_ref").getAsString(), items, add); + } + + /** + * Create a new update request for the specified collection and values. + * + * @param collectionRef the ref of the collection to be updated. May be absolute or relative, e.g. "/defect/12345/tags" + * @param items the items to be added or removed + * @param adding true if adding, false if removing + */ + public CollectionUpdateRequest(String collectionRef, JsonArray items, boolean adding) { + this.ref = collectionRef; + this.items = items; + this.adding = adding; + } + + /** + * Get the JSON encoded string representation of the object to be updated. + * + * @return the JSON encoded object + */ + public String getBody() { + JsonObject wrapper = new JsonObject(); + wrapper.add("CollectionItems", items); + return gsonBuilder.create().toJson(wrapper); + } + + /** + *

Get the current list of fields to be returned on the updated object.

+ * By default all fields will be returned in the response (fetch=true). + * + * @return the current list of fields. + */ + public Fetch getFetch() { + return fetch; + } + + /** + * Set the current list of fields to be returned on the updated object. + * + * @param fetch the list of fields to be returned. + */ + public void setFetch(Fetch fetch) { + this.fetch = fetch; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * The current fetch and any other parameters will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + + List params = new ArrayList(getParams()); + + params.add(new BasicNameValuePair("fetch", getFetch().toString())); + + return String.format("%s/%s.js?%s", Ref.getRelativeRef(ref), + adding ? "add" : "remove", + URLEncodedUtils.format(params, "utf-8")); + } +} diff --git a/src/main/java/com/rallydev/rest/request/CreateRequest.java b/src/main/java/com/rallydev/rest/request/CreateRequest.java new file mode 100644 index 0000000..86aa554 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/CreateRequest.java @@ -0,0 +1,77 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI request to create an object. + */ +public class CreateRequest extends Request { + + private String type; + private JsonObject obj; + private Fetch fetch = new Fetch(); + + /** + * Create a new create request with the specified type and values. + * + * @param type the WSAPI object type to be created, e.g. Defect + * @param obj the JSON representation of the values of the object + */ + public CreateRequest(String type, JsonObject obj) { + this.type = type; + this.obj = obj; + } + + /** + * Get the JSON encoded string representation of the object to be created. + * + * @return the JSON encoded object + */ + public String getBody() { + JsonObject wrapper = new JsonObject(); + wrapper.add(type, obj); + return gsonBuilder.create().toJson(wrapper); + } + + /** + *

Get the current list of fields to be returned on the created object.

+ * By default only the underscore fields such as _ref will be returned in the response. + * + * @return the current list of fields. + */ + public Fetch getFetch() { + return fetch; + } + + /** + * Set the current list of fields to be returned on the created object. + * + * @param fetch the list of fields to be returned. + */ + public void setFetch(Fetch fetch) { + this.fetch = fetch; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * The current fetch and any other parameters will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + List params = new ArrayList(getParams()); + + params.add(new BasicNameValuePair("fetch", getFetch().toString())); + + return String.format("/%s/create.js?%s", type.toLowerCase().replaceAll(" ", ""), + URLEncodedUtils.format(params, "utf-8")); + } +} diff --git a/src/main/java/com/rallydev/rest/request/DeleteRequest.java b/src/main/java/com/rallydev/rest/request/DeleteRequest.java new file mode 100644 index 0000000..33a1aa7 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/DeleteRequest.java @@ -0,0 +1,32 @@ +package com.rallydev.rest.request; + +import com.rallydev.rest.util.Ref; +import org.apache.http.client.utils.URLEncodedUtils; + +/** + * Represents a WSAPI request to delete an object. + */ +public class DeleteRequest extends Request{ + + private String ref; + + /** + * Createa new delete request for the specified object. + * @param ref the ref of the WSAPI object to be created. May be absolute or relative, e.g. "/defect/12345" + */ + public DeleteRequest(String ref) { + this.ref = ref; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * Any parameters set will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + return String.format("%s.js%s", Ref.getRelativeRef(ref), + getParams().size() > 0 ? ("?" + URLEncodedUtils.format(getParams(), "utf-8")) : ""); + } +} diff --git a/src/main/java/com/rallydev/rest/request/GetRequest.java b/src/main/java/com/rallydev/rest/request/GetRequest.java new file mode 100644 index 0000000..eaea818 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/GetRequest.java @@ -0,0 +1,75 @@ +package com.rallydev.rest.request; + +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.Ref; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI request to retrieve a specific object. + */ +public class GetRequest extends Request { + + private String ref; + private Fetch fetch = new Fetch(); + + /** + * Create a new get request for the specified object. + * + * @param ref the ref of the WSAPI object to be retrieved. May be absolute or relative, e.g. "/defect/12345" + * May also be "/user" or "/subscription" to get the current instances + */ + public GetRequest(String ref) { + this.ref = ref; + } + + /** + *

Get the current list of fields to be returned on the retrieved object.

+ * By default all fields will be returned in the response (fetch=true). + * + * @return the current list of fields. + */ + public Fetch getFetch() { + return fetch; + } + + /** + * Set the current list of fields to be returned on the retrieved object. + * + * @param fetch the list of fields to be returned. + */ + public void setFetch(Fetch fetch) { + this.fetch = fetch; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * The current fetch and any other parameters will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + List params = new ArrayList(getParams()); + params.add(new BasicNameValuePair("fetch", fetch.toString())); + return String.format("%s.js?%s", getEndpoint(), + URLEncodedUtils.format(params, "utf-8")); + } + + protected String getEndpoint() { + String endpoint = ref.toLowerCase(); + if (Ref.isRef(endpoint)) { + endpoint = Ref.getRelativeRef(endpoint); + } else if (endpoint.contains("user")) { + endpoint = "/user"; + } else if (endpoint.contains("subscription")) { + endpoint = "/subscription"; + } + + return endpoint; + } +} diff --git a/src/main/java/com/rallydev/rest/request/QueryRequest.java b/src/main/java/com/rallydev/rest/request/QueryRequest.java new file mode 100644 index 0000000..c013452 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/QueryRequest.java @@ -0,0 +1,305 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; +import com.rallydev.rest.util.Ref; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI request to retrieve all objects matching specified criteria. + */ +public class QueryRequest extends Request implements Cloneable { + + private String type; + private JsonObject collection; + + private Fetch fetch = new Fetch(); + private String order = "ObjectID"; + private QueryFilter queryFilter = null; + + private int pageSize = 200; + private int limit = 0; + private int start = 1; + + private String workspace = ""; + private String project = ""; + private boolean scopedUp = false; + private boolean scopedDown = true; + + /** + * Create a new query request for the specified type. + * + * @param type The WSAPI type to be queried, e.g. Defect + */ + public QueryRequest(String type) { + this.type = type; + } + + /** + * Create a new query request for the specified collection. + * Only supported in WSAPI v2.0 and above. + * + * @param collection The collection to query. Should have a _ref property. + */ + public QueryRequest(JsonObject collection) { + this.collection = collection; + } + + /** + * Get the filter by which the result set will be narrowed down. + * + * @return the filter + */ + public QueryFilter getQueryFilter() { + return queryFilter; + } + + /** + * Set a filter by which the result set will be narrowed down. + * + * @param queryFilter the filter + */ + public void setQueryFilter(QueryFilter queryFilter) { + this.queryFilter = queryFilter; + } + + /** + * Set the order by which the result set will be sorted. + *

The default is ObjectID ASC.

+ * + * @return the order + */ + public String getOrder() { + return order; + } + + /** + * Get the order by which the result set will be sorted. + * + * @param order the order + */ + public void setOrder(String order) { + this.order = order; + } + + /** + * Get the workspace which the result set should be scoped to. + * + * @return the project + */ + public String getWorkspace() { + return workspace; + } + + /** + *

Specify the workspace which the result set should be scoped to.

+ * The default is the user's default workspace. + * + * @param workspaceRef the ref of the workspace to scope to. May be an absolute or relative ref, e.g. /workspace/1234 + */ + public void setWorkspace(String workspaceRef) { + this.workspace = workspaceRef; + } + + /** + * Get the project which the result set should be scoped to. + * + * @return the project + */ + public String getProject() { + return project; + } + + /** + *

Specify the project which the result set should be scoped to.

+ * The default is the user's default project. + * Specifying null will cause the result to be scoped to the entire specified workspace. + * + * @param projectRef the ref of the project to scope to. May be null or an absolute or relative ref, e.g. /project/1234 + */ + public void setProject(String projectRef) { + this.project = projectRef; + } + + /** + * If a project has been specified, get whether to include matching objects in parent projects in the result set. + * + * @return whether to include matching objects in parent projects. + */ + public boolean isScopedUp() { + return scopedUp; + } + + /** + *

If a project has been specified, set whether to include matching objects in parent projects in the result set.

+ * Defaults to false. + * + * @param scopeUp whether to include matching objects in parent projects + */ + public void setScopedUp(boolean scopeUp) { + this.scopedUp = scopeUp; + } + + /** + * If a project has been specified, get whether to include matching objects in child projects in the result set. + * + * @return whether to include matching objects in child projects. + */ + public boolean isScopedDown() { + return scopedDown; + } + + /** + *

If a project has been specified, set whether to include matching objects in child projects in the result set.

+ * Defaults to true. + * + * @param scopeDown whether to include matching objects in child projects + */ + public void setScopedDown(boolean scopeDown) { + this.scopedDown = scopeDown; + } + + /** + * Get the start index of the result set. + * + * @return the start index + */ + public int getStart() { + return start; + } + + /** + * Set the 1-based start index of the result set. + * The default is 1. + * + * @param start the start index + */ + public void setStart(int start) { + this.start = start; + } + + /** + *

Get the current list of fields to be returned on the matching objects.

+ * By default all fields will be returned in the response (fetch=true). + * + * @return the current list of fields. + */ + public Fetch getFetch() { + return fetch; + } + + /** + * Set the current list of fields to be returned on the matching objects. + * + * @param fetch the list of fields to be returned. + */ + public void setFetch(Fetch fetch) { + this.fetch = fetch; + } + + /** + * Get the page size of the result set. + * + * @return the page size + */ + public int getPageSize() { + return pageSize; + } + + /** + *

Set the page size of the result set.

+ * The default is 200. + * + * @param pageSize the new page size. Must be between 1 and 200 inclusive. + */ + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + /** + * Get the maximum number of records to be returned from the query. + * + * @return the maximum number of records + */ + public int getLimit() { + return limit; + } + + /** + *

Set the maximum number of records to be returned from the query.

+ * If not set only one page of data will be returned by {@link com.rallydev.rest.RallyRestApi#query} + * + * @param limit the maximum number of records to be returned + */ + public void setLimit(int limit) { + this.limit = limit; + } + + /** + * Clone this request. + * + * @return the cloned instance of this request. + */ + @Override + public QueryRequest clone() { + try { + return (QueryRequest) super.clone(); + } catch (CloneNotSupportedException c) { + return null; + } + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * The current criteria set on this request and any other parameters will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + List params = new ArrayList(getParams()); + + params.add(new BasicNameValuePair("start", Integer.toString(getStart()))); + params.add(new BasicNameValuePair("pagesize", Integer.toString(getPageSize()))); + params.add(new BasicNameValuePair("fetch", fetch.toString())); + + String order = getOrder(); + if (!order.contains("ObjectID")) { + order += ",ObjectID"; + } + params.add(new BasicNameValuePair("order", order)); + if (getQueryFilter() != null) { + params.add(new BasicNameValuePair("query", getQueryFilter().toString())); + } + + if (getWorkspace() != null && getWorkspace().length() > 0) { + params.add(new BasicNameValuePair("workspace", Ref.getRelativeRef(getWorkspace()))); + } + + if (getProject() == null) { + params.add(new BasicNameValuePair("project", "null")); + } else if (getProject().length() > 0) { + params.add(new BasicNameValuePair("project", getProject())); + params.add(new BasicNameValuePair("projectScopeUp", Boolean.toString(isScopedUp()))); + params.add(new BasicNameValuePair("projectScopeDown", Boolean.toString(isScopedDown()))); + } + + return (this.type != null ? getTypeEndpoint() : + Ref.getRelativeRef(collection.get("_ref").getAsString())) + + "?" + URLEncodedUtils.format(params, "utf-8"); + } + + protected String getTypeEndpoint() { + String typeEndpoint = type.toLowerCase().replaceAll(" ", ""); + if (typeEndpoint.equals("subscription") || typeEndpoint.equals("user")) { + typeEndpoint += "s"; + } + return "/" + typeEndpoint + ".js"; + } +} \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/request/Request.java b/src/main/java/com/rallydev/rest/request/Request.java new file mode 100644 index 0000000..9e86066 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/Request.java @@ -0,0 +1,83 @@ +package com.rallydev.rest.request; + +import com.google.gson.GsonBuilder; +import org.apache.http.NameValuePair; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + *

Base class for all WSAPI requests.

+ * Subclasses classes should provide an implementation of {@link com.rallydev.rest.request.Request#toUrl} + */ +public abstract class Request { + + private List params = new ArrayList(); + + /** + * Gson Builder used for JSON serialization in this request. + */ + protected GsonBuilder gsonBuilder; + + /** + * Create a new request. + */ + public Request() { + this.gsonBuilder = new GsonBuilder().serializeNulls(); + } + + /** + * Get the list of additional parameters included in this request. + * + * @return The list of additional parameters + */ + public List getParams() { + return params; + } + + /** + * Set the list of additional parameters included in this request. + * + * @param params The list of additional parameters + */ + public void setParams(List params) { + this.params = params; + } + + /** + * Add the specified parameter to this request. + * + * @param name the parameter name + * @param value the parameter value + */ + public void addParam(String name, String value) { + getParams().add(new BasicNameValuePair(name, value)); + } + + /** + * Get the Gson Builder used for JSON serialization in this request. + * + * @return The Gson Builder used for JSON serialization + */ + public GsonBuilder getGsonBuilder() { + return gsonBuilder; + } + + /** + * Set the Gson Builder used for JSON serialization in this request. + * + * @param gsonBuilder The Gson Builder used for JSON serialization + */ + public void setGsonBuilder(GsonBuilder gsonBuilder) { + this.gsonBuilder = gsonBuilder; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * Must be implemented by subclasses. + * + * @return the url representing this request. + */ + public abstract String toUrl(); +} diff --git a/src/main/java/com/rallydev/rest/request/UpdateRequest.java b/src/main/java/com/rallydev/rest/request/UpdateRequest.java new file mode 100644 index 0000000..e0f3a7d --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/UpdateRequest.java @@ -0,0 +1,79 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.Ref; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI request to update an object. + */ +public class UpdateRequest extends Request { + + private String ref; + private JsonObject obj; + private Fetch fetch = new Fetch(); + + /** + * Create a new update request for the specified object and values. + * + * @param ref the ref of the WSAPI object to be created. May be absolute or relative, e.g. "/defect/12345" + * @param obj the JSON representation of the values of the object + */ + public UpdateRequest(String ref, JsonObject obj) { + this.ref = ref; + this.obj = obj; + } + + /** + * Get the JSON encoded string representation of the object to be updated. + * + * @return the JSON encoded object + */ + public String getBody() { + JsonObject wrapper = new JsonObject(); + wrapper.add(Ref.getTypeFromRef(ref), obj); + return gsonBuilder.create().toJson(wrapper); + } + + /** + *

Get the current list of fields to be returned on the updated object.

+ * By default all fields will be returned in the response (fetch=true). + * + * @return the current list of fields. + */ + public Fetch getFetch() { + return fetch; + } + + /** + * Set the current list of fields to be returned on the updated object. + * + * @param fetch the list of fields to be returned. + */ + public void setFetch(Fetch fetch) { + this.fetch = fetch; + } + + /** + *

Convert this request into a url compatible with the WSAPI.

+ * The current fetch and any other parameters will be included. + * + * @return the url representing this request. + */ + @Override + public String toUrl() { + + List params = new ArrayList(getParams()); + + params.add(new BasicNameValuePair("fetch", getFetch().toString())); + + return String.format("%s.js?%s", Ref.getRelativeRef(ref), + URLEncodedUtils.format(params, "utf-8")); + } +} diff --git a/src/main/java/com/rallydev/rest/request/package-info.java b/src/main/java/com/rallydev/rest/request/package-info.java new file mode 100644 index 0000000..0a45275 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides objects for encoding requests to the Rest API. + */ +package com.rallydev.rest.request; \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/response/CollectionUpdateResponse.java b/src/main/java/com/rallydev/rest/response/CollectionUpdateResponse.java new file mode 100644 index 0000000..6a42b3f --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/CollectionUpdateResponse.java @@ -0,0 +1,37 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonArray; + +/** + * Represents a WSAPI response from updating a collection. + */ +public class CollectionUpdateResponse extends Response { + + /** + * Create a new collection update response from the specified JSON encoded string. + * Note that this class is only usable with WSAPI versions 2.0 and above. + * + * @param updateResponse the JSON encoded string + */ + public CollectionUpdateResponse(String updateResponse) { + super(updateResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + return "OperationResult"; + } + + /** + * Get the results of the collection update + * @return the results + */ + public JsonArray getResults() { + return result.getAsJsonArray("Results"); + } +} diff --git a/src/main/java/com/rallydev/rest/response/CreateResponse.java b/src/main/java/com/rallydev/rest/response/CreateResponse.java new file mode 100644 index 0000000..1a60045 --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/CreateResponse.java @@ -0,0 +1,38 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonObject; +import com.rallydev.rest.RallyRestApi; + +/** + * Represents a WSAPI response from creating an object + */ +public class CreateResponse extends Response { + + /** + * Create a new create response from the specified JSON encoded string. + * + * @param createResponse the JSON encoded string + */ + public CreateResponse(String createResponse) { + super(createResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + return "CreateResult"; + } + + /** + * Get the created object. + *

Returns null if the operation was not successful

+ * @return the created object + */ + public JsonObject getObject() { + return wasSuccessful() ? result.getAsJsonObject("Object") : null; + } +} diff --git a/src/main/java/com/rallydev/rest/response/DeleteResponse.java b/src/main/java/com/rallydev/rest/response/DeleteResponse.java new file mode 100644 index 0000000..477efff --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/DeleteResponse.java @@ -0,0 +1,26 @@ +package com.rallydev.rest.response; + +/** + * Represents a WSAPI response from deleting an object + */ +public class DeleteResponse extends Response { + + /** + * Create a new delete response from the specified JSON encoded string. + * + * @param deleteResponse the JSON encoded string + */ + public DeleteResponse(String deleteResponse) { + super(deleteResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + return "OperationResult"; + } +} diff --git a/src/main/java/com/rallydev/rest/response/GetResponse.java b/src/main/java/com/rallydev/rest/response/GetResponse.java new file mode 100644 index 0000000..0165f9f --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/GetResponse.java @@ -0,0 +1,46 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import java.util.Map; + +/** + * Represents a WSAPI response from retrieving a single object. + */ +public class GetResponse extends Response { + + /** + * Create a new get response from the specified JSON encoded string. + * + * @param getResponse the JSON encoded string + */ + public GetResponse(String getResponse) { + super(getResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + JsonObject result = ((JsonObject) new JsonParser().parse(raw)); + String root = null; + for(Map.Entry member : result.entrySet()) { + root = member.getKey(); + } + return root; + } + + /** + * Get the retrieved object. + *

Returns null if the operation was not successful

+ * @return the retrieved object + */ + public JsonObject getObject() { + return wasSuccessful() ? result : null; + } +} diff --git a/src/main/java/com/rallydev/rest/response/QueryResponse.java b/src/main/java/com/rallydev/rest/response/QueryResponse.java new file mode 100644 index 0000000..148f92e --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/QueryResponse.java @@ -0,0 +1,65 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonArray; + +/** + * Represents a WSAPI response from querying for objects. + */ +public class QueryResponse extends Response { + + /** + * Create a new query response from the specified JSON encoded string. + * + * @param queryResponse the JSON encoded string + */ + public QueryResponse(String queryResponse) { + super(queryResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + return "QueryResult"; + } + + /** + * Get the total number of objects that matched the query + * + * @return the total number of objects + */ + public int getTotalResultCount() { + return result.get("TotalResultCount").getAsInt(); + } + + /** + * Get the results of the query + *

Depending on the limit of the original request this may include one or more pages.

+ * + * @return the results + */ + public JsonArray getResults() { + return result.getAsJsonArray("Results"); + } + + /** + * Get the page size of the results + * + * @return the page size + */ + public int getPageSize() { + return result.get("PageSize").getAsInt(); + } + + /** + * Get the start index of the results + * + * @return the start index + */ + public int getStart() { + return result.get("StartIndex").getAsInt(); + } +} diff --git a/src/main/java/com/rallydev/rest/response/Response.java b/src/main/java/com/rallydev/rest/response/Response.java new file mode 100644 index 0000000..de1123a --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/Response.java @@ -0,0 +1,69 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a WSAPI response. + */ +public abstract class Response { + + protected JsonObject result; + protected String raw; + + /** + * Create a new response from the specified JSON encoded string. + * + * @param response the JSON encoded string + */ + public Response(String response) { + this.raw = response; + this.result = ((JsonObject) new JsonParser().parse(response)).getAsJsonObject(getRoot()); + } + + /** + * Returns whether the response was successful (no errors) + * + * @return whether the response was successful + */ + public boolean wasSuccessful() { + return getErrors().length == 0; + } + + /** + * Get any errors returned in the response. + * + * @return the response errors + */ + public String[] getErrors() { + return parseArray("Errors"); + } + + /** + * Get any warnings returned in the response. + * + * @return the response warnings + */ + public String[] getWarnings() { + return parseArray("Warnings"); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + protected abstract String getRoot(); + + private String[] parseArray(String key) { + List elements = new ArrayList(); + for (JsonElement j : result.getAsJsonArray(key)) { + elements.add(j.getAsString()); + } + return elements.toArray(new String[elements.size()]); + } +} diff --git a/src/main/java/com/rallydev/rest/response/UpdateResponse.java b/src/main/java/com/rallydev/rest/response/UpdateResponse.java new file mode 100644 index 0000000..0e12292 --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/UpdateResponse.java @@ -0,0 +1,37 @@ +package com.rallydev.rest.response; + +import com.google.gson.JsonObject; + +/** + * Represents a WSAPI response from updating an object. + */ +public class UpdateResponse extends Response { + + /** + * Create a new update response from the specified JSON encoded string. + * + * @param updateResponse the JSON encoded string + */ + public UpdateResponse(String updateResponse) { + super(updateResponse); + } + + /** + * Get the name of the root JSON result + * + * @return the root element name + */ + @Override + protected String getRoot() { + return "OperationResult"; + } + + /** + * Get the updated object. + *

Returns null if the operation was not successful

+ * @return the updated object + */ + public JsonObject getObject() { + return wasSuccessful() ? result.getAsJsonObject("Object") : null; + } +} diff --git a/src/main/java/com/rallydev/rest/response/package-info.java b/src/main/java/com/rallydev/rest/response/package-info.java new file mode 100644 index 0000000..8fb39e8 --- /dev/null +++ b/src/main/java/com/rallydev/rest/response/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides objects for parsing responses from the Rest API. + */ +package com.rallydev.rest.response; \ No newline at end of file diff --git a/src/main/java/com/rallydev/rest/util/Fetch.java b/src/main/java/com/rallydev/rest/util/Fetch.java new file mode 100644 index 0000000..9d5804d --- /dev/null +++ b/src/main/java/com/rallydev/rest/util/Fetch.java @@ -0,0 +1,40 @@ +package com.rallydev.rest.util; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * Represents a list of fields to be returned in responses from the WSAPI. + */ +public class Fetch extends ArrayList { + + /** + * Create a new fetch with the specified fields. + * + * @param fetch one or more fields to be returned + */ + public Fetch(String... fetch) { + this.addAll(Arrays.asList(fetch)); + } + + /** + * Get the comma separated list of fields to be returned. + * If the list is empty true will be returned. + * + * @return the comma separated list of fields to be returned + */ + @Override + public String toString() { + if (size() == 0) { + return "true"; + } else { + StringBuilder s = new StringBuilder(); + for (String f : this) { + s.append(f); + s.append(","); + } + s.deleteCharAt(s.length() - 1); + return s.toString(); + } + } +} diff --git a/src/main/java/com/rallydev/rest/util/QueryFilter.java b/src/main/java/com/rallydev/rest/util/QueryFilter.java new file mode 100644 index 0000000..b2a55de --- /dev/null +++ b/src/main/java/com/rallydev/rest/util/QueryFilter.java @@ -0,0 +1,115 @@ +package com.rallydev.rest.util; + +/** + * Represents a query filter to be applied to query requests. + *

More on the WSAPI query syntax can be found here: http://rally1.rallydev.com/slm/doc/webservice

+ */ +public class QueryFilter implements Cloneable { + + private String field; + private String operator; + private String value; + + private QueryFilter left = null; + private QueryFilter right = null; + + /** + * Create a new query filter with the specified options. + * + * @param field the object field to evaluate + * @param operator the operator to use for evaluation + * @param value the value to be evaluated + */ + public QueryFilter(String field, String operator, String value) { + this.field = field; + this.operator = operator; + this.value = value; + } + + /** + * Internal constructor for joining multiple QueryFilter objects by an AND or OR. + * + * @param left the left query + * @param operator AND/OR + * @param right the right query + */ + protected QueryFilter(QueryFilter left, String operator, QueryFilter right) { + this.left = left; + this.operator = operator; + this.right = right; + } + + /** + * Get a query filter that is the ANDed combination of this filter and the specified one. + * + * @param q the filter to be ANDed + * @return the ANDed query filter + */ + public QueryFilter and(QueryFilter q) { + return new QueryFilter(this, "AND", q); + } + + /** + * Get a query filter that is the ORed combination of this filter and the specified one. + * + * @param q the filter to be ORed + * @return the ORed query filter + */ + public QueryFilter or(QueryFilter q) { + return new QueryFilter(this, "OR", q); + } + + /** + * Get the string representation of this query filter. + *

Examples:

+ *
    + *
  • (ScheduleState = Accepted)
  • + *
  • ((ScheduleState = Accepted) AND (Iteration.Name = "My Iteration"))
  • + *
+ * + * @return the string representation of this query filter. + */ + public String toString() { + if (left != null) { + return String.format("(%s %s %s)", left, operator, right); + } else { + String val = value; + if (val != null) { + val = val.contains(" ") ? "\"" + val + "\"" : val; + + if (Ref.isRef(val)) { + val = Ref.getRelativeRef(val); + } + } + return String.format("(%s %s %s)", field, operator, val); + } + } + + /** + * Get a query filter that is the ANDed combination of the specified filters. + * + * @param queryFilters one or more query filters to be ANDed together + * @return the ANDed query filter + */ + public static QueryFilter and(QueryFilter... queryFilters) { + QueryFilter result = null; + for (QueryFilter q : queryFilters) { + result = result == null ? q : result.and(q); + } + return result; + } + + /** + * Get a query filter that is the ORed combination of the specified filters. + * + * @param queryFilters one or more query filters to be ORed together + * @return the ORed query filter + */ + public static QueryFilter or(QueryFilter... queryFilters) { + QueryFilter result = null; + for (QueryFilter q : queryFilters) { + result = result == null ? q : result.or(q); + } + return result; + } +} diff --git a/src/main/java/com/rallydev/rest/util/Ref.java b/src/main/java/com/rallydev/rest/util/Ref.java new file mode 100644 index 0000000..2463787 --- /dev/null +++ b/src/main/java/com/rallydev/rest/util/Ref.java @@ -0,0 +1,103 @@ +package com.rallydev.rest.util; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Provides utility methods for working with ref URLs. + */ +public class Ref { + + private static List patterns = new ArrayList(Arrays.asList( + + //dynatype collection ref (/portfolioitem/feature/1234 + Pattern.compile(".*?/(\\w{2,}/\\w+)/(\\d+/\\w+)(?:\\.js\\??.*)*$"), + + //dynatype ref (/portfolioitem/feature/1234 + Pattern.compile(".*?/(\\w{2,}/\\w+)/(\\d+)(?:\\.js\\??.*)*$"), + + //collection ref (/defect/1234/tasks) + Pattern.compile(".*?/(\\w+/-?\\d+)/(\\w+)(?:\\.js\\??.*)*$"), + + //basic ref (/defect/1234) + Pattern.compile(".*?/(\\w+)/(-?\\d+)(?:\\.js\\??.*)*$"), + + //permission ref (/workspacepermission/123u456w1) + Pattern.compile(".*?/(\\w+)/(\\d+u\\d+[pw]\\d+)(?:\\.js\\??.*)*$"), + + //adding UUID regex support in the ref urls + + //dynatype collection ref (/portfolioitem/feature/81348db8-aacd-447e-8678-2fb910ae9dc3 + Pattern.compile(".*?/(\\w{2,}/\\w+)/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/\\w+)(?:\\.js\\??.*)*$"), + + //dynatype ref (/portfolioitem/feature/81348db8-aacd-447e-8678-2fb910ae9dc3 + Pattern.compile(".*?/(\\w{2,}/\\w+)/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\\.js\\??.*)*$"), + + //collection ref (/defect/81348db8-aacd-447e-8678-2fb910ae9dc3/tasks) + Pattern.compile(".*?/(\\w+/-?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/(\\w+)(?:\\.js\\??.*)*$"), + + //basic ref (/defect/81348db8-aacd-447e-8678-2fb910ae9dc3) + Pattern.compile(".*?/(\\w+)/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\\.js\\??.*)*$") + )); + + private static Matcher match(String ref) { + String test = ref != null ? ref : ""; + for(Pattern pattern : patterns) { + Matcher m = pattern.matcher(test); + if(m.matches()) { + return m; + } + } + return null; + } + + /** + * Determine whether the specified string is a valid ref url. + * + * @param ref the string to be tested. May be either absolute or relative, e.g. /defect/1234 + * + * @return whether the specified string is a valid ref url + */ + public static boolean isRef(String ref) { + return match(ref) != null; + } + + /** + * Create a relative ref url from the specified ref + * + * @param ref the ref url to be made relative + * + * @return the relative ref url or null if the specified ref was not valid + */ + public static String getRelativeRef(String ref) { + Matcher matcher = match(ref); + return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null; + } + + /** + * Get the type from the specified ref url + * + * @param ref the ref url to extract the type from + * + * @return the extracted type or null if the specified ref was not valid + */ + public static String getTypeFromRef(String ref) { + Matcher matcher = match(ref); + return matcher != null ? matcher.group(1) : null; + } + + /** + * Get the ObjectID from the specified ref url + * + * @param ref the ref url to extract the ObjectID from + * + * @return the extracted ObjectID or null if the specified ref was not valid + */ + public static String getOidFromRef(String ref) { + Matcher matcher = match(ref); + return matcher != null ? matcher.group(2) : null; + } +} diff --git a/src/main/java/com/rallydev/rest/util/package-info.java b/src/main/java/com/rallydev/rest/util/package-info.java new file mode 100644 index 0000000..265c077 --- /dev/null +++ b/src/main/java/com/rallydev/rest/util/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides utilities for working with the Rest API. + */ +package com.rallydev.rest.util; \ No newline at end of file diff --git a/src/main/resources/doc/allclasses-frame.html b/src/main/resources/doc/allclasses-frame.html new file mode 100644 index 0000000..85b129b --- /dev/null +++ b/src/main/resources/doc/allclasses-frame.html @@ -0,0 +1,38 @@ + + + + + +All Classes (Rally Rest API for Java 2.2) + + + + +

All Classes

+ + + diff --git a/src/main/resources/doc/allclasses-noframe.html b/src/main/resources/doc/allclasses-noframe.html new file mode 100644 index 0000000..5797e15 --- /dev/null +++ b/src/main/resources/doc/allclasses-noframe.html @@ -0,0 +1,38 @@ + + + + + +All Classes (Rally Rest API for Java 2.2) + + + + +

All Classes

+ + + diff --git a/src/main/resources/doc/com/rallydev/rest/CollectionAddExample.html b/src/main/resources/doc/com/rallydev/rest/CollectionAddExample.html new file mode 100644 index 0000000..b2e95d8 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/CollectionAddExample.html @@ -0,0 +1,261 @@ + + + + + +CollectionAddExample (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class CollectionAddExample

+
+
+ +
+
    +
  • +
    +
    +
    public class CollectionAddExample
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/CollectionQueryExample.html b/src/main/resources/doc/com/rallydev/rest/CollectionQueryExample.html new file mode 100644 index 0000000..fb0971c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/CollectionQueryExample.html @@ -0,0 +1,261 @@ + + + + + +CollectionQueryExample (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class CollectionQueryExample

+
+
+ +
+
    +
  • +
    +
    +
    public class CollectionQueryExample
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/CollectionSummaryExample.html b/src/main/resources/doc/com/rallydev/rest/CollectionSummaryExample.html new file mode 100644 index 0000000..0edcc04 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/CollectionSummaryExample.html @@ -0,0 +1,261 @@ + + + + + +CollectionSummaryExample (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class CollectionSummaryExample

+
+
+ +
+
    +
  • +
    +
    +
    public class CollectionSummaryExample
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/CrudExample.html b/src/main/resources/doc/com/rallydev/rest/CrudExample.html new file mode 100644 index 0000000..94c9c7a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/CrudExample.html @@ -0,0 +1,261 @@ + + + + + +CrudExample (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class CrudExample

+
+
+ +
+
    +
  • +
    +
    +
    public class CrudExample
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/QueryExample.html b/src/main/resources/doc/com/rallydev/rest/QueryExample.html new file mode 100644 index 0000000..df7ba86 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/QueryExample.html @@ -0,0 +1,261 @@ + + + + + +QueryExample (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class QueryExample

+
+
+ +
+
    +
  • +
    +
    +
    public class QueryExample
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/RallyRestApi.html b/src/main/resources/doc/com/rallydev/rest/RallyRestApi.html new file mode 100644 index 0000000..3fe53db --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/RallyRestApi.html @@ -0,0 +1,578 @@ + + + + + +RallyRestApi (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class RallyRestApi

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Closeable, AutoCloseable
    +
    +
    +
    +
    public class RallyRestApi
    +extends Object
    +implements Closeable
    +

    The main interface to the Rest API.

    +

    Provides CRUD and query operations.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RallyRestApi

        +
        public RallyRestApi(URI server,
        +            String userName,
        +            String password)
        +
        Deprecated. Use the api key constructor instead.
        +
        Creates a new instance for the specified server using the specified credentials.
        +
        Parameters:
        server - The server to connect to, e.g. new URI("https://rally1.rallydev.com")
        userName - The username to be used for authentication.
        password - The password to be used for authentication.
        +
      • +
      + + + +
        +
      • +

        RallyRestApi

        +
        public RallyRestApi(URI server,
        +            String apiKey)
        +
        Creates a new instance for the specified server using the specified API Key.
        +
        Parameters:
        server - The server to connect to, e.g. new URI("https://rally1.rallydev.com")
        apiKey - The API Key to be used for authentication.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setProxy

        +
        public void setProxy(URI proxy)
        +
        Set the unauthenticated proxy server to use. By default no proxy is configured.
        +
        Parameters:
        proxy - The proxy server, e.g. new URI("http://my.proxy.com:8000")
        +
      • +
      + + + +
        +
      • +

        setProxy

        +
        public void setProxy(URI proxy,
        +            String userName,
        +            String password)
        +
        Set the authenticated proxy server to use. By default no proxy is configured.
        +
        Parameters:
        proxy - The proxy server, e.g. new URI("http://my.proxy.com:8000")
        userName - The username to be used for authentication.
        password - The password to be used for authentication.
        +
      • +
      + + + +
        +
      • +

        setApplicationVendor

        +
        public void setApplicationVendor(String value)
        +
        Set the value of the X-RallyIntegrationVendor header included on all requests. + This should be set to your company name.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        setApplicationVersion

        +
        public void setApplicationVersion(String value)
        +
        Set the value of the X-RallyIntegrationVersion header included on all requests. + This should be set to the version of your application.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        setApplicationName

        +
        public void setApplicationName(String value)
        +
        Set the value of the X-RallyIntegrationName header included on all requests. + This should be set to the name of your application.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        getWsapiVersion

        +
        public String getWsapiVersion()
        +
        Get the current version of the WSAPI being targeted. + Defaults to v2.0
        +
        Returns:
        the current WSAPI version.
        +
      • +
      + + + +
        +
      • +

        setWsapiVersion

        +
        public void setWsapiVersion(String wsapiVersion)
        +
        Set the current version of the WSAPI being targeted.
        +
        Parameters:
        wsapiVersion - the new version, e.g. "1.30"
        +
      • +
      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        query

        +
        public QueryResponse query(QueryRequest request)
        +                    throws IOException
        +
        Query for objects matching the specified request. + By default one page of data will be returned. + Paging will automatically be performed if a limit is set on the request.
        +
        Parameters:
        request - the QueryRequest specifying the object to be created.
        +
        Returns:
        the resulting QueryResponse
        +
        Throws:
        +
        IOException - if an error occurs during the query.
        +
      • +
      + + + + + + + +
        +
      • +

        close

        +
        public void close()
        +           throws IOException
        +
        Release all resources associated with this instance.
        +
        +
        Specified by:
        +
        close in interface Closeable
        +
        Specified by:
        +
        close in interface AutoCloseable
        +
        Throws:
        +
        IOException - if an error occurs releasing resources
        +
      • +
      + + + +
        +
      • +

        getClient

        +
        public HttpClient getClient()
        +
        Get the underlying http client implementation. + This is exposed with the intent of providing the ability to supply additional configuration to the client. + It should not be used to directly make i/o calls.
        +
        Returns:
        the raw http client
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/RallyRestApiTest.html b/src/main/resources/doc/com/rallydev/rest/RallyRestApiTest.html new file mode 100644 index 0000000..46f65b1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/RallyRestApiTest.html @@ -0,0 +1,567 @@ + + + + + +RallyRestApiTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class RallyRestApiTest

+
+
+ +
+
    +
  • +
    +
    +
    public class RallyRestApiTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RallyRestApiTest

        +
        public RallyRestApiTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldInitializeBasicAuthClient

        +
        public void shouldInitializeBasicAuthClient()
        +
      • +
      + + + +
        +
      • +

        shouldInitializeApiKeyClient

        +
        public void shouldInitializeApiKeyClient()
        +
      • +
      + + + +
        +
      • +

        shouldSetProxy

        +
        public void shouldSetProxy()
        +                    throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetProxyWithCredentials

        +
        public void shouldSetProxyWithCredentials()
        +                                   throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetVendor

        +
        public void shouldSetVendor()
        +                     throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetVersion

        +
        public void shouldSetVersion()
        +                      throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetName

        +
        public void shouldSetName()
        +                   throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldGetWsapiVersion

        +
        public void shouldGetWsapiVersion()
        +
      • +
      + + + +
        +
      • +

        shouldSetWsapiVersion

        +
        public void shouldSetWsapiVersion()
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        shouldUpdateCollection

        +
        public void shouldUpdateCollection()
        +                            throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        shouldQueryOnePage

        +
        public void shouldQueryOnePage()
        +                        throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldQueryAllPages

        +
        public void shouldQueryAllPages()
        +                         throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldQuerySomePages

        +
        public void shouldQuerySomePages()
        +                          throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldQueryNoPages

        +
        public void shouldQueryNoPages()
        +                        throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldQuerySomePagesWithNonStandardStart

        +
        public void shouldQuerySomePagesWithNonStandardStart()
        +                                              throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldQueryAllPagesWithNonStandardStart

        +
        public void shouldQueryAllPagesWithNonStandardStart()
        +                                             throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/RestApiFactory.html b/src/main/resources/doc/com/rallydev/rest/RestApiFactory.html new file mode 100644 index 0000000..f181a80 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/RestApiFactory.html @@ -0,0 +1,259 @@ + + + + + +RestApiFactory (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest
+

Class RestApiFactory

+
+
+ +
+
    +
  • +
    +
    +
    public class RestApiFactory
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/CollectionAddExample.html b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionAddExample.html new file mode 100644 index 0000000..5651ee3 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionAddExample.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.CollectionAddExample (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.CollectionAddExample

+
+
No usage of com.rallydev.rest.CollectionAddExample
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/CollectionQueryExample.html b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionQueryExample.html new file mode 100644 index 0000000..b8b2403 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionQueryExample.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.CollectionQueryExample (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.CollectionQueryExample

+
+
No usage of com.rallydev.rest.CollectionQueryExample
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/CollectionSummaryExample.html b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionSummaryExample.html new file mode 100644 index 0000000..c7bf7fb --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/CollectionSummaryExample.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.CollectionSummaryExample (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.CollectionSummaryExample

+
+
No usage of com.rallydev.rest.CollectionSummaryExample
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/CrudExample.html b/src/main/resources/doc/com/rallydev/rest/class-use/CrudExample.html new file mode 100644 index 0000000..d803248 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/CrudExample.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.CrudExample (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.CrudExample

+
+
No usage of com.rallydev.rest.CrudExample
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/QueryExample.html b/src/main/resources/doc/com/rallydev/rest/class-use/QueryExample.html new file mode 100644 index 0000000..1e4de46 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/QueryExample.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.QueryExample (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.QueryExample

+
+
No usage of com.rallydev.rest.QueryExample
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApi.html b/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApi.html new file mode 100644 index 0000000..d2d25e6 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApi.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.RallyRestApi (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.RallyRestApi

+
+
No usage of com.rallydev.rest.RallyRestApi
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApiTest.html b/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApiTest.html new file mode 100644 index 0000000..a1044f6 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/RallyRestApiTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.RallyRestApiTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.RallyRestApiTest

+
+
No usage of com.rallydev.rest.RallyRestApiTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/class-use/RestApiFactory.html b/src/main/resources/doc/com/rallydev/rest/class-use/RestApiFactory.html new file mode 100644 index 0000000..bfece53 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/class-use/RestApiFactory.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.RestApiFactory (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.RestApiFactory

+
+
No usage of com.rallydev.rest.RestApiFactory
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClient.html b/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClient.html new file mode 100644 index 0000000..2579642 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClient.html @@ -0,0 +1,275 @@ + + + + + +ApiKeyClient (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class ApiKeyClient

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ApiKeyClient

        +
        public ApiKeyClient(URI server,
        +            String apiKey)
        +
        Construct a new client.
        +
        Parameters:
        server - the server to connect to
        apiKey - the key to be used for authentication
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClientTest.html new file mode 100644 index 0000000..5063ad9 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/ApiKeyClientTest.html @@ -0,0 +1,288 @@ + + + + + +ApiKeyClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class ApiKeyClientTest

+
+
+ +
+
    +
  • +
    +
    +
    public class ApiKeyClientTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ApiKeyClientTest

        +
        public ApiKeyClientTest()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClient.html b/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClient.html new file mode 100644 index 0000000..0c0a069 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClient.html @@ -0,0 +1,277 @@ + + + + + +BasicAuthClient (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class BasicAuthClient

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Closeable, AutoCloseable, HttpClient
    +
    +
    +
    +
    public class BasicAuthClient
    +extends HttpClient
    +
    A HttpClient which authenticates using basic authentication (username/password).
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BasicAuthClient

        +
        public BasicAuthClient(URI server,
        +               String userName,
        +               String password)
        +
        Construct a new client.
        +
        Parameters:
        server - the server to connect to
        userName - the username to be used for authentication
        password - the password to be used for authentication
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClientTest.html new file mode 100644 index 0000000..0195145 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/BasicAuthClientTest.html @@ -0,0 +1,368 @@ + + + + + +BasicAuthClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class BasicAuthClientTest

+
+
+ +
+
    +
  • +
    +
    +
    public class BasicAuthClientTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BasicAuthClientTest

        +
        public BasicAuthClientTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        shouldIntialize

        +
        public void shouldIntialize()
        +
      • +
      + + + +
        +
      • +

        shouldNotIncludeCSRFTokenOnGet

        +
        public void shouldNotIncludeCSRFTokenOnGet()
        +                                    throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldNotIncludeCSRFTokenOnWsapiv1

        +
        public void shouldNotIncludeCSRFTokenOnWsapiv1()
        +                                        throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldRequestCSRFToken

        +
        public void shouldRequestCSRFToken()
        +                            throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldIncludeCSRFTokenOnPost

        +
        public void shouldIncludeCSRFTokenOnPost()
        +                                  throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldIncludeCSRFTokenOnPut

        +
        public void shouldIncludeCSRFTokenOnPut()
        +                                 throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldIncludeCSRFTokenOnDelete

        +
        public void shouldIncludeCSRFTokenOnDelete()
        +                                    throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/HttpClient.html b/src/main/resources/doc/com/rallydev/rest/client/HttpClient.html new file mode 100644 index 0000000..be69a93 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/HttpClient.html @@ -0,0 +1,520 @@ + + + + + +HttpClient (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class HttpClient

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setProxy

        +
        public void setProxy(URI proxy)
        +
        Set the unauthenticated proxy server to use. By default no proxy is configured.
        +
        Parameters:
        proxy - The proxy server, e.g. new URI("http://my.proxy.com:8000")
        +
      • +
      + + + +
        +
      • +

        setProxy

        +
        public void setProxy(URI proxy,
        +            String userName,
        +            String password)
        +
        Set the authenticated proxy server to use. By default no proxy is configured.
        +
        Parameters:
        proxy - The proxy server, e.g. new URI("http://my.proxy.com:8000")
        userName - The username to be used for authentication.
        password - The password to be used for authentication.
        +
      • +
      + + + +
        +
      • +

        setApplicationVendor

        +
        public void setApplicationVendor(String value)
        +
        Set the value of the X-RallyIntegrationVendor header included on all requests. + This should be set to your company name.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        setApplicationVersion

        +
        public void setApplicationVersion(String value)
        +
        Set the value of the X-RallyIntegrationVersion header included on all requests. + This should be set to the version of your application.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        setApplicationName

        +
        public void setApplicationName(String value)
        +
        Set the value of the X-RallyIntegrationName header included on all requests. + This should be set to the name of your application.
        +
        Parameters:
        value - The vendor header to be included on all requests.
        +
      • +
      + + + +
        +
      • +

        getServer

        +
        public String getServer()
        +
        Get the current server being targeted.
        +
        Returns:
        the current server.
        +
      • +
      + + + +
        +
      • +

        getWsapiVersion

        +
        public String getWsapiVersion()
        +
        Get the current version of the WSAPI being targeted.
        +
        Returns:
        the current WSAPI version.
        +
      • +
      + + + +
        +
      • +

        setWsapiVersion

        +
        public void setWsapiVersion(String wsapiVersion)
        +
        Set the current version of the WSAPI being targeted.
        +
        Parameters:
        wsapiVersion - the new version, e.g. "1.30"
        +
      • +
      + + + +
        +
      • +

        doPost

        +
        public String doPost(String url,
        +            String body)
        +              throws IOException
        +
        Perform a post against the WSAPI
        +
        Parameters:
        url - the request url
        body - the body of the post
        +
        Returns:
        the JSON encoded string response
        +
        Throws:
        +
        IOException - if a non-200 response code is returned or if some other + problem occurs while executing the request
        +
      • +
      + + + +
        +
      • +

        doPut

        +
        public String doPut(String url,
        +           String body)
        +             throws IOException
        +
        Perform a put against the WSAPI
        +
        Parameters:
        url - the request url
        body - the body of the put
        +
        Returns:
        the JSON encoded string response
        +
        Throws:
        +
        IOException - if a non-200 response code is returned or if some other + problem occurs while executing the request
        +
      • +
      + + + +
        +
      • +

        doDelete

        +
        public String doDelete(String url)
        +                throws IOException
        +
        Perform a delete against the WSAPI
        +
        Parameters:
        url - the request url
        +
        Returns:
        the JSON encoded string response
        +
        Throws:
        +
        IOException - if a non-200 response code is returned or if some other + problem occurs while executing the request
        +
      • +
      + + + +
        +
      • +

        doGet

        +
        public String doGet(String url)
        +             throws IOException
        +
        Perform a get against the WSAPI
        +
        Parameters:
        url - the request url
        +
        Returns:
        the JSON encoded string response
        +
        Throws:
        +
        IOException - if a non-200 response code is returned or if some other + problem occurs while executing the request
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +           throws IOException
        +
        Release all resources associated with this instance.
        +
        +
        Specified by:
        +
        close in interface Closeable
        +
        Specified by:
        +
        close in interface AutoCloseable
        +
        Throws:
        +
        IOException - if an error occurs releasing resources
        +
      • +
      + + + +
        +
      • +

        getWsapiUrl

        +
        public String getWsapiUrl()
        +
        Get the WSAPI base url based on the current server and WSAPI version
        +
        Returns:
        the fully qualified WSAPI base url, e.g. https://rally1.rallydev.com/slm/webservice/1.33
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/HttpClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/HttpClientTest.html new file mode 100644 index 0000000..a5b7d0b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/HttpClientTest.html @@ -0,0 +1,490 @@ + + + + + +HttpClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.client
+

Class HttpClientTest

+
+
+ +
+
    +
  • +
    +
    +
    public class HttpClientTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HttpClientTest

        +
        public HttpClientTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        shouldIntialize

        +
        public void shouldIntialize()
        +
      • +
      + + + +
        +
      • +

        shouldSetProxy

        +
        public void shouldSetProxy()
        +                    throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetProxyWithCredentials

        +
        public void shouldSetProxyWithCredentials()
        +                                   throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetApplicationVendor

        +
        public void shouldSetApplicationVendor()
        +                                throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetApplicationName

        +
        public void shouldSetApplicationName()
        +                              throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldSetApplicationVersion

        +
        public void shouldSetApplicationVersion()
        +                                 throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldUseDefaultWsapiVersion

        +
        public void shouldUseDefaultWsapiVersion()
        +
      • +
      + + + +
        +
      • +

        shouldSetWsapiVersion

        +
        public void shouldSetWsapiVersion()
        +
      • +
      + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        shouldReturnValidResponse

        +
        public void shouldReturnValidResponse()
        +                               throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      + + + +
        +
      • +

        shouldExplodeWithInvalidResponse

        +
        public void shouldExplodeWithInvalidResponse()
        +                                      throws Exception
        +
        Throws:
        +
        Exception
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClient.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClient.html new file mode 100644 index 0000000..0192075 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClient.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.client.ApiKeyClient (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.ApiKeyClient

+
+
No usage of com.rallydev.rest.client.ApiKeyClient
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClientTest.html new file mode 100644 index 0000000..ebb0f60 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/ApiKeyClientTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.client.ApiKeyClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.ApiKeyClientTest

+
+
No usage of com.rallydev.rest.client.ApiKeyClientTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClient.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClient.html new file mode 100644 index 0000000..02b4cf1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClient.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.client.BasicAuthClient (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.BasicAuthClient

+
+
No usage of com.rallydev.rest.client.BasicAuthClient
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClientTest.html new file mode 100644 index 0000000..2321610 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/BasicAuthClientTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.client.BasicAuthClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.BasicAuthClientTest

+
+
No usage of com.rallydev.rest.client.BasicAuthClientTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClient.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClient.html new file mode 100644 index 0000000..0601e0e --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClient.html @@ -0,0 +1,191 @@ + + + + + +Uses of Class com.rallydev.rest.client.HttpClient (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.HttpClient

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClientTest.html b/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClientTest.html new file mode 100644 index 0000000..333d33c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/class-use/HttpClientTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.client.HttpClientTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.client.HttpClientTest

+
+
No usage of com.rallydev.rest.client.HttpClientTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/package-frame.html b/src/main/resources/doc/com/rallydev/rest/client/package-frame.html new file mode 100644 index 0000000..b93778d --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/package-frame.html @@ -0,0 +1,21 @@ + + + + + +com.rallydev.rest.client (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest.client

+ + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/package-summary.html b/src/main/resources/doc/com/rallydev/rest/client/package-summary.html new file mode 100644 index 0000000..07186d1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/package-summary.html @@ -0,0 +1,156 @@ + + + + + +com.rallydev.rest.client (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest.client

+
+
Provides the underlying http client implementations.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ApiKeyClient +
    A HttpClient which authenticates using an API Key.
    +
    BasicAuthClient +
    A HttpClient which authenticates using basic authentication (username/password).
    +
    HttpClient +
    A HttpClient implementation providing connectivity to Rally.
    +
    +
  • +
+ + + +

Package com.rallydev.rest.client Description

+
Provides the underlying http client implementations.
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/package-tree.html b/src/main/resources/doc/com/rallydev/rest/client/package-tree.html new file mode 100644 index 0000000..79b7cb7 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/package-tree.html @@ -0,0 +1,141 @@ + + + + + +com.rallydev.rest.client Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest.client

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/client/package-use.html b/src/main/resources/doc/com/rallydev/rest/client/package-use.html new file mode 100644 index 0000000..a7acda1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/client/package-use.html @@ -0,0 +1,175 @@ + + + + + +Uses of Package com.rallydev.rest.client (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest.client

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestBodyMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestBodyMatcher.html new file mode 100644 index 0000000..0b9e6f7 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestBodyMatcher.html @@ -0,0 +1,292 @@ + + + + + +HttpRequestBodyMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.matchers
+

Class HttpRequestBodyMatcher

+
+
+ +
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      booleanmatches(Object o) 
      +
        +
      • + + +

        Methods inherited from class org.mockito.ArgumentMatcher

        +describeTo
      • +
      +
        +
      • + + +

        Methods inherited from class org.hamcrest.BaseMatcher

        +_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
      • +
      + +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.html new file mode 100644 index 0000000..6aa62c7 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.html @@ -0,0 +1,292 @@ + + + + + +HttpRequestHeaderMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.matchers
+

Class HttpRequestHeaderMatcher

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.hamcrest.BaseMatcher<T>
    • +
    • +
        +
      • org.mockito.ArgumentMatcher<HttpRequestBase>
      • +
      • +
          +
        • com.rallydev.rest.matchers.HttpRequestHeaderMatcher
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.hamcrest.Matcher<HttpRequestBase>, org.hamcrest.SelfDescribing
    +
    +
    +
    +
    public class HttpRequestHeaderMatcher
    +extends org.mockito.ArgumentMatcher<HttpRequestBase>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HttpRequestHeaderMatcher

        +
        public HttpRequestHeaderMatcher(String name,
        +                        String value)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        matches

        +
        public boolean matches(Object o)
        +
        +
        Specified by:
        +
        matches in interface org.hamcrest.Matcher<HttpRequestBase>
        +
        Specified by:
        +
        matches in class org.mockito.ArgumentMatcher<HttpRequestBase>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestUrlMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestUrlMatcher.html new file mode 100644 index 0000000..f487b9b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/HttpRequestUrlMatcher.html @@ -0,0 +1,290 @@ + + + + + +HttpRequestUrlMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.matchers
+

Class HttpRequestUrlMatcher

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.hamcrest.BaseMatcher<T>
    • +
    • +
        +
      • org.mockito.ArgumentMatcher<HttpRequestBase>
      • +
      • +
          +
        • com.rallydev.rest.matchers.HttpRequestUrlMatcher
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.hamcrest.Matcher<HttpRequestBase>, org.hamcrest.SelfDescribing
    +
    +
    +
    +
    public class HttpRequestUrlMatcher
    +extends org.mockito.ArgumentMatcher<HttpRequestBase>
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      booleanmatches(Object o) 
      +
        +
      • + + +

        Methods inherited from class org.mockito.ArgumentMatcher

        +describeTo
      • +
      +
        +
      • + + +

        Methods inherited from class org.hamcrest.BaseMatcher

        +_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HttpRequestUrlMatcher

        +
        public HttpRequestUrlMatcher(String url)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        matches

        +
        public boolean matches(Object o)
        +
        +
        Specified by:
        +
        matches in interface org.hamcrest.Matcher<HttpRequestBase>
        +
        Specified by:
        +
        matches in class org.mockito.ArgumentMatcher<HttpRequestBase>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestBodyMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestBodyMatcher.html new file mode 100644 index 0000000..ea1d659 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestBodyMatcher.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.matchers.HttpRequestBodyMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.matchers.HttpRequestBodyMatcher

+
+
No usage of com.rallydev.rest.matchers.HttpRequestBodyMatcher
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestHeaderMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestHeaderMatcher.html new file mode 100644 index 0000000..2d0bb15 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestHeaderMatcher.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.matchers.HttpRequestHeaderMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.matchers.HttpRequestHeaderMatcher

+
+
No usage of com.rallydev.rest.matchers.HttpRequestHeaderMatcher
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestUrlMatcher.html b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestUrlMatcher.html new file mode 100644 index 0000000..ae5f943 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/class-use/HttpRequestUrlMatcher.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.matchers.HttpRequestUrlMatcher (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.matchers.HttpRequestUrlMatcher

+
+
No usage of com.rallydev.rest.matchers.HttpRequestUrlMatcher
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/package-frame.html b/src/main/resources/doc/com/rallydev/rest/matchers/package-frame.html new file mode 100644 index 0000000..6b1481a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/package-frame.html @@ -0,0 +1,21 @@ + + + + + +com.rallydev.rest.matchers (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest.matchers

+ + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/package-summary.html b/src/main/resources/doc/com/rallydev/rest/matchers/package-summary.html new file mode 100644 index 0000000..4ac1875 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/package-summary.html @@ -0,0 +1,141 @@ + + + + + +com.rallydev.rest.matchers (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest.matchers

+
+
+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/package-tree.html b/src/main/resources/doc/com/rallydev/rest/matchers/package-tree.html new file mode 100644 index 0000000..644229c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/package-tree.html @@ -0,0 +1,138 @@ + + + + + +com.rallydev.rest.matchers Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest.matchers

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/matchers/package-use.html b/src/main/resources/doc/com/rallydev/rest/matchers/package-use.html new file mode 100644 index 0000000..e2746d6 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/matchers/package-use.html @@ -0,0 +1,115 @@ + + + + + +Uses of Package com.rallydev.rest.matchers (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest.matchers

+
+
No usage of com.rallydev.rest.matchers
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/package-frame.html b/src/main/resources/doc/com/rallydev/rest/package-frame.html new file mode 100644 index 0000000..f5d6a58 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/package-frame.html @@ -0,0 +1,19 @@ + + + + + +com.rallydev.rest (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest

+
+

Classes

+ +
+ + diff --git a/src/main/resources/doc/com/rallydev/rest/package-summary.html b/src/main/resources/doc/com/rallydev/rest/package-summary.html new file mode 100644 index 0000000..541afa1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/package-summary.html @@ -0,0 +1,144 @@ + + + + + +com.rallydev.rest (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest

+
+
Provides the main interface to the Rest API.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    RallyRestApi +
    The main interface to the Rest API.
    +
    +
  • +
+ + + +

Package com.rallydev.rest Description

+
Provides the main interface to the Rest API.
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/package-tree.html b/src/main/resources/doc/com/rallydev/rest/package-tree.html new file mode 100644 index 0000000..e76a490 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/package-tree.html @@ -0,0 +1,128 @@ + + + + + +com.rallydev.rest Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/package-use.html b/src/main/resources/doc/com/rallydev/rest/package-use.html new file mode 100644 index 0000000..c65165a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/package-use.html @@ -0,0 +1,115 @@ + + + + + +Uses of Package com.rallydev.rest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest

+
+
No usage of com.rallydev.rest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequest.html new file mode 100644 index 0000000..2de673f --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequest.html @@ -0,0 +1,358 @@ + + + + + +CollectionUpdateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class CollectionUpdateRequest

+
+
+ +
+
    +
  • +
    +
    +
    public class CollectionUpdateRequest
    +extends Request
    +
    Represents a WSAPI request to update a collection.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CollectionUpdateRequest

        +
        public CollectionUpdateRequest(JsonObject collection,
        +                       JsonArray items,
        +                       boolean add)
        +
        Create a new update request for the specified collection and values. + Note that this class is only usable with WSAPI versions 2.0 and above.
        +
        Parameters:
        collection - the collection to be updated
        items - the items to be added or removed
        add - true if adding, false if removing
        +
      • +
      + + + +
        +
      • +

        CollectionUpdateRequest

        +
        public CollectionUpdateRequest(String collectionRef,
        +                       JsonArray items,
        +                       boolean adding)
        +
        Create a new update request for the specified collection and values.
        +
        Parameters:
        collectionRef - the ref of the collection to be updated. May be absolute or relative, e.g. "/defect/12345/tags"
        items - the items to be added or removed
        adding - true if adding, false if removing
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBody

        +
        public String getBody()
        +
        Get the JSON encoded string representation of the object to be updated.
        +
        Returns:
        the JSON encoded object
        +
      • +
      + + + +
        +
      • +

        getFetch

        +
        public Fetch getFetch()
        +

        Get the current list of fields to be returned on the updated object.

        + By default all fields will be returned in the response (fetch=true).
        +
        Returns:
        the current list of fields.
        +
      • +
      + + + +
        +
      • +

        setFetch

        +
        public void setFetch(Fetch fetch)
        +
        Set the current list of fields to be returned on the updated object.
        +
        Parameters:
        fetch - the list of fields to be returned.
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + The current fetch and any other parameters will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequestTest.html new file mode 100644 index 0000000..8fb683a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/CollectionUpdateRequestTest.html @@ -0,0 +1,295 @@ + + + + + +CollectionUpdateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class CollectionUpdateRequestTest

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.rallydev.rest.request.CollectionUpdateRequestTest
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class CollectionUpdateRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CollectionUpdateRequestTest

        +
        public CollectionUpdateRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldCreateACorrectBody

        +
        public void shouldCreateACorrectBody()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrlForAdds

        +
        public void shouldConstructTheCorrectUrlForAdds()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrlForRemoves

        +
        public void shouldConstructTheCorrectUrlForRemoves()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrlWithExtraParam

        +
        public void shouldConstructTheCorrectUrlWithExtraParam()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/CreateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/CreateRequest.html new file mode 100644 index 0000000..20067c9 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/CreateRequest.html @@ -0,0 +1,335 @@ + + + + + +CreateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class CreateRequest

+
+
+ +
+
    +
  • +
    +
    +
    public class CreateRequest
    +extends Request
    +
    Represents a WSAPI request to create an object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CreateRequest

        +
        public CreateRequest(String type,
        +             JsonObject obj)
        +
        Create a new create request with the specified type and values.
        +
        Parameters:
        type - the WSAPI object type to be created, e.g. Defect
        obj - the JSON representation of the values of the object
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBody

        +
        public String getBody()
        +
        Get the JSON encoded string representation of the object to be created.
        +
        Returns:
        the JSON encoded object
        +
      • +
      + + + +
        +
      • +

        getFetch

        +
        public Fetch getFetch()
        +

        Get the current list of fields to be returned on the created object.

        + By default only the underscore fields such as _ref will be returned in the response.
        +
        Returns:
        the current list of fields.
        +
      • +
      + + + +
        +
      • +

        setFetch

        +
        public void setFetch(Fetch fetch)
        +
        Set the current list of fields to be returned on the created object.
        +
        Parameters:
        fetch - the list of fields to be returned.
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + The current fetch and any other parameters will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/CreateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/CreateRequestTest.html new file mode 100644 index 0000000..687b063 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/CreateRequestTest.html @@ -0,0 +1,321 @@ + + + + + +CreateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class CreateRequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class CreateRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CreateRequestTest

        +
        public CreateRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldCreateACorrectBody

        +
        public void shouldCreateACorrectBody()
        +
      • +
      + + + +
        +
      • +

        shouldCreateACorrectBodyWithNullFields

        +
        public void shouldCreateACorrectBodyWithNullFields()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrl

        +
        public void shouldConstructTheCorrectUrl()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectDefaultFetchUrl

        +
        public void shouldConstructTheCorrectDefaultFetchUrl()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrlWithExtraParam

        +
        public void shouldConstructTheCorrectUrlWithExtraParam()
        +
      • +
      + + + +
        +
      • +

        shouldEncodeParamsUsingUtf8

        +
        public void shouldEncodeParamsUsingUtf8()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/DeleteRequest.html b/src/main/resources/doc/com/rallydev/rest/request/DeleteRequest.html new file mode 100644 index 0000000..639dafb --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/DeleteRequest.html @@ -0,0 +1,281 @@ + + + + + +DeleteRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class DeleteRequest

+
+
+ +
+
    +
  • +
    +
    +
    public class DeleteRequest
    +extends Request
    +
    Represents a WSAPI request to delete an object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DeleteRequest

        +
        public DeleteRequest(String ref)
        +
        Createa new delete request for the specified object.
        +
        Parameters:
        ref - the ref of the WSAPI object to be created. May be absolute or relative, e.g. "/defect/12345"
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + Any parameters set will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/DeleteRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/DeleteRequestTest.html new file mode 100644 index 0000000..8957e89 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/DeleteRequestTest.html @@ -0,0 +1,282 @@ + + + + + +DeleteRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class DeleteRequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class DeleteRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DeleteRequestTest

        +
        public DeleteRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldConstructCorrectUrlWithAbsoluteRef

        +
        public void shouldConstructCorrectUrlWithAbsoluteRef()
        +
      • +
      + + + +
        +
      • +

        shouldConstructCorrectUrlWithRelativeRef

        +
        public void shouldConstructCorrectUrlWithRelativeRef()
        +
      • +
      + + + +
        +
      • +

        shouldConstructCorrectUrlWithExtraParam

        +
        public void shouldConstructCorrectUrlWithExtraParam()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/GetRequest.html b/src/main/resources/doc/com/rallydev/rest/request/GetRequest.html new file mode 100644 index 0000000..84c4814 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/GetRequest.html @@ -0,0 +1,317 @@ + + + + + +GetRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class GetRequest

+
+
+ +
+
    +
  • +
    +
    +
    public class GetRequest
    +extends Request
    +
    Represents a WSAPI request to retrieve a specific object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GetRequest

        +
        public GetRequest(String ref)
        +
        Create a new get request for the specified object.
        +
        Parameters:
        ref - the ref of the WSAPI object to be retrieved. May be absolute or relative, e.g. "/defect/12345" + May also be "/user" or "/subscription" to get the current instances
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getFetch

        +
        public Fetch getFetch()
        +

        Get the current list of fields to be returned on the retrieved object.

        + By default all fields will be returned in the response (fetch=true).
        +
        Returns:
        the current list of fields.
        +
      • +
      + + + +
        +
      • +

        setFetch

        +
        public void setFetch(Fetch fetch)
        +
        Set the current list of fields to be returned on the retrieved object.
        +
        Parameters:
        fetch - the list of fields to be returned.
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + The current fetch and any other parameters will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/GetRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/GetRequestTest.html new file mode 100644 index 0000000..7dea863 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/GetRequestTest.html @@ -0,0 +1,308 @@ + + + + + +GetRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class GetRequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class GetRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GetRequestTest

        +
        public GetRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnCorrectUrlWithAbsoluteRef

        +
        public void shouldReturnCorrectUrlWithAbsoluteRef()
        +
      • +
      + + + +
        +
      • +

        shouldReturnCorrectUrlWithRelativeRef

        +
        public void shouldReturnCorrectUrlWithRelativeRef()
        +
      • +
      + + + +
        +
      • +

        shouldReturnCorrectUrlWithFetchParams

        +
        public void shouldReturnCorrectUrlWithFetchParams()
        +
      • +
      + + + +
        +
      • +

        shouldReturnCorrectUrlForUser

        +
        public void shouldReturnCorrectUrlForUser()
        +
      • +
      + + + +
        +
      • +

        shouldReturnCorrectUrlForSubscription

        +
        public void shouldReturnCorrectUrlForSubscription()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/QueryRequest.html b/src/main/resources/doc/com/rallydev/rest/request/QueryRequest.html new file mode 100644 index 0000000..9c1a0d4 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/QueryRequest.html @@ -0,0 +1,673 @@ + + + + + +QueryRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class QueryRequest

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class QueryRequest
    +extends Request
    +implements Cloneable
    +
    Represents a WSAPI request to retrieve all objects matching specified criteria.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      QueryRequest(JsonObject collection) +
      Create a new query request for the specified collection.
      +
      QueryRequest(String type) +
      Create a new query request for the specified type.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      QueryRequestclone() +
      Clone this request.
      +
      FetchgetFetch() +
      Get the current list of fields to be returned on the matching objects.
      +
      intgetLimit() +
      Get the maximum number of records to be returned from the query.
      +
      StringgetOrder() +
      Set the order by which the result set will be sorted.
      +
      intgetPageSize() +
      Get the page size of the result set.
      +
      StringgetProject() +
      Get the project which the result set should be scoped to.
      +
      QueryFiltergetQueryFilter() +
      Get the filter by which the result set will be narrowed down.
      +
      intgetStart() +
      Get the start index of the result set.
      +
      StringgetWorkspace() +
      Get the workspace which the result set should be scoped to.
      +
      booleanisScopedDown() +
      If a project has been specified, get whether to include matching objects in child projects in the result set.
      +
      booleanisScopedUp() +
      If a project has been specified, get whether to include matching objects in parent projects in the result set.
      +
      voidsetFetch(Fetch fetch) +
      Set the current list of fields to be returned on the matching objects.
      +
      voidsetLimit(int limit) +
      Set the maximum number of records to be returned from the query.
      +
      voidsetOrder(String order) +
      Get the order by which the result set will be sorted.
      +
      voidsetPageSize(int pageSize) +
      Set the page size of the result set.
      +
      voidsetProject(String projectRef) +
      Specify the project which the result set should be scoped to.
      +
      voidsetQueryFilter(QueryFilter queryFilter) +
      Set a filter by which the result set will be narrowed down.
      +
      voidsetScopedDown(boolean scopeDown) +
      If a project has been specified, set whether to include matching objects in child projects in the result set.
      +
      voidsetScopedUp(boolean scopeUp) +
      If a project has been specified, set whether to include matching objects in parent projects in the result set.
      +
      voidsetStart(int start) +
      Set the 1-based start index of the result set.
      +
      voidsetWorkspace(String workspaceRef) +
      Specify the workspace which the result set should be scoped to.
      +
      StringtoUrl() +
      Convert this request into a url compatible with the WSAPI.
      +
      + + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryRequest

        +
        public QueryRequest(String type)
        +
        Create a new query request for the specified type.
        +
        Parameters:
        type - The WSAPI type to be queried, e.g. Defect
        +
      • +
      + + + +
        +
      • +

        QueryRequest

        +
        public QueryRequest(JsonObject collection)
        +
        Create a new query request for the specified collection. + Only supported in WSAPI v2.0 and above.
        +
        Parameters:
        collection - The collection to query. Should have a _ref property.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQueryFilter

        +
        public QueryFilter getQueryFilter()
        +
        Get the filter by which the result set will be narrowed down.
        +
        Returns:
        the filter
        +
      • +
      + + + +
        +
      • +

        setQueryFilter

        +
        public void setQueryFilter(QueryFilter queryFilter)
        +
        Set a filter by which the result set will be narrowed down.
        +
        Parameters:
        queryFilter - the filter
        +
      • +
      + + + +
        +
      • +

        getOrder

        +
        public String getOrder()
        +
        Set the order by which the result set will be sorted. +

        The default is ObjectID ASC.

        +
        Returns:
        the order
        +
      • +
      + + + +
        +
      • +

        setOrder

        +
        public void setOrder(String order)
        +
        Get the order by which the result set will be sorted.
        +
        Parameters:
        order - the order
        +
      • +
      + + + +
        +
      • +

        getWorkspace

        +
        public String getWorkspace()
        +
        Get the workspace which the result set should be scoped to.
        +
        Returns:
        the project
        +
      • +
      + + + +
        +
      • +

        setWorkspace

        +
        public void setWorkspace(String workspaceRef)
        +

        Specify the workspace which the result set should be scoped to.

        + The default is the user's default workspace.
        +
        Parameters:
        workspaceRef - the ref of the workspace to scope to. May be an absolute or relative ref, e.g. /workspace/1234
        +
      • +
      + + + +
        +
      • +

        getProject

        +
        public String getProject()
        +
        Get the project which the result set should be scoped to.
        +
        Returns:
        the project
        +
      • +
      + + + +
        +
      • +

        setProject

        +
        public void setProject(String projectRef)
        +

        Specify the project which the result set should be scoped to.

        + The default is the user's default project. + Specifying null will cause the result to be scoped to the entire specified workspace.
        +
        Parameters:
        projectRef - the ref of the project to scope to. May be null or an absolute or relative ref, e.g. /project/1234
        +
      • +
      + + + +
        +
      • +

        isScopedUp

        +
        public boolean isScopedUp()
        +
        If a project has been specified, get whether to include matching objects in parent projects in the result set.
        +
        Returns:
        whether to include matching objects in parent projects.
        +
      • +
      + + + +
        +
      • +

        setScopedUp

        +
        public void setScopedUp(boolean scopeUp)
        +

        If a project has been specified, set whether to include matching objects in parent projects in the result set.

        + Defaults to false.
        +
        Parameters:
        scopeUp - whether to include matching objects in parent projects
        +
      • +
      + + + +
        +
      • +

        isScopedDown

        +
        public boolean isScopedDown()
        +
        If a project has been specified, get whether to include matching objects in child projects in the result set.
        +
        Returns:
        whether to include matching objects in child projects.
        +
      • +
      + + + +
        +
      • +

        setScopedDown

        +
        public void setScopedDown(boolean scopeDown)
        +

        If a project has been specified, set whether to include matching objects in child projects in the result set.

        + Defaults to true.
        +
        Parameters:
        scopeDown - whether to include matching objects in child projects
        +
      • +
      + + + +
        +
      • +

        getStart

        +
        public int getStart()
        +
        Get the start index of the result set.
        +
        Returns:
        the start index
        +
      • +
      + + + +
        +
      • +

        setStart

        +
        public void setStart(int start)
        +
        Set the 1-based start index of the result set. + The default is 1.
        +
        Parameters:
        start - the start index
        +
      • +
      + + + +
        +
      • +

        getFetch

        +
        public Fetch getFetch()
        +

        Get the current list of fields to be returned on the matching objects.

        + By default all fields will be returned in the response (fetch=true).
        +
        Returns:
        the current list of fields.
        +
      • +
      + + + +
        +
      • +

        setFetch

        +
        public void setFetch(Fetch fetch)
        +
        Set the current list of fields to be returned on the matching objects.
        +
        Parameters:
        fetch - the list of fields to be returned.
        +
      • +
      + + + +
        +
      • +

        getPageSize

        +
        public int getPageSize()
        +
        Get the page size of the result set.
        +
        Returns:
        the page size
        +
      • +
      + + + +
        +
      • +

        setPageSize

        +
        public void setPageSize(int pageSize)
        +

        Set the page size of the result set.

        + The default is 200.
        +
        Parameters:
        pageSize - the new page size. Must be between 1 and 200 inclusive.
        +
      • +
      + + + +
        +
      • +

        getLimit

        +
        public int getLimit()
        +
        Get the maximum number of records to be returned from the query.
        +
        Returns:
        the maximum number of records
        +
      • +
      + + + +
        +
      • +

        setLimit

        +
        public void setLimit(int limit)
        +

        Set the maximum number of records to be returned from the query.

        + If not set only one page of data will be returned by RallyRestApi.query(com.rallydev.rest.request.QueryRequest)
        +
        Parameters:
        limit - the maximum number of records to be returned
        +
      • +
      + + + +
        +
      • +

        clone

        +
        public QueryRequest clone()
        +
        Clone this request.
        +
        +
        Overrides:
        +
        clone in class Object
        +
        Returns:
        the cloned instance of this request.
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + The current criteria set on this request and any other parameters will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/QueryRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/QueryRequestTest.html new file mode 100644 index 0000000..a04fc4a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/QueryRequestTest.html @@ -0,0 +1,451 @@ + + + + + +QueryRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class QueryRequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class QueryRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryRequestTest

        +
        public QueryRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldCreateCorrectDefaultQuery

        +
        public void shouldCreateCorrectDefaultQuery()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectDefaultQueryWithExtraParam

        +
        public void shouldCreateCorrectDefaultQueryWithExtraParam()
        +
      • +
      + + + +
        +
      • +

        shouldEncodeParamsUsingUtf8

        +
        public void shouldEncodeParamsUsingUtf8()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithFetch

        +
        public void shouldCreateCorrectQueryWithFetch()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithDefaultOrder

        +
        public void shouldCreateCorrectQueryWithDefaultOrder()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithSpecifiedOrder

        +
        public void shouldCreateCorrectQueryWithSpecifiedOrder()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithPageSize

        +
        public void shouldCreateCorrectQueryWithPageSize()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithStart

        +
        public void shouldCreateCorrectQueryWithStart()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithQuery

        +
        public void shouldCreateCorrectQueryWithQuery()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithWorkspace

        +
        public void shouldCreateCorrectQueryWithWorkspace()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithProject

        +
        public void shouldCreateCorrectQueryWithProject()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryWithNullProject

        +
        public void shouldCreateCorrectQueryWithNullProject()
        +
      • +
      + + + +
        +
      • +

        shouldCloneCorrectly

        +
        public void shouldCloneCorrectly()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectUrlForSubscription

        +
        public void shouldCreateCorrectUrlForSubscription()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectUrlForUser

        +
        public void shouldCreateCorrectUrlForUser()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectUrlForCollection

        +
        public void shouldCreateCorrectUrlForCollection()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/Request.html b/src/main/resources/doc/com/rallydev/rest/request/Request.html new file mode 100644 index 0000000..e44dc85 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/Request.html @@ -0,0 +1,357 @@ + + + + + +Request (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class Request

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Request

        +
        public Request()
        +
        Create a new request.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getParams

        +
        public List<NameValuePair> getParams()
        +
        Get the list of additional parameters included in this request.
        +
        Returns:
        The list of additional parameters
        +
      • +
      + + + +
        +
      • +

        setParams

        +
        public void setParams(List<NameValuePair> params)
        +
        Set the list of additional parameters included in this request.
        +
        Parameters:
        params - The list of additional parameters
        +
      • +
      + + + +
        +
      • +

        addParam

        +
        public void addParam(String name,
        +            String value)
        +
        Add the specified parameter to this request.
        +
        Parameters:
        name - the parameter name
        value - the parameter value
        +
      • +
      + + + +
        +
      • +

        getGsonBuilder

        +
        public GsonBuilder getGsonBuilder()
        +
        Get the Gson Builder used for JSON serialization in this request.
        +
        Returns:
        The Gson Builder used for JSON serialization
        +
      • +
      + + + +
        +
      • +

        setGsonBuilder

        +
        public void setGsonBuilder(GsonBuilder gsonBuilder)
        +
        Set the Gson Builder used for JSON serialization in this request.
        +
        Parameters:
        gsonBuilder - The Gson Builder used for JSON serialization
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public abstract String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + Must be implemented by subclasses.
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/RequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/RequestTest.html new file mode 100644 index 0000000..ba0ccc0 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/RequestTest.html @@ -0,0 +1,282 @@ + + + + + +RequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class RequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class RequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RequestTest

        +
        public RequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldBeAbleToAddParams

        +
        public void shouldBeAbleToAddParams()
        +
      • +
      + + + +
        +
      • +

        shouldBeAbleToSetParams

        +
        public void shouldBeAbleToSetParams()
        +
      • +
      + + + +
        +
      • +

        shouldBeAbleToSetGsonBuilder

        +
        public void shouldBeAbleToSetGsonBuilder()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/UpdateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/UpdateRequest.html new file mode 100644 index 0000000..e200940 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/UpdateRequest.html @@ -0,0 +1,335 @@ + + + + + +UpdateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class UpdateRequest

+
+
+ +
+
    +
  • +
    +
    +
    public class UpdateRequest
    +extends Request
    +
    Represents a WSAPI request to update an object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateRequest

        +
        public UpdateRequest(String ref,
        +             JsonObject obj)
        +
        Create a new update request for the specified object and values.
        +
        Parameters:
        ref - the ref of the WSAPI object to be created. May be absolute or relative, e.g. "/defect/12345"
        obj - the JSON representation of the values of the object
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBody

        +
        public String getBody()
        +
        Get the JSON encoded string representation of the object to be updated.
        +
        Returns:
        the JSON encoded object
        +
      • +
      + + + +
        +
      • +

        getFetch

        +
        public Fetch getFetch()
        +

        Get the current list of fields to be returned on the updated object.

        + By default all fields will be returned in the response (fetch=true).
        +
        Returns:
        the current list of fields.
        +
      • +
      + + + +
        +
      • +

        setFetch

        +
        public void setFetch(Fetch fetch)
        +
        Set the current list of fields to be returned on the updated object.
        +
        Parameters:
        fetch - the list of fields to be returned.
        +
      • +
      + + + +
        +
      • +

        toUrl

        +
        public String toUrl()
        +

        Convert this request into a url compatible with the WSAPI.

        + The current fetch and any other parameters will be included.
        +
        +
        Specified by:
        +
        toUrl in class Request
        +
        Returns:
        the url representing this request.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/UpdateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/UpdateRequestTest.html new file mode 100644 index 0000000..e3b1a94 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/UpdateRequestTest.html @@ -0,0 +1,308 @@ + + + + + +UpdateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.request
+

Class UpdateRequestTest

+
+
+ +
+
    +
  • +
    +
    +
    public class UpdateRequestTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateRequestTest

        +
        public UpdateRequestTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldCreateACorrectBody

        +
        public void shouldCreateACorrectBody()
        +
      • +
      + + + +
        +
      • +

        shouldCreateACorrectBodyWithNullFieldsByDefault

        +
        public void shouldCreateACorrectBodyWithNullFieldsByDefault()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrl

        +
        public void shouldConstructTheCorrectUrl()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectDefaultFetchUrl

        +
        public void shouldConstructTheCorrectDefaultFetchUrl()
        +
      • +
      + + + +
        +
      • +

        shouldConstructTheCorrectUrlWithExtraParam

        +
        public void shouldConstructTheCorrectUrlWithExtraParam()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequest.html new file mode 100644 index 0000000..8a83788 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequest.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.request.CollectionUpdateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.CollectionUpdateRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequestTest.html new file mode 100644 index 0000000..88c7a95 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/CollectionUpdateRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.CollectionUpdateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.CollectionUpdateRequestTest

+
+
No usage of com.rallydev.rest.request.CollectionUpdateRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequest.html new file mode 100644 index 0000000..3344800 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequest.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.request.CreateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.CreateRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequestTest.html new file mode 100644 index 0000000..73adbf2 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/CreateRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.CreateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.CreateRequestTest

+
+
No usage of com.rallydev.rest.request.CreateRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequest.html new file mode 100644 index 0000000..77bd178 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequest.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.request.DeleteRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.DeleteRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequestTest.html new file mode 100644 index 0000000..7b46d2b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/DeleteRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.DeleteRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.DeleteRequestTest

+
+
No usage of com.rallydev.rest.request.DeleteRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequest.html new file mode 100644 index 0000000..6995415 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequest.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.request.GetRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.GetRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequestTest.html new file mode 100644 index 0000000..de16a8e --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/GetRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.GetRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.GetRequestTest

+
+
No usage of com.rallydev.rest.request.GetRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequest.html new file mode 100644 index 0000000..0b8b28c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequest.html @@ -0,0 +1,185 @@ + + + + + +Uses of Class com.rallydev.rest.request.QueryRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.QueryRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequestTest.html new file mode 100644 index 0000000..042b2a5 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/QueryRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.QueryRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.QueryRequestTest

+
+
No usage of com.rallydev.rest.request.QueryRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/Request.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/Request.html new file mode 100644 index 0000000..15da546 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/Request.html @@ -0,0 +1,189 @@ + + + + + +Uses of Class com.rallydev.rest.request.Request (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.Request

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/RequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/RequestTest.html new file mode 100644 index 0000000..a15c491 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/RequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.RequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.RequestTest

+
+
No usage of com.rallydev.rest.request.RequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequest.html new file mode 100644 index 0000000..34c4fae --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequest.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.request.UpdateRequest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.UpdateRequest

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequestTest.html b/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequestTest.html new file mode 100644 index 0000000..6098124 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/class-use/UpdateRequestTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.request.UpdateRequestTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.request.UpdateRequestTest

+
+
No usage of com.rallydev.rest.request.UpdateRequestTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/package-frame.html b/src/main/resources/doc/com/rallydev/rest/request/package-frame.html new file mode 100644 index 0000000..777b7a3 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/package-frame.html @@ -0,0 +1,25 @@ + + + + + +com.rallydev.rest.request (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest.request

+ + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/package-summary.html b/src/main/resources/doc/com/rallydev/rest/request/package-summary.html new file mode 100644 index 0000000..13d0548 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/package-summary.html @@ -0,0 +1,180 @@ + + + + + +com.rallydev.rest.request (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest.request

+
+
Provides objects for encoding requests to the Rest API.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    CollectionUpdateRequest +
    Represents a WSAPI request to update a collection.
    +
    CreateRequest +
    Represents a WSAPI request to create an object.
    +
    DeleteRequest +
    Represents a WSAPI request to delete an object.
    +
    GetRequest +
    Represents a WSAPI request to retrieve a specific object.
    +
    QueryRequest +
    Represents a WSAPI request to retrieve all objects matching specified criteria.
    +
    Request +
    Base class for all WSAPI requests.
    +
    UpdateRequest +
    Represents a WSAPI request to update an object.
    +
    +
  • +
+ + + +

Package com.rallydev.rest.request Description

+
Provides objects for encoding requests to the Rest API.
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/package-tree.html b/src/main/resources/doc/com/rallydev/rest/request/package-tree.html new file mode 100644 index 0000000..ab9fd00 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/package-tree.html @@ -0,0 +1,137 @@ + + + + + +com.rallydev.rest.request Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest.request

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/request/package-use.html b/src/main/resources/doc/com/rallydev/rest/request/package-use.html new file mode 100644 index 0000000..0c7d0f0 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/request/package-use.html @@ -0,0 +1,205 @@ + + + + + +Uses of Package com.rallydev.rest.request (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest.request

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponse.html new file mode 100644 index 0000000..43bc7e4 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponse.html @@ -0,0 +1,278 @@ + + + + + +CollectionUpdateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class CollectionUpdateResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class CollectionUpdateResponse
    +extends Response
    +
    Represents a WSAPI response from updating a collection.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CollectionUpdateResponse

        +
        public CollectionUpdateResponse(String updateResponse)
        +
        Create a new collection update response from the specified JSON encoded string. + Note that this class is only usable with WSAPI versions 2.0 and above.
        +
        Parameters:
        updateResponse - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getResults

        +
        public JsonArray getResults()
        +
        Get the results of the collection update
        +
        Returns:
        the results
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponseTest.html new file mode 100644 index 0000000..b8ad46c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/CollectionUpdateResponseTest.html @@ -0,0 +1,269 @@ + + + + + +CollectionUpdateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class CollectionUpdateResponseTest

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.rallydev.rest.response.CollectionUpdateResponseTest
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class CollectionUpdateResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CollectionUpdateResponseTest

        +
        public CollectionUpdateResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnResults

        +
        public void shouldReturnResults()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoErrors

        +
        public void shouldReturnNoErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/CreateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/CreateResponse.html new file mode 100644 index 0000000..c8d3bf0 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/CreateResponse.html @@ -0,0 +1,278 @@ + + + + + +CreateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class CreateResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class CreateResponse
    +extends Response
    +
    Represents a WSAPI response from creating an object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CreateResponse

        +
        public CreateResponse(String createResponse)
        +
        Create a new create response from the specified JSON encoded string.
        +
        Parameters:
        createResponse - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getObject

        +
        public JsonObject getObject()
        +
        Get the created object. +

        Returns null if the operation was not successful

        +
        Returns:
        the created object
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/CreateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/CreateResponseTest.html new file mode 100644 index 0000000..1ba7a2c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/CreateResponseTest.html @@ -0,0 +1,269 @@ + + + + + +CreateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class CreateResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class CreateResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CreateResponseTest

        +
        public CreateResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnCreatedObject

        +
        public void shouldReturnCreatedObject()
        +
      • +
      + + + +
        +
      • +

        shouldReturnErrors

        +
        public void shouldReturnErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/DeleteResponse.html b/src/main/resources/doc/com/rallydev/rest/response/DeleteResponse.html new file mode 100644 index 0000000..e01c4c7 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/DeleteResponse.html @@ -0,0 +1,245 @@ + + + + + +DeleteResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class DeleteResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class DeleteResponse
    +extends Response
    +
    Represents a WSAPI response from deleting an object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DeleteResponse

        +
        public DeleteResponse(String deleteResponse)
        +
        Create a new delete response from the specified JSON encoded string.
        +
        Parameters:
        deleteResponse - the JSON encoded string
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/DeleteResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/DeleteResponseTest.html new file mode 100644 index 0000000..6f1d878 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/DeleteResponseTest.html @@ -0,0 +1,269 @@ + + + + + +DeleteResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class DeleteResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class DeleteResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DeleteResponseTest

        +
        public DeleteResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnErrors

        +
        public void shouldReturnErrors()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoErrors

        +
        public void shouldReturnNoErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/GetResponse.html b/src/main/resources/doc/com/rallydev/rest/response/GetResponse.html new file mode 100644 index 0000000..19787b5 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/GetResponse.html @@ -0,0 +1,278 @@ + + + + + +GetResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class GetResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class GetResponse
    +extends Response
    +
    Represents a WSAPI response from retrieving a single object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GetResponse

        +
        public GetResponse(String getResponse)
        +
        Create a new get response from the specified JSON encoded string.
        +
        Parameters:
        getResponse - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getObject

        +
        public JsonObject getObject()
        +
        Get the retrieved object. +

        Returns null if the operation was not successful

        +
        Returns:
        the retrieved object
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/GetResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/GetResponseTest.html new file mode 100644 index 0000000..a871147 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/GetResponseTest.html @@ -0,0 +1,269 @@ + + + + + +GetResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class GetResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class GetResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GetResponseTest

        +
        public GetResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnErrors

        +
        public void shouldReturnErrors()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoErrors

        +
        public void shouldReturnNoErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/QueryResponse.html b/src/main/resources/doc/com/rallydev/rest/response/QueryResponse.html new file mode 100644 index 0000000..135ebf4 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/QueryResponse.html @@ -0,0 +1,329 @@ + + + + + +QueryResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class QueryResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class QueryResponse
    +extends Response
    +
    Represents a WSAPI response from querying for objects.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryResponse

        +
        public QueryResponse(String queryResponse)
        +
        Create a new query response from the specified JSON encoded string.
        +
        Parameters:
        queryResponse - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getTotalResultCount

        +
        public int getTotalResultCount()
        +
        Get the total number of objects that matched the query
        +
        Returns:
        the total number of objects
        +
      • +
      + + + +
        +
      • +

        getResults

        +
        public JsonArray getResults()
        +
        Get the results of the query +

        Depending on the limit of the original request this may include one or more pages.

        +
        Returns:
        the results
        +
      • +
      + + + +
        +
      • +

        getPageSize

        +
        public int getPageSize()
        +
        Get the page size of the results
        +
        Returns:
        the page size
        +
      • +
      + + + +
        +
      • +

        getStart

        +
        public int getStart()
        +
        Get the start index of the results
        +
        Returns:
        the start index
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/QueryResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/QueryResponseTest.html new file mode 100644 index 0000000..5044d45 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/QueryResponseTest.html @@ -0,0 +1,269 @@ + + + + + +QueryResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class QueryResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class QueryResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryResponseTest

        +
        public QueryResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnResults

        +
        public void shouldReturnResults()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoErrors

        +
        public void shouldReturnNoErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/Response.html b/src/main/resources/doc/com/rallydev/rest/response/Response.html new file mode 100644 index 0000000..5a0ac38 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/Response.html @@ -0,0 +1,303 @@ + + + + + +Response (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class Response

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Response

        +
        public Response(String response)
        +
        Create a new response from the specified JSON encoded string.
        +
        Parameters:
        response - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        wasSuccessful

        +
        public boolean wasSuccessful()
        +
        Returns whether the response was successful (no errors)
        +
        Returns:
        whether the response was successful
        +
      • +
      + + + +
        +
      • +

        getErrors

        +
        public String[] getErrors()
        +
        Get any errors returned in the response.
        +
        Returns:
        the response errors
        +
      • +
      + + + +
        +
      • +

        getWarnings

        +
        public String[] getWarnings()
        +
        Get any warnings returned in the response.
        +
        Returns:
        the response warnings
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/ResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/ResponseTest.html new file mode 100644 index 0000000..d0be7b3 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/ResponseTest.html @@ -0,0 +1,295 @@ + + + + + +ResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class ResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class ResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ResponseTest

        +
        public ResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnErrors

        +
        public void shouldReturnErrors()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoErrors

        +
        public void shouldReturnNoErrors()
        +
      • +
      + + + +
        +
      • +

        shouldReturnWarnings

        +
        public void shouldReturnWarnings()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNoWarnings

        +
        public void shouldReturnNoWarnings()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/UpdateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/UpdateResponse.html new file mode 100644 index 0000000..6650fc1 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/UpdateResponse.html @@ -0,0 +1,278 @@ + + + + + +UpdateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class UpdateResponse

+
+
+ +
+
    +
  • +
    +
    +
    public class UpdateResponse
    +extends Response
    +
    Represents a WSAPI response from updating an object.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateResponse

        +
        public UpdateResponse(String updateResponse)
        +
        Create a new update response from the specified JSON encoded string.
        +
        Parameters:
        updateResponse - the JSON encoded string
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getObject

        +
        public JsonObject getObject()
        +
        Get the updated object. +

        Returns null if the operation was not successful

        +
        Returns:
        the updated object
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/UpdateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/UpdateResponseTest.html new file mode 100644 index 0000000..e215bc8 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/UpdateResponseTest.html @@ -0,0 +1,269 @@ + + + + + +UpdateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.response
+

Class UpdateResponseTest

+
+
+ +
+
    +
  • +
    +
    +
    public class UpdateResponseTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateResponseTest

        +
        public UpdateResponseTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldReturnUpdatedObject

        +
        public void shouldReturnUpdatedObject()
        +
      • +
      + + + +
        +
      • +

        shouldReturnErrors

        +
        public void shouldReturnErrors()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponse.html new file mode 100644 index 0000000..197da83 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.CollectionUpdateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.CollectionUpdateResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponseTest.html new file mode 100644 index 0000000..4d94984 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/CollectionUpdateResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.CollectionUpdateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.CollectionUpdateResponseTest

+
+
No usage of com.rallydev.rest.response.CollectionUpdateResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponse.html new file mode 100644 index 0000000..0d21e67 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.CreateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.CreateResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponseTest.html new file mode 100644 index 0000000..af0035f --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/CreateResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.CreateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.CreateResponseTest

+
+
No usage of com.rallydev.rest.response.CreateResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponse.html new file mode 100644 index 0000000..ef543d8 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.DeleteResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.DeleteResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponseTest.html new file mode 100644 index 0000000..9f4b573 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/DeleteResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.DeleteResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.DeleteResponseTest

+
+
No usage of com.rallydev.rest.response.DeleteResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponse.html new file mode 100644 index 0000000..15d3ed5 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.GetResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.GetResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponseTest.html new file mode 100644 index 0000000..92a4655 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/GetResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.GetResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.GetResponseTest

+
+
No usage of com.rallydev.rest.response.GetResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponse.html new file mode 100644 index 0000000..990ba64 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.QueryResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.QueryResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponseTest.html new file mode 100644 index 0000000..a540259 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/QueryResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.QueryResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.QueryResponseTest

+
+
No usage of com.rallydev.rest.response.QueryResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/Response.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/Response.html new file mode 100644 index 0000000..d4a863a --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/Response.html @@ -0,0 +1,189 @@ + + + + + +Uses of Class com.rallydev.rest.response.Response (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.Response

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/ResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/ResponseTest.html new file mode 100644 index 0000000..eec3088 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/ResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.ResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.ResponseTest

+
+
No usage of com.rallydev.rest.response.ResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponse.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponse.html new file mode 100644 index 0000000..9bbd953 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponse.html @@ -0,0 +1,159 @@ + + + + + +Uses of Class com.rallydev.rest.response.UpdateResponse (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.UpdateResponse

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponseTest.html b/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponseTest.html new file mode 100644 index 0000000..1efc3e7 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/class-use/UpdateResponseTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.response.UpdateResponseTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.response.UpdateResponseTest

+
+
No usage of com.rallydev.rest.response.UpdateResponseTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/package-frame.html b/src/main/resources/doc/com/rallydev/rest/response/package-frame.html new file mode 100644 index 0000000..31296d9 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/package-frame.html @@ -0,0 +1,25 @@ + + + + + +com.rallydev.rest.response (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest.response

+ + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/package-summary.html b/src/main/resources/doc/com/rallydev/rest/response/package-summary.html new file mode 100644 index 0000000..50f57e9 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/package-summary.html @@ -0,0 +1,180 @@ + + + + + +com.rallydev.rest.response (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest.response

+
+
Provides objects for parsing responses from the Rest API.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    CollectionUpdateResponse +
    Represents a WSAPI response from updating a collection.
    +
    CreateResponse +
    Represents a WSAPI response from creating an object
    +
    DeleteResponse +
    Represents a WSAPI response from deleting an object
    +
    GetResponse +
    Represents a WSAPI response from retrieving a single object.
    +
    QueryResponse +
    Represents a WSAPI response from querying for objects.
    +
    Response +
    Represents a WSAPI response.
    +
    UpdateResponse +
    Represents a WSAPI response from updating an object.
    +
    +
  • +
+ + + +

Package com.rallydev.rest.response Description

+
Provides objects for parsing responses from the Rest API.
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/package-tree.html b/src/main/resources/doc/com/rallydev/rest/response/package-tree.html new file mode 100644 index 0000000..90ba57d --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/package-tree.html @@ -0,0 +1,137 @@ + + + + + +com.rallydev.rest.response Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest.response

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/response/package-use.html b/src/main/resources/doc/com/rallydev/rest/response/package-use.html new file mode 100644 index 0000000..7cc755b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/response/package-use.html @@ -0,0 +1,200 @@ + + + + + +Uses of Package com.rallydev.rest.response (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest.response

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/Fetch.html b/src/main/resources/doc/com/rallydev/rest/util/Fetch.html new file mode 100644 index 0000000..663f2cf --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/Fetch.html @@ -0,0 +1,317 @@ + + + + + +Fetch (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class Fetch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Fetch

        +
        public Fetch(String... fetch)
        +
        Create a new fetch with the specified fields.
        +
        Parameters:
        fetch - one or more fields to be returned
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Get the comma separated list of fields to be returned. + If the list is empty true will be returned.
        +
        +
        Overrides:
        +
        toString in class AbstractCollection<String>
        +
        Returns:
        the comma separated list of fields to be returned
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/FetchTest.html b/src/main/resources/doc/com/rallydev/rest/util/FetchTest.html new file mode 100644 index 0000000..7e4f516 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/FetchTest.html @@ -0,0 +1,282 @@ + + + + + +FetchTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class FetchTest

+
+
+ +
+
    +
  • +
    +
    +
    public class FetchTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FetchTest

        +
        public FetchTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldProvideCorrectDefaultFetch

        +
        public void shouldProvideCorrectDefaultFetch()
        +
      • +
      + + + +
        +
      • +

        shouldProvideCorrectFetch

        +
        public void shouldProvideCorrectFetch()
        +
      • +
      + + + +
        +
      • +

        shouldBeAbleToAddRemoveFetch

        +
        public void shouldBeAbleToAddRemoveFetch()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/InvalidURLException.html b/src/main/resources/doc/com/rallydev/rest/util/InvalidURLException.html new file mode 100644 index 0000000..66a585b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/InvalidURLException.html @@ -0,0 +1,255 @@ + + + + + +InvalidURLException (Rally Rest API for Java 2.0) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class InvalidURLException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InvalidURLException

        +
        public InvalidURLException(String msg)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/QueryFilter.html b/src/main/resources/doc/com/rallydev/rest/util/QueryFilter.html new file mode 100644 index 0000000..8105a65 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/QueryFilter.html @@ -0,0 +1,355 @@ + + + + + +QueryFilter (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class QueryFilter

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class QueryFilter
    +extends Object
    +implements Cloneable
    +
    Represents a query filter to be applied to query requests. +

    More on the WSAPI query syntax can be found here: http://rally1.rallydev.com/slm/doc/webservice

    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      QueryFilter(String field, + String operator, + String value) +
      Create a new query filter with the specified options.
      +
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryFilter

        +
        public QueryFilter(String field,
        +           String operator,
        +           String value)
        +
        Create a new query filter with the specified options.
        +
        Parameters:
        field - the object field to evaluate
        operator - the operator to use for evaluation
        value - the value to be evaluated
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        and

        +
        public QueryFilter and(QueryFilter q)
        +
        Get a query filter that is the ANDed combination of this filter and the specified one.
        +
        Parameters:
        q - the filter to be ANDed
        +
        Returns:
        the ANDed query filter
        +
      • +
      + + + +
        +
      • +

        or

        +
        public QueryFilter or(QueryFilter q)
        +
        Get a query filter that is the ORed combination of this filter and the specified one.
        +
        Parameters:
        q - the filter to be ORed
        +
        Returns:
        the ORed query filter
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Get the string representation of this query filter. +

        Examples:

        +
          +
        • (ScheduleState = Accepted)
        • +
        • ((ScheduleState = Accepted) AND (Iteration.Name = "My Iteration"))
        • +
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        the string representation of this query filter.
        +
      • +
      + + + +
        +
      • +

        and

        +
        public static QueryFilter and(QueryFilter... queryFilters)
        +
        Get a query filter that is the ANDed combination of the specified filters.
        +
        Parameters:
        queryFilters - one or more query filters to be ANDed together
        +
        Returns:
        the ANDed query filter
        +
      • +
      + + + +
        +
      • +

        or

        +
        public static QueryFilter or(QueryFilter... queryFilters)
        +
        Get a query filter that is the ORed combination of the specified filters.
        +
        Parameters:
        queryFilters - one or more query filters to be ORed together
        +
        Returns:
        the ORed query filter
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/QueryFilterTest.html b/src/main/resources/doc/com/rallydev/rest/util/QueryFilterTest.html new file mode 100644 index 0000000..298197c --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/QueryFilterTest.html @@ -0,0 +1,360 @@ + + + + + +QueryFilterTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class QueryFilterTest

+
+
+ +
+
    +
  • +
    +
    +
    public class QueryFilterTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QueryFilterTest

        +
        public QueryFilterTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldCreateCorrectQueryForString

        +
        public void shouldCreateCorrectQueryForString()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryForNull

        +
        public void shouldCreateCorrectQueryForNull()
        +
      • +
      + + + +
        +
      • +

        shouldCreateQuotedQueryForStringWithSpaces

        +
        public void shouldCreateQuotedQueryForStringWithSpaces()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryForRef

        +
        public void shouldCreateCorrectQueryForRef()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectQueryForNumber

        +
        public void shouldCreateCorrectQueryForNumber()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectAndedQuery

        +
        public void shouldCreateCorrectAndedQuery()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectStaticAndedQuery

        +
        public void shouldCreateCorrectStaticAndedQuery()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectOredQuery

        +
        public void shouldCreateCorrectOredQuery()
        +
      • +
      + + + +
        +
      • +

        shouldCreateCorrectStaticOredQuery

        +
        public void shouldCreateCorrectStaticOredQuery()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/Ref.html b/src/main/resources/doc/com/rallydev/rest/util/Ref.html new file mode 100644 index 0000000..8af4b78 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/Ref.html @@ -0,0 +1,316 @@ + + + + + +Ref (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class Ref

+
+
+ +
+
    +
  • +
    +
    +
    public class Ref
    +extends Object
    +
    Provides utility methods for working with ref URLs.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Ref

        +
        public Ref()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isRef

        +
        public static boolean isRef(String ref)
        +
        Determine whether the specified string is a valid ref url.
        +
        Parameters:
        ref - the string to be tested. May be either absolute or relative, e.g. /defect/1234
        +
        Returns:
        whether the specified string is a valid ref url
        +
      • +
      + + + +
        +
      • +

        getRelativeRef

        +
        public static String getRelativeRef(String ref)
        +
        Create a relative ref url from the specified ref
        +
        Parameters:
        ref - the ref url to be made relative
        +
        Returns:
        the relative ref url or null if the specified ref was not valid
        +
      • +
      + + + +
        +
      • +

        getTypeFromRef

        +
        public static String getTypeFromRef(String ref)
        +
        Get the type from the specified ref url
        +
        Parameters:
        ref - the ref url to extract the type from
        +
        Returns:
        the extracted type or null if the specified ref was not valid
        +
      • +
      + + + +
        +
      • +

        getOidFromRef

        +
        public static String getOidFromRef(String ref)
        +
        Get the ObjectID from the specified ref url
        +
        Parameters:
        ref - the ref url to extract the ObjectID from
        +
        Returns:
        the extracted ObjectID or null if the specified ref was not valid
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/RefTest.html b/src/main/resources/doc/com/rallydev/rest/util/RefTest.html new file mode 100644 index 0000000..b92af81 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/RefTest.html @@ -0,0 +1,451 @@ + + + + + +RefTest (Rally Rest API for Java 2.2) + + + + + + + + + + + +
+
com.rallydev.rest.util
+

Class RefTest

+
+
+ +
+
    +
  • +
    +
    +
    public class RefTest
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RefTest

        +
        public RefTest()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        shouldDetectValidRefs

        +
        public void shouldDetectValidRefs()
        +
      • +
      + + + +
        +
      • +

        shouldDetectValidDynatypeRefs

        +
        public void shouldDetectValidDynatypeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldDetectInvalidRefs

        +
        public void shouldDetectInvalidRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnValidRelativeRefs

        +
        public void shouldReturnValidRelativeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnValidDynatypeRelativeRefs

        +
        public void shouldReturnValidDynatypeRelativeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNullRelativeRefs

        +
        public void shouldReturnNullRelativeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnTypesFromRefs

        +
        public void shouldReturnTypesFromRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnTypesFromDynatypeRefs

        +
        public void shouldReturnTypesFromDynatypeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNullTypesFromRefs

        +
        public void shouldReturnNullTypesFromRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnOidsFromRefs

        +
        public void shouldReturnOidsFromRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnOidsFromDynatypeRefs

        +
        public void shouldReturnOidsFromDynatypeRefs()
        +
      • +
      + + + +
        +
      • +

        shouldReturnNullOidsFromRefs

        +
        public void shouldReturnNullOidsFromRefs()
        +
      • +
      + + + +
        +
      • +

        shouldSupportWsapiVersionXinRefs

        +
        public void shouldSupportWsapiVersionXinRefs()
        +
      • +
      + + + +
        +
      • +

        shouldSupportWorkspacePermissionRefs

        +
        public void shouldSupportWorkspacePermissionRefs()
        +
      • +
      + + + +
        +
      • +

        shouldSupportProjectPermissionRefs

        +
        public void shouldSupportProjectPermissionRefs()
        +
      • +
      + + + +
        +
      • +

        shouldSupportCollectionRefs

        +
        public void shouldSupportCollectionRefs()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/Fetch.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/Fetch.html new file mode 100644 index 0000000..b6f4e27 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/Fetch.html @@ -0,0 +1,222 @@ + + + + + +Uses of Class com.rallydev.rest.util.Fetch (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.Fetch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use Fetch 
    PackageDescription
    com.rallydev.rest.request +
    Provides objects for encoding requests to the Rest API.
    +
    +
  • +
  • +
      +
    • + + +

      Uses of Fetch in com.rallydev.rest.request

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in com.rallydev.rest.request that return Fetch 
      Modifier and TypeMethod and Description
      FetchCollectionUpdateRequest.getFetch() +
      Get the current list of fields to be returned on the updated object.
      +
      FetchGetRequest.getFetch() +
      Get the current list of fields to be returned on the retrieved object.
      +
      FetchUpdateRequest.getFetch() +
      Get the current list of fields to be returned on the updated object.
      +
      FetchCreateRequest.getFetch() +
      Get the current list of fields to be returned on the created object.
      +
      FetchQueryRequest.getFetch() +
      Get the current list of fields to be returned on the matching objects.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in com.rallydev.rest.request with parameters of type Fetch 
      Modifier and TypeMethod and Description
      voidCollectionUpdateRequest.setFetch(Fetch fetch) +
      Set the current list of fields to be returned on the updated object.
      +
      voidGetRequest.setFetch(Fetch fetch) +
      Set the current list of fields to be returned on the retrieved object.
      +
      voidUpdateRequest.setFetch(Fetch fetch) +
      Set the current list of fields to be returned on the updated object.
      +
      voidCreateRequest.setFetch(Fetch fetch) +
      Set the current list of fields to be returned on the created object.
      +
      voidQueryRequest.setFetch(Fetch fetch) +
      Set the current list of fields to be returned on the matching objects.
      +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/FetchTest.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/FetchTest.html new file mode 100644 index 0000000..a2e9385 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/FetchTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.util.FetchTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.FetchTest

+
+
No usage of com.rallydev.rest.util.FetchTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/InvalidURLException.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/InvalidURLException.html new file mode 100644 index 0000000..a535b87 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/InvalidURLException.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.util.InvalidURLException (Rally Rest API for Java 2.0) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.InvalidURLException

+
+
No usage of com.rallydev.rest.util.InvalidURLException
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilter.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilter.html new file mode 100644 index 0000000..beba820 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilter.html @@ -0,0 +1,251 @@ + + + + + +Uses of Class com.rallydev.rest.util.QueryFilter (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.QueryFilter

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilterTest.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilterTest.html new file mode 100644 index 0000000..81cbeaf --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/QueryFilterTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.util.QueryFilterTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.QueryFilterTest

+
+
No usage of com.rallydev.rest.util.QueryFilterTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/Ref.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/Ref.html new file mode 100644 index 0000000..d0449d2 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/Ref.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.util.Ref (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.Ref

+
+
No usage of com.rallydev.rest.util.Ref
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/class-use/RefTest.html b/src/main/resources/doc/com/rallydev/rest/util/class-use/RefTest.html new file mode 100644 index 0000000..0fa1f85 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/class-use/RefTest.html @@ -0,0 +1,115 @@ + + + + + +Uses of Class com.rallydev.rest.util.RefTest (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Class
com.rallydev.rest.util.RefTest

+
+
No usage of com.rallydev.rest.util.RefTest
+ + + + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/package-frame.html b/src/main/resources/doc/com/rallydev/rest/util/package-frame.html new file mode 100644 index 0000000..495d866 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/package-frame.html @@ -0,0 +1,21 @@ + + + + + +com.rallydev.rest.util (Rally Rest API for Java 2.2) + + + + +

com.rallydev.rest.util

+
+

Classes

+ +
+ + diff --git a/src/main/resources/doc/com/rallydev/rest/util/package-summary.html b/src/main/resources/doc/com/rallydev/rest/util/package-summary.html new file mode 100644 index 0000000..886484b --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/package-summary.html @@ -0,0 +1,156 @@ + + + + + +com.rallydev.rest.util (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Package com.rallydev.rest.util

+
+
Provides utilities for working with the Rest API.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Fetch +
    Represents a list of fields to be returned in responses from the WSAPI.
    +
    QueryFilter +
    Represents a query filter to be applied to query requests.
    +
    Ref +
    Provides utility methods for working with ref URLs.
    +
    +
  • +
+ + + +

Package com.rallydev.rest.util Description

+
Provides utilities for working with the Rest API.
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/package-tree.html b/src/main/resources/doc/com/rallydev/rest/util/package-tree.html new file mode 100644 index 0000000..d42ce88 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/package-tree.html @@ -0,0 +1,142 @@ + + + + + +com.rallydev.rest.util Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package com.rallydev.rest.util

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/com/rallydev/rest/util/package-use.html b/src/main/resources/doc/com/rallydev/rest/util/package-use.html new file mode 100644 index 0000000..4b66a80 --- /dev/null +++ b/src/main/resources/doc/com/rallydev/rest/util/package-use.html @@ -0,0 +1,180 @@ + + + + + +Uses of Package com.rallydev.rest.util (Rally Rest API for Java 2.2) + + + + + + + + + + +
+

Uses of Package
com.rallydev.rest.util

+
+
+ +
+ + + + + + diff --git a/src/main/resources/doc/constant-values.html b/src/main/resources/doc/constant-values.html new file mode 100644 index 0000000..7cea976 --- /dev/null +++ b/src/main/resources/doc/constant-values.html @@ -0,0 +1,115 @@ + + + + + +Constant Field Values (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/deprecated-list.html b/src/main/resources/doc/deprecated-list.html new file mode 100644 index 0000000..8e84859 --- /dev/null +++ b/src/main/resources/doc/deprecated-list.html @@ -0,0 +1,139 @@ + + + + + +Deprecated List (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Deprecated API

+

Contents

+ +
+
+ + + +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/help-doc.html b/src/main/resources/doc/help-doc.html new file mode 100644 index 0000000..323f84c --- /dev/null +++ b/src/main/resources/doc/help-doc.html @@ -0,0 +1,220 @@ + + + + + +API Help (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-1.html b/src/main/resources/doc/index-files/index-1.html new file mode 100644 index 0000000..91295ea --- /dev/null +++ b/src/main/resources/doc/index-files/index-1.html @@ -0,0 +1,138 @@ + + + + + +A-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

A

+
+
addParam(String, String) - Method in class com.rallydev.rest.request.Request
+
+
Add the specified parameter to this request.
+
+
and(QueryFilter) - Method in class com.rallydev.rest.util.QueryFilter
+
+
Get a query filter that is the ANDed combination of this filter and the specified one.
+
+
and(QueryFilter...) - Static method in class com.rallydev.rest.util.QueryFilter
+
+
Get a query filter that is the ANDed combination of the specified filters.
+
+
ApiKeyClient - Class in com.rallydev.rest.client
+
+
A HttpClient which authenticates using an API Key.
+
+
ApiKeyClient(URI, String) - Constructor for class com.rallydev.rest.client.ApiKeyClient
+
+
Construct a new client.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-10.html b/src/main/resources/doc/index-files/index-10.html new file mode 100644 index 0000000..1e2159a --- /dev/null +++ b/src/main/resources/doc/index-files/index-10.html @@ -0,0 +1,150 @@ + + + + + +Q-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

Q

+
+
query(QueryRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Query for objects matching the specified request.
+
+
QueryFilter - Class in com.rallydev.rest.util
+
+
Represents a query filter to be applied to query requests.
+
+
QueryFilter(String, String, String) - Constructor for class com.rallydev.rest.util.QueryFilter
+
+
Create a new query filter with the specified options.
+
+
QueryRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to retrieve all objects matching specified criteria.
+
+
QueryRequest(String) - Constructor for class com.rallydev.rest.request.QueryRequest
+
+
Create a new query request for the specified type.
+
+
QueryRequest(JsonObject) - Constructor for class com.rallydev.rest.request.QueryRequest
+
+
Create a new query request for the specified collection.
+
+
QueryResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from querying for objects.
+
+
QueryResponse(String) - Constructor for class com.rallydev.rest.response.QueryResponse
+
+
Create a new query response from the specified JSON encoded string.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-11.html b/src/main/resources/doc/index-files/index-11.html new file mode 100644 index 0000000..8da52d0 --- /dev/null +++ b/src/main/resources/doc/index-files/index-11.html @@ -0,0 +1,154 @@ + + + + + +R-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

R

+
+
RallyRestApi - Class in com.rallydev.rest
+
+
The main interface to the Rest API.
+
+
RallyRestApi(URI, String, String) - Constructor for class com.rallydev.rest.RallyRestApi
+
+
Deprecated. +
Use the api key constructor instead.
+
+
+
RallyRestApi(URI, String) - Constructor for class com.rallydev.rest.RallyRestApi
+
+
Creates a new instance for the specified server using the specified API Key.
+
+
Ref - Class in com.rallydev.rest.util
+
+
Provides utility methods for working with ref URLs.
+
+
Ref() - Constructor for class com.rallydev.rest.util.Ref
+
 
+
Request - Class in com.rallydev.rest.request
+
+
Base class for all WSAPI requests.
+
+
Request() - Constructor for class com.rallydev.rest.request.Request
+
+
Create a new request.
+
+
Response - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response.
+
+
Response(String) - Constructor for class com.rallydev.rest.response.Response
+
+
Create a new response from the specified JSON encoded string.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-12.html b/src/main/resources/doc/index-files/index-12.html new file mode 100644 index 0000000..0b6de81 --- /dev/null +++ b/src/main/resources/doc/index-files/index-12.html @@ -0,0 +1,230 @@ + + + + + +S-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

S

+
+
setApplicationName(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the value of the X-RallyIntegrationName header included on all requests.
+
+
setApplicationName(String) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the value of the X-RallyIntegrationName header included on all requests.
+
+
setApplicationVendor(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the value of the X-RallyIntegrationVendor header included on all requests.
+
+
setApplicationVendor(String) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the value of the X-RallyIntegrationVendor header included on all requests.
+
+
setApplicationVersion(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the value of the X-RallyIntegrationVersion header included on all requests.
+
+
setApplicationVersion(String) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the value of the X-RallyIntegrationVersion header included on all requests.
+
+
setFetch(Fetch) - Method in class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Set the current list of fields to be returned on the updated object.
+
+
setFetch(Fetch) - Method in class com.rallydev.rest.request.CreateRequest
+
+
Set the current list of fields to be returned on the created object.
+
+
setFetch(Fetch) - Method in class com.rallydev.rest.request.GetRequest
+
+
Set the current list of fields to be returned on the retrieved object.
+
+
setFetch(Fetch) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set the current list of fields to be returned on the matching objects.
+
+
setFetch(Fetch) - Method in class com.rallydev.rest.request.UpdateRequest
+
+
Set the current list of fields to be returned on the updated object.
+
+
setGsonBuilder(GsonBuilder) - Method in class com.rallydev.rest.request.Request
+
+
Set the Gson Builder used for JSON serialization in this request.
+
+
setLimit(int) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set the maximum number of records to be returned from the query.
+
+
setOrder(String) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the order by which the result set will be sorted.
+
+
setPageSize(int) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set the page size of the result set.
+
+
setParams(List<NameValuePair>) - Method in class com.rallydev.rest.request.Request
+
+
Set the list of additional parameters included in this request.
+
+
setProject(String) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Specify the project which the result set should be scoped to.
+
+
setProxy(URI) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the unauthenticated proxy server to use.
+
+
setProxy(URI, String, String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the authenticated proxy server to use.
+
+
setProxy(URI) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the unauthenticated proxy server to use.
+
+
setProxy(URI, String, String) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the authenticated proxy server to use.
+
+
setQueryFilter(QueryFilter) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set a filter by which the result set will be narrowed down.
+
+
setScopedDown(boolean) - Method in class com.rallydev.rest.request.QueryRequest
+
+
If a project has been specified, set whether to include matching objects in child projects in the result set.
+
+
setScopedUp(boolean) - Method in class com.rallydev.rest.request.QueryRequest
+
+
If a project has been specified, set whether to include matching objects in parent projects in the result set.
+
+
setStart(int) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set the 1-based start index of the result set.
+
+
setWorkspace(String) - Method in class com.rallydev.rest.request.QueryRequest
+
+
Specify the workspace which the result set should be scoped to.
+
+
setWsapiVersion(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Set the current version of the WSAPI being targeted.
+
+
setWsapiVersion(String) - Method in class com.rallydev.rest.RallyRestApi
+
+
Set the current version of the WSAPI being targeted.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-13.html b/src/main/resources/doc/index-files/index-13.html new file mode 100644 index 0000000..4b55239 --- /dev/null +++ b/src/main/resources/doc/index-files/index-13.html @@ -0,0 +1,154 @@ + + + + + +T-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

T

+
+
toString() - Method in class com.rallydev.rest.util.Fetch
+
+
Get the comma separated list of fields to be returned.
+
+
toString() - Method in class com.rallydev.rest.util.QueryFilter
+
+
Get the string representation of this query filter.
+
+
toUrl() - Method in class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.CreateRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.DeleteRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.GetRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.Request
+
+
Convert this request into a url compatible with the WSAPI.
+
+
toUrl() - Method in class com.rallydev.rest.request.UpdateRequest
+
+
Convert this request into a url compatible with the WSAPI.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-14.html b/src/main/resources/doc/index-files/index-14.html new file mode 100644 index 0000000..f6fa8aa --- /dev/null +++ b/src/main/resources/doc/index-files/index-14.html @@ -0,0 +1,142 @@ + + + + + +U-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

U

+
+
update(UpdateRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Update the specified object.
+
+
updateCollection(CollectionUpdateRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Update the specified collection.
+
+
UpdateRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to update an object.
+
+
UpdateRequest(String, JsonObject) - Constructor for class com.rallydev.rest.request.UpdateRequest
+
+
Create a new update request for the specified object and values.
+
+
UpdateResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from updating an object.
+
+
UpdateResponse(String) - Constructor for class com.rallydev.rest.response.UpdateResponse
+
+
Create a new update response from the specified JSON encoded string.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-15.html b/src/main/resources/doc/index-files/index-15.html new file mode 100644 index 0000000..199a2f1 --- /dev/null +++ b/src/main/resources/doc/index-files/index-15.html @@ -0,0 +1,122 @@ + + + + + +W-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

W

+
+
wasSuccessful() - Method in class com.rallydev.rest.response.Response
+
+
Returns whether the response was successful (no errors)
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-16.html b/src/main/resources/doc/index-files/index-16.html new file mode 100644 index 0000000..394260d --- /dev/null +++ b/src/main/resources/doc/index-files/index-16.html @@ -0,0 +1,122 @@ + + + + + +W-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I M O Q R S T U W  + + +

W

+
+
wasSuccessful() - Method in class com.rallydev.rest.response.Response
+
+
Returns whether the response was successful (no errors)
+
+
+A B C D F G H I M O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-2.html b/src/main/resources/doc/index-files/index-2.html new file mode 100644 index 0000000..db6ee4e --- /dev/null +++ b/src/main/resources/doc/index-files/index-2.html @@ -0,0 +1,126 @@ + + + + + +B-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

B

+
+
BasicAuthClient - Class in com.rallydev.rest.client
+
+
A HttpClient which authenticates using basic authentication (username/password).
+
+
BasicAuthClient(URI, String, String) - Constructor for class com.rallydev.rest.client.BasicAuthClient
+
+
Construct a new client.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-3.html b/src/main/resources/doc/index-files/index-3.html new file mode 100644 index 0000000..a646ab9 --- /dev/null +++ b/src/main/resources/doc/index-files/index-3.html @@ -0,0 +1,190 @@ + + + + + +C-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

C

+
+
clone() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Clone this request.
+
+
close() - Method in class com.rallydev.rest.client.HttpClient
+
+
Release all resources associated with this instance.
+
+
close() - Method in class com.rallydev.rest.RallyRestApi
+
+
Release all resources associated with this instance.
+
+
CollectionUpdateRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to update a collection.
+
+
CollectionUpdateRequest(JsonObject, JsonArray, boolean) - Constructor for class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Create a new update request for the specified collection and values.
+
+
CollectionUpdateRequest(String, JsonArray, boolean) - Constructor for class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Create a new update request for the specified collection and values.
+
+
CollectionUpdateResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from updating a collection.
+
+
CollectionUpdateResponse(String) - Constructor for class com.rallydev.rest.response.CollectionUpdateResponse
+
+
Create a new collection update response from the specified JSON encoded string.
+
+
com.rallydev.rest - package com.rallydev.rest
+
+
Provides the main interface to the Rest API.
+
+
com.rallydev.rest.client - package com.rallydev.rest.client
+
+
Provides the underlying http client implementations.
+
+
com.rallydev.rest.request - package com.rallydev.rest.request
+
+
Provides objects for encoding requests to the Rest API.
+
+
com.rallydev.rest.response - package com.rallydev.rest.response
+
+
Provides objects for parsing responses from the Rest API.
+
+
com.rallydev.rest.util - package com.rallydev.rest.util
+
+
Provides utilities for working with the Rest API.
+
+
create(CreateRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Create the specified object.
+
+
CreateRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to create an object.
+
+
CreateRequest(String, JsonObject) - Constructor for class com.rallydev.rest.request.CreateRequest
+
+
Create a new create request with the specified type and values.
+
+
CreateResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from creating an object
+
+
CreateResponse(String) - Constructor for class com.rallydev.rest.response.CreateResponse
+
+
Create a new create response from the specified JSON encoded string.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-4.html b/src/main/resources/doc/index-files/index-4.html new file mode 100644 index 0000000..240383b --- /dev/null +++ b/src/main/resources/doc/index-files/index-4.html @@ -0,0 +1,154 @@ + + + + + +D-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

D

+
+
delete(DeleteRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Delete the specified object.
+
+
DeleteRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to delete an object.
+
+
DeleteRequest(String) - Constructor for class com.rallydev.rest.request.DeleteRequest
+
+
Createa new delete request for the specified object.
+
+
DeleteResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from deleting an object
+
+
DeleteResponse(String) - Constructor for class com.rallydev.rest.response.DeleteResponse
+
+
Create a new delete response from the specified JSON encoded string.
+
+
doDelete(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Perform a delete against the WSAPI
+
+
doGet(String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Perform a get against the WSAPI
+
+
doPost(String, String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Perform a post against the WSAPI
+
+
doPut(String, String) - Method in class com.rallydev.rest.client.HttpClient
+
+
Perform a put against the WSAPI
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-5.html b/src/main/resources/doc/index-files/index-5.html new file mode 100644 index 0000000..8bb31b2 --- /dev/null +++ b/src/main/resources/doc/index-files/index-5.html @@ -0,0 +1,126 @@ + + + + + +F-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

F

+
+
Fetch - Class in com.rallydev.rest.util
+
+
Represents a list of fields to be returned in responses from the WSAPI.
+
+
Fetch(String...) - Constructor for class com.rallydev.rest.util.Fetch
+
+
Create a new fetch with the specified fields.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-6.html b/src/main/resources/doc/index-files/index-6.html new file mode 100644 index 0000000..f29e8a1 --- /dev/null +++ b/src/main/resources/doc/index-files/index-6.html @@ -0,0 +1,278 @@ + + + + + +G-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

G

+
+
get(GetRequest) - Method in class com.rallydev.rest.RallyRestApi
+
+
Get the specified object.
+
+
getBody() - Method in class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Get the JSON encoded string representation of the object to be updated.
+
+
getBody() - Method in class com.rallydev.rest.request.CreateRequest
+
+
Get the JSON encoded string representation of the object to be created.
+
+
getBody() - Method in class com.rallydev.rest.request.UpdateRequest
+
+
Get the JSON encoded string representation of the object to be updated.
+
+
getClient() - Method in class com.rallydev.rest.RallyRestApi
+
+
Get the underlying http client implementation.
+
+
getErrors() - Method in class com.rallydev.rest.response.Response
+
+
Get any errors returned in the response.
+
+
getFetch() - Method in class com.rallydev.rest.request.CollectionUpdateRequest
+
+
Get the current list of fields to be returned on the updated object.
+
+
getFetch() - Method in class com.rallydev.rest.request.CreateRequest
+
+
Get the current list of fields to be returned on the created object.
+
+
getFetch() - Method in class com.rallydev.rest.request.GetRequest
+
+
Get the current list of fields to be returned on the retrieved object.
+
+
getFetch() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the current list of fields to be returned on the matching objects.
+
+
getFetch() - Method in class com.rallydev.rest.request.UpdateRequest
+
+
Get the current list of fields to be returned on the updated object.
+
+
getGsonBuilder() - Method in class com.rallydev.rest.request.Request
+
+
Get the Gson Builder used for JSON serialization in this request.
+
+
getLimit() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the maximum number of records to be returned from the query.
+
+
getObject() - Method in class com.rallydev.rest.response.CreateResponse
+
+
Get the created object.
+
+
getObject() - Method in class com.rallydev.rest.response.GetResponse
+
+
Get the retrieved object.
+
+
getObject() - Method in class com.rallydev.rest.response.UpdateResponse
+
+
Get the updated object.
+
+
getOidFromRef(String) - Static method in class com.rallydev.rest.util.Ref
+
+
Get the ObjectID from the specified ref url
+
+
getOrder() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Set the order by which the result set will be sorted.
+
+
getPageSize() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the page size of the result set.
+
+
getPageSize() - Method in class com.rallydev.rest.response.QueryResponse
+
+
Get the page size of the results
+
+
getParams() - Method in class com.rallydev.rest.request.Request
+
+
Get the list of additional parameters included in this request.
+
+
getProject() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the project which the result set should be scoped to.
+
+
getQueryFilter() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the filter by which the result set will be narrowed down.
+
+
getRelativeRef(String) - Static method in class com.rallydev.rest.util.Ref
+
+
Create a relative ref url from the specified ref
+
+
GetRequest - Class in com.rallydev.rest.request
+
+
Represents a WSAPI request to retrieve a specific object.
+
+
GetRequest(String) - Constructor for class com.rallydev.rest.request.GetRequest
+
+
Create a new get request for the specified object.
+
+
GetResponse - Class in com.rallydev.rest.response
+
+
Represents a WSAPI response from retrieving a single object.
+
+
GetResponse(String) - Constructor for class com.rallydev.rest.response.GetResponse
+
+
Create a new get response from the specified JSON encoded string.
+
+
getResults() - Method in class com.rallydev.rest.response.CollectionUpdateResponse
+
+
Get the results of the collection update
+
+
getResults() - Method in class com.rallydev.rest.response.QueryResponse
+
+
Get the results of the query
+
+
getServer() - Method in class com.rallydev.rest.client.HttpClient
+
+
Get the current server being targeted.
+
+
getStart() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the start index of the result set.
+
+
getStart() - Method in class com.rallydev.rest.response.QueryResponse
+
+
Get the start index of the results
+
+
getTotalResultCount() - Method in class com.rallydev.rest.response.QueryResponse
+
+
Get the total number of objects that matched the query
+
+
getTypeFromRef(String) - Static method in class com.rallydev.rest.util.Ref
+
+
Get the type from the specified ref url
+
+
getWarnings() - Method in class com.rallydev.rest.response.Response
+
+
Get any warnings returned in the response.
+
+
getWorkspace() - Method in class com.rallydev.rest.request.QueryRequest
+
+
Get the workspace which the result set should be scoped to.
+
+
getWsapiUrl() - Method in class com.rallydev.rest.client.HttpClient
+
+
Get the WSAPI base url based on the current server and WSAPI version
+
+
getWsapiVersion() - Method in class com.rallydev.rest.client.HttpClient
+
+
Get the current version of the WSAPI being targeted.
+
+
getWsapiVersion() - Method in class com.rallydev.rest.RallyRestApi
+
+
Get the current version of the WSAPI being targeted.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-7.html b/src/main/resources/doc/index-files/index-7.html new file mode 100644 index 0000000..75d60ce --- /dev/null +++ b/src/main/resources/doc/index-files/index-7.html @@ -0,0 +1,122 @@ + + + + + +H-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

H

+
+
HttpClient - Class in com.rallydev.rest.client
+
+
A HttpClient implementation providing connectivity to Rally.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-8.html b/src/main/resources/doc/index-files/index-8.html new file mode 100644 index 0000000..3d17aef --- /dev/null +++ b/src/main/resources/doc/index-files/index-8.html @@ -0,0 +1,130 @@ + + + + + +I-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

I

+
+
isRef(String) - Static method in class com.rallydev.rest.util.Ref
+
+
Determine whether the specified string is a valid ref url.
+
+
isScopedDown() - Method in class com.rallydev.rest.request.QueryRequest
+
+
If a project has been specified, get whether to include matching objects in child projects in the result set.
+
+
isScopedUp() - Method in class com.rallydev.rest.request.QueryRequest
+
+
If a project has been specified, get whether to include matching objects in parent projects in the result set.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index-files/index-9.html b/src/main/resources/doc/index-files/index-9.html new file mode 100644 index 0000000..dd6835e --- /dev/null +++ b/src/main/resources/doc/index-files/index-9.html @@ -0,0 +1,126 @@ + + + + + +O-Index (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
A B C D F G H I O Q R S T U W  + + +

O

+
+
or(QueryFilter) - Method in class com.rallydev.rest.util.QueryFilter
+
+
Get a query filter that is the ORed combination of this filter and the specified one.
+
+
or(QueryFilter...) - Static method in class com.rallydev.rest.util.QueryFilter
+
+
Get a query filter that is the ORed combination of the specified filters.
+
+
+A B C D F G H I O Q R S T U W 
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/index.html b/src/main/resources/doc/index.html new file mode 100644 index 0000000..c9f8896 --- /dev/null +++ b/src/main/resources/doc/index.html @@ -0,0 +1,67 @@ + + + + + +Rally Rest API for Java 2.2 + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/src/main/resources/doc/overview-frame.html b/src/main/resources/doc/overview-frame.html new file mode 100644 index 0000000..0d5998e --- /dev/null +++ b/src/main/resources/doc/overview-frame.html @@ -0,0 +1,24 @@ + + + + + +Overview List (Rally Rest API for Java 2.2) + + + + + + +

 

+ + diff --git a/src/main/resources/doc/overview-summary.html b/src/main/resources/doc/overview-summary.html new file mode 100644 index 0000000..3e6c8f7 --- /dev/null +++ b/src/main/resources/doc/overview-summary.html @@ -0,0 +1,155 @@ + + + + + +Overview (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Rally Rest API for Java 2.2

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.rallydev.rest +
Provides the main interface to the Rest API.
+
com.rallydev.rest.client +
Provides the underlying http client implementations.
+
com.rallydev.rest.request +
Provides objects for encoding requests to the Rest API.
+
com.rallydev.rest.response +
Provides objects for parsing responses from the Rest API.
+
com.rallydev.rest.util +
Provides utilities for working with the Rest API.
+
+
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/overview-tree.html b/src/main/resources/doc/overview-tree.html new file mode 100644 index 0000000..074e018 --- /dev/null +++ b/src/main/resources/doc/overview-tree.html @@ -0,0 +1,181 @@ + + + + + +Class Hierarchy (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + + +
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/package-list b/src/main/resources/doc/package-list new file mode 100644 index 0000000..b4b74a7 --- /dev/null +++ b/src/main/resources/doc/package-list @@ -0,0 +1,5 @@ +com.rallydev.rest +com.rallydev.rest.client +com.rallydev.rest.request +com.rallydev.rest.response +com.rallydev.rest.util diff --git a/src/main/resources/doc/resources/background.gif b/src/main/resources/doc/resources/background.gif new file mode 100644 index 0000000000000000000000000000000000000000..f471940fde2f39ef8943a6af9569bcf986b1579b GIT binary patch literal 2313 zcmV+k3HJ6!Nk%w1VKM-40OkMy00030|NlK(aXwsfKV5S}VtGJbbVOr%L0@%CZH88Q zl{{NzcR^uxNo<2iYk@pjY)*5FJz8x~bc{)B zfk z+1T6M-s9WdW8dcJ-wO*3@9+W*5AY543-j^$^!EPz_4eHZ2#>)41`h@dc!2OAgN6$a zCS2I?;lqgx6IR4nkpTe;1RN0f=zxMq2O=q`94V5d$&e>Unta)^<;;^G3>e7yp=ZvW z6DIW3xpSvaogXF?_4%`@(V;s}NR^5J!3hrtJV@1QRV&r5S*L!zYE|rss${iFkg&!? zTN5V#)~=bmMorwgZsEpdOE)iExo+FO-8;8Kga{=HbSQCnF=E6W3?o*|ID%uwi5**> zJXy127Y9m+=HQ|PhXWi+xNwoWv}n_%Pq%(e+H~mGqhq5kv4Mo|-n~g|7!F*xZ{xv< zCpXS~dGg^IGK?4@J-T%b(XnUHFul6n<@2&4)zzyO2) z3Q8`i0+UKY*`$}e9mmp;tg*))`|PsK1|hAo%u0K$vDwm4gaSkm0j{`26k#qAKmbuhxZ#cquDR>B zD{s8+&TH-uNg$C#68QG}1HMBHfrP&L@@w$F_!itRzXdCN@V|LDAu%3!IDtq1#1UV7 z#1RxvT=B(DWbCoU5l=ia$Pp`Hgb_?Mp@hmtxZDI2N-)v#$}PXVvdm1d>@v(v`0TUJ zF)Pu89(q`zv=w^nVTIF3@3BYIPA}c`(@ZCAwbNBEt@PDUKe5CTR8aB66IE1!w%Amt zy+jpcn~k>GZpVFg+H6x{_uOksvBlq0OyT$6TyQZ37k(cOxZr|JEx1sGm<(M9gH z-~PMqyn|tT=))UN`|-FFFUA#KToK0fUOaz=7}Z~KeHhVC&%O27cTfHQ^WBU8z4p&T zp#>D|V}XShTD;Hx745Iz{`>K-Z$A|7!*Boo{mY;G21vjH8t{M!OrQc6$iN0V@PQDF zpadsK!3tXNf*8!81~qnXWuHZ)kytd=_y+ADWvw31ouV;CdZ#ya*(l7-A-C-Y^+iit8O zBy3*`Ls$|5Hn4m_^I^|C7{m7EFn|5vTk;|oywIgCc9Bb*=L+Y$)M>9GC<|HGs@6NB zHLY%03!dDf=eDRt2O6lVSFRcsuWZEwU?=z$CZ0W?#VJfdN>HG(l%oKpyiftJc|Y)xkjSJYCrQal-0PC~()T9xwF!Jf zVi1UA#3BBbh(i8r5&v#Pz!cF41KjbCc?4u2@@Q~oKLirt2TM30;y6b+zyX2`Yl9u; z`0$3;v0-YUp&7NdPT#q`cZlbij$jvbRk6R>8g*>}*b9E+WDwmpHAAxYzyT aU_pX{M6b8i>#Dq3onfZy}_nli%!Q$ZV%e&!tN2 zX3B0NWXQ443Eo1rUP86rLU>O>oTp%wt3Z{Tz&P*)Iraq^_@X;RtUFY!JxH|4U!>kw zxXwqo&R3Y=EsXaR!ng@y+y$%L1P3FZ4@N!j3m5MW74HcC->_JFuvlxLXiI=-OQ2|@ zpGc#>2-aN)<1RE9^`bB0`65VSK2>5m>CHs^YZCC)NX*NfbeT1%)Cxpu2_(6cCbLvjLY`hf1%*q}QO*%V4SfOu5Nqg~`-+(-76= za<`RA&(qDB^S!nIS^od5|Nk$KPXD8(qSB!f`M*{E?A^&yOW$08V^iNPK!%UNJ-@xmz>`pG2_%4I3QWk4UdtwP!GH$C%mo2K|$Ap=_)Y!#O($1@ohsUtR1k%wI*) z4*X&g==oWh`j{uP=HFm;Ye>0>UbDdtSp^~MaQ!L9I#)Ga?q}{@T#|qec*FkMLDenm zj^sCgk!^O^3o|vG!~2$$$7`C#4Ry zdQ!tui+J1*HyavK+4{`r+zvYHj9IsRt~@uEBOreWS8~2rXAR3!|7aTdr+x4|>@$Az z)b1t$gSB~6USxpfLmy^|_J_eNt*PI=ScO1SVH895N#`ef%IOh&o-2GIjK1s-JzkyZ z@r7O%hChz}kMHCM@Wqi^R-9t&%Fh^#9dVB0%ej@$=OjXA%XZdzCXf}c>SW26_z-Te z5b{}XWg&rELM=N*%aimp)k04t2c+`WAS>ZFIPWKvtyOI))HzpRA!T!b{tv?4NzF1v zNlP%#{&p@lFFEKvcroMAsI)mq?&`!e%l+-y&j9ZqhN}oG&dB=Pw09r+Q%m0cMujS# zs$a7!9VH`CC7k{!bV(J`rm%Jpj6&nLtWhPcy$onn$8G#ZdD9hxO<9k67Ya>K_7W~3 z&KYf14fq<{qHA7u6;>AOcomhdg?ianjr9uINt}*7w?g%z9{Q`(qRo@hDwSpGmxz&h&>%G%T(URL~=c>C{>y$K?+wLFp zy*M1@FTUKYV>8DeDIAIKM+!T5c-k&C4?Y~y^E zQCIc-=9~DiPtfVZB=_c3`qH3h|NXd^BcOQG`funSe)i5!NoA_r{b6PwzSDIXG+!(F z9CqJgo&~#7^VZHWj{u23q+NDCHn}GeWDC*(SW%{f4WMtP3l2jsO7*M)EX)#NLlsNnU4q@#jn0r#rsWsf^ngE0&ambG1f;Rj zfOk#_>1|25Z%?iI{0Yv8)DQfk>m1td?~}m0N%^k^u%EuUCc#ItmlY|epQ3YLWehYw zRU0qpPb#X&WU*UOU8et(s8x~WyYWYsgJCF+;U6@*nICY8)dk}IG+(#_Bz8zURd3HZ6qPE68U1%S{wL0 z;K{PDw2iRFIGG?(UiE9kT9?siuv4O{ z`dX2-eiXU3N)H2nT4V=AO^~J}sw+gr{&~qx%$$wlMv_JCWAMfcjYl}*Cfcf!adOY8 z8oLmJ{%49e+nLiVo#H9}wRk?UCzDz^>9TDxreVHzl~R*)?YU>Uu;J2eQ27O5`&X^8 z`94{)YWJQa#l0Fbz0N6B>j&8J;<%VuG6OYM9&QIdtueWjI3X;*dEtGiF@1AcvN4U> zG5SXIEXxB>)!mtQOztJLyeF78S*kLiU-!>PtQ_s~OMl~&y(hVVe$A5 zwo}E-DJ6${QP75?LsQ}Wl@MXwXMT4d>|?rD!g?jE>J^N*y;X}5FLe%d0_ zZ>eIBK6l@jkfw{p_YiDP;MS{jww{%j#?rk2z1J!HqE;Vd!TrCl_7UPef8;edI}wD6 zT&12Bxj&q}d4%$GHq+$~UYtWv`wI9k`89oKkCEK_E;-+O)(rhThjOM|kXDn{!W1Lo z`_?yQv=lp=-w()R<=0&c5%RWHY_fw@qb}uwFuPAGkl~@Kis}eE%MY@~6ZyWcF+llM zGyK`)(vn1F%%z=W7-Y=1$`w0Mv+-|#d};%JjCmw)Y1hOxwA|{}P%6LS4X`jQCGh`mR@=hGrr|cXa^Ipj;Mh)6mTqd1s_HmP0IxXT!w7YhoIHT>Hm#!;c@|L9OjV zsTlHE{Z;HWeM9^tPm-`|&nnl$%DRtNG1~?npUvgKPwKlaccEe4q!7YU3zykJnu6Sr z()LMXs_)^~u-ds7+wMff)RAJF?2?1H`_wDnt%MssYeB5;q~ojgVm6OHA6B>FG2erv z8&`|6<`=!EPKR^8Qlp5MiKwfxy4D`mN> ze$RKh_6*YJd4y0nnUZvwN%iY&^9xk@cM|5g#pZkc#N*(PH?^w&?ilTDMXFcd0`5!E zvgHS`=Lc|~1aO=L@L~eE*aP{90lc7qXY7GOs)3JH14T{(`K1D%tpvUT1-?F^1d4_S zJ#7yXkP3Q37bJlRQfv=mV-J3B8O*m5B%L3uW)S>|Jwy`|s6iK`sv0Z-3NcU(0knrG z5ChFXA@A9PUSdLI+(VU!!J1Mbw!~0VP^jZci2X|Nx0BF!24ObrAr>b=QtlyN4TAhn z!mQncJm~^m4MIafVLt_ewDUtO+e5w*!`(6A&H^F7i9s4t5&uBpNvh$nlTZjqTM5krNRRQ zqP)VR!|9@H>7qN_!+-)&_9s!^;gOvy5s~iEB&qP8{77&2NJMzZcsnJgSt_bYDzYU% zxQ#uuk3D*e7_*d5^?HW(^(WxICGf-mcmM((VStzIz%zFsm0;ZI3h=5OciJ#a%7I(IeGbFv+PP^?^sKBPrRBl<+qK^o%3fi=L9`la>-l4~p|hzAl~W zf=%(|NHgF7r5dJD+Cf08q-c(m;Epsldaz4cqHzTHT>)4xEe(cE0i~tf{Y0xs_1~Kv z+BYQ-TpEOch13;5YC9nHYEXhSv{ew=LV~nQL%UBQEgaDL2m?9u~v zEQmOvM=aB)Z$+eE38rs%AZR_)4>@2raqwH#Fji#xoLc&PS_TU^W8W(M0GqLdO~1yF z{sfHZ_sC#FX58(}d>RSkKZCz8%D7{cC3Z$Zh@52{31&V*W-@s~Z<8~aBeNcNW?e&O zsR(7fHOf}B&fsRqdZ(WK1e~s*o^uD6{YX9QJvqyWAqQXt*E>r$V94YK=X@8+{1cg> z*_i`a%alCJvbD~lCg&Q1Gk=|BzY)sejf9EHJ{s7lu4?ExCWR3jgTiET;exy{sW!Mg zuj*_YOf0@ScN~X0$7V6&KpL172rf|rA8?K<2+GelXw)NUk#@b4aT5MO%1ip4*ym}B-JI__S1R?CK z<4eW~bH;@H@tR55x}&JNSw_NvEPk)6E>XDt7*)4sgWuw+_vNZzmaS(tsi(57zcjA9 z@~XcHtzYq~IX|z*Md9mh>W~`sk3<^s7;EmyH4wcTdAo5NkUA2ofeG69{Gx7#i_*lt zQ7;N@xEo#nNRj&SbDHNnP0w#OE0{DZ$~7ySG%IN~zwd5Vu4&dnH>*OMb>&*VL^tbA zG;7y1t9dsYU$p3pw0x6mwGe6fjBYWsZ8e3q8f~-~cefgHxBangajI$kv(c*W-DZGp zbM$UgnP{_MYPXYX|6$u^deIhE(-xuGX2RVXqS+o~(iSV%;ZW1=Zqkut(r&xak^pT> zsp*I@X|-eOd^gb+sM(%3(E$|c47Y91mTU99Xe;4vFOTl5gmwVB+fvc3n2pwK?~Xd# zwrY{?CUj@~Msr?wXU0WKv2A$hq z`$V^gNq4(<*C=;4e4}$*uIC$5&uUHkM08J~N$>VV*VpdmLCuc!?!J9=-)VH;fo9)| zNN4m#^Kb9|`RF!^ZAT-z=bC8$do8~Tjc^o-aQjyc2(TW*d50E1#NW0pKb^~tf&OUlS+W}>0!m@!~1 z&TdSLhm`0u99c-z=oxYL8IFaGCDoFwFUP!1iJ%xF1UC4hhv*VR2451Pc0+kQGC)39C5 za81oV=$+xzZNYhn=RB-CTZ>Bevj)A3mi9|OS(dcy=N#Zm=Dza|z4Jd<=3IQ2CB>FiwH7{4Ej#+oa>M67 z!56)Km&2xJ|H7B;%~rJDuJ{rbZQiaX*e^$DEt~T$#h9(y#jg6>uX?boq!N}Q;EQth zYo1rjc15dETPw~*Ymu=lreoE9g^wb)ZcRe1yp1(Eo(rmqUYZXOU$BC_| zX{{&qE?E06wXm#v#cpKwE)jaydSaI`TkCCClr_lKMzPkyFT!R%VRn&sZSrchKx&4e~pJQcfViQxxl=T=7}#gYz7Pvoh`T#Jbab%2A2m zxh?A<`}A?8_GumBEcL;$x%gQb@PZ(If%ZE~D?ax#Km4a~+GV~!;Bb~qxxh@HHc|H6 zr%$^c9Dw~UQFWJv+81rCXS1vqqLfQ~-BtO63xCArGVA4T-}xPXYGHqB5h^+n5%$24 z(BROpi13J@*qFfR$oRMHel`=(zy zovs-UKHD3VkJ?hVeq!aA+8Fh4+NIlFhcC~UrR{4I#}K*u&z%68+P1*=q0B1r*2MY> z!9gYs*vlTO5v#8S>c#3goFmp>3iVKdU)NkjNV(s7tO4Wq?2M}o5Cj-*7;S=fEshOA zR*4$dm{ROvUamG%xL_tSW6}U$Nl=@91T;nC11o-iIVyVrfkd) zTCp;^tOy|_kuOFV$Nn=$AQJO9;&sZ&eDs^!r*m;Hw!)vpO1vcfj2EV{dJ?7ap0tq6 z$SwUVM*Vt+MS_`;bas-svPV|3POQi8G~?f^KOx4hg1He+Wd*s3Hl1{TfJS-+zv6vc zPoKiwr?7wECbub(IdB)9f_!kmUjBR*KY_z4E8_QA9xSr#G&@i5y^H`jB^I{|akh>W z%Cn3luOVY|8P>u>e^~#{$kmgX&-q>k{#pFbm2({(rtG<%nb0UCQ0%{Cy`F&~7}*we z@Of>ND_)V&XwN_+n~KjVorUQWZ*B6cld7ymQl{;rwlHl34K#}2YWxE+4CX@P&u6AfCda`&ZT1MOY69e-L@gNcAvwx8%1Z7lB4zc=_Cpt~&s ze%?;){1DB(PSK!^za967qF?lIjB~&06}Lf`cgh2qUiI^|$-VCTNE=hp&Ij}^A9&|* zQQrSqo3gn#_=z9j(y6f@T|OkJYv(fjwpz}$*U$|nLH2F zPNMuTS4g8 z*^hOlRh6~Mk}58;d477R>F^~aLO$dOXmhA*6zwIaHK()t2zKjo?j^NOJbh_=+71xg zO{Mgp7x?Z-1MKzoQ<+V2g#|e}|JawOPJZBL{o~PYdtWDX?jl##!Aiq|w>)vGJLipp zBK1xGhcvgSsQ;rn>+`>UmxlID{<~}7{y>SO^cyktN^Fsz!Z|B4?p*RKQG*8}SYBt{ zuFO{vJ?jgL{gUzYsnv(io}c0vlCp#*1vE?}KL^UZ&VF^TK+D;40CxX%j);%dCt;Z{ zAeMXC9JPWvKGwsCxx4w2iv_wNGG8l16AVI93rmc^c1>r(P||YE zpXa+=-&k995hfykL^J5S&vJF^ljR&`FE#ppNMM3%Omc!F)Mn{{&Ip#)JegbEJxud2 zn`wDVB~DMii5|H%m~51YeU1juNG3!+&?*uC#q@)z8q~`4yEL5I8}PtyA1IZ=52P$x zX)KhZt z7czUXBsy-8d`GVQ`90`wIh(Xt7v5j7h0t&ET~2M!Tb~4rN-xtK@8@mB*c(6QTwOS- z%9445_WY|cfm4?$nX$72&{~^mu}an^x^Da%=UU6YI;ur3+9L6I>raW5!=-Nzy(F2Z zwZlg7aM3NN5b{K|FB>s4R}|&Lr32_Ys{wwkECxo|rV@;5aHB25iUs7(6@dDpjN{Y%?C~UGp>*Q}K?)KKk64 zAn;@-dER}QG0L${jQ1cR75eM3-~ZTltTQ8%sm9x4Y`ve@ekMuvpA#Rh51@s6;6^&Q z!&M7^b%cea7FlZkPV9}@!bPBBfB&~XvGlE2T7V?IpM~OBmuK;OSt{~N`rL5c_I^de z9n*=@p|l;d`b_YIn8Aem1t7pp0=2-MCTIcJHlY z6x+mNLgi{JpwP)y(yzAFL2A#>bI&EwZE`PGvd*FQ!rx~6bUN&+Ij3)L;=595L#G;m8*^e?ap1`J5w7-q)*iUT_W9w8 z&xS-`i++HpWzY-a-)CWd0(pLW$A85P{Dy9r-=uPekNpN^yA}pJ7yWTZ>3iw4d6+IK zF%1XXkGcJm{0*vhSG5R1ySW;jctk9O==1-Mk?=Bl<{HE1p_@tx1s^+GoczYxj#B=i=kwQvEPrOt`<4W*pJw zbNjEqpr7B|Llc%m{V*QssV)im;pb00LUob=yFaU4`P_}ywU zt*QZl-bUsmh@L&zQaX4uHL&7YD(BOb9hH;;y;O-b-_O$4EFi1vCrMlz`dN|u?}HNO^aFQV{UZg_yy%nf>IXpulip!cR8|vNu7P*; zQye@}Qmj%(TB6`5E=c~w=LITF266XJ6X5xA7!OM1SE=~N*o3EP5Qqx!W<_+EMSLGo zqkC18AQ=0AK9=hgGQtrTovYc5^?Z^RLX?hlO-j&e1MXTTbfm>MS^=}!p>C>icUKdZ zBcNOb(6IJ!kq*e7N8Fx!!kPyn+2B2^2hd00+W^PUA&+S63jFE)bP5Tv+L5l~n(pu? zbeO|+K{{?pEow3?j0+dGVu)a6(0r{1Uj7{3 zxSsZ|BdMk>1-S}-;+`pk{Q5>H=tLRx+YqeenaSRsEX@gtPzz>j1A9g!C9kGtspY(- z%YL>NkVDE2z@}*;Q{=&5)yS;NupAmmibGUE4qte7aY6PcnXJgw>}ad(SW;@HtNurF ziV0_yHz=;Di%Tki6DW^tjkL`t%Ktct(ay zvuAOYoCu!Pm~@P5CIjk$bp`_iv{^l*Au{fB8mJK1>Macv?GL)**8*+JNvySIH5Y7i#1;!%NT!efc z;Z0*AOM&1VpR+6wIQxBM{xf`8T1V@#e<#QL}=YRwMkWG8%1(Fgj{iX)N zup{Txko(DqJWf=#Oi?Z!nra-?C{);TP`w|4>L+EKx1&P3swX<*#_50F!lD_$nQyuK??!UwA-{y)^QmMxoK1xIJ~uML{u;5!Z5tQyEL>;KaUd!_9FP zl2$QOI6V1`QdF|8gkdZsSpUqCjSBu(1H)r*vL#PEy)@Px>5TIk7_9o#Bj zzD&<1_k(ejk%qO6ak=GMmG5b7LTAA^KKq-Ey#z8(2wy2;Ot^oZI(MG@)~iY$RAnJt zu`ioyvR?Vws_tuK9hDqmel+)bP0kyxJV{7t=&3{b(@Hs1fs$9n45aq)IKknZa2H*7 z^P-ZDyOMdMj&-9{(-?dqo5I3Gy=K$!L%q>3^0N~o^2i0^_@^2nQv>S4B&=5_8^a^V zaY!NjyA5QgO&r#^CJcp&=!))MZ*CC&hvLEzWU*!IO=aYo{_yG+53H$XOAIQWnG`uD zLuuwTY6e8N^m5^AHQa}Y5Z#SdbEY;+x{oW?g;ie4CNYomRyQd2mv^L}T!>a5<*wTh>@>Qtwp~nejn`~DcZJI+QC-xU zoxz=5z0k%1;jBrGI%Th~FQElrAPr?E-Fv9|o09dPk=?>f)jFKL8PK|;w(cVDq>YWP zEfL7RGBv|<>f4IccND3wCi*V8`>#a$FPZu&a{V`W`me+Kuf_CJ)%IV%?5ByL^#3Q{ z&uBM5|34IKI>0_Tz{5OngXe#6w*N6;;5PH%9n%56%RaWA{wJ4%515Apdj`a62bp<> zM12OuV+QZ^55ATkViO(UWgg}%9C}kb^r~=BiDyWIXZWM&kb>Q?dd$#W`4KU|2#4qh zz;sZ>ZqS5h#Kdk$&1c9AHmDUdtmHE)CqH0RIAZEE;t(^+RXF+*FlJyk;?6Vn{&MsO zZ0HwY)b4Va!F1#s^N5$-s9(&mPa*Lu4>4SxXm~l|3?PR2jB1J!Q|(4#0i$lFME^-r zA~Q(2O+PHOdcVN((R8zqi>%+yx4PA5u&+jI zZ?)Fm8m-+`n!Bnrx0PvZE7!Q)Z+NTE@K(R!nO40sZF(n~bq_b_9H`UYU#q>pPJ3UC z_UeU>J7qcy%%`ks9)BNcS^GDOn z?oKkjHNoWO1e2?M#vd12e^_AscAnLnc~-CISiYWX`D%{k^H~<37unpMYJYdSv=Om2vbAM@`Qp{{SI=yP zj6WN*eEt0G$9EPX6FU%)-ho>hWTW!yzXBIo73<0umM-=@eG&niY^` zlG(|vuCl_x(X^Fob@=i{8+M5vWf7Bz=#aHGTNA;fZQyfbfueI8Z^639n`(DI%w^-^ zl`=@!u)r~Xf920-xd$Ab+S&PJY%K0H8a_J8uN3^_!K1_NV$*e#*Y*6|)XpiW=9H`*`Xx7W%v@7{XDma1?v0a%(K6rI&1!a YpWXKgmku8Vj|K)Vje`mzEKCg608Q#dYybcN literal 0 HcmV?d00001 diff --git a/src/main/resources/doc/serialized-form.html b/src/main/resources/doc/serialized-form.html new file mode 100644 index 0000000..49ad6f5 --- /dev/null +++ b/src/main/resources/doc/serialized-form.html @@ -0,0 +1,128 @@ + + + + + +Serialized Form (Rally Rest API for Java 2.2) + + + + + + + +
+ + + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + + + + +
+ + + + diff --git a/src/main/resources/doc/stylesheet.css b/src/main/resources/doc/stylesheet.css new file mode 100644 index 0000000..0aeaa97 --- /dev/null +++ b/src/main/resources/doc/stylesheet.css @@ -0,0 +1,474 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ +body { + background-color:#ffffff; + color:#353833; + font-family:Arial, Helvetica, sans-serif; + font-size:76%; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4c6b87; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4c6b87; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-size:1.3em; +} +h1 { + font-size:1.8em; +} +h2 { + font-size:1.5em; +} +h3 { + font-size:1.4em; +} +h4 { + font-size:1.3em; +} +h5 { + font-size:1.2em; +} +h6 { + font-size:1.1em; +} +ul { + list-style-type:disc; +} +code, tt { + font-size:1.2em; +} +dt code { + font-size:1.2em; +} +table tr td dt code { + font-size:1.2em; + vertical-align:top; +} +sup { + font-size:.6em; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:.8em; + z-index:200; + margin-top:-7px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + background-image:url(resources/titlebar.gif); + background-position:left top; + background-repeat:no-repeat; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:1em; + margin:0; +} +.topNav { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.bottomNav { + margin-top:10px; + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.subNav { + background-color:#dee3e9; + border-bottom:1px solid #9eadc0; + float:left; + width:100%; + overflow:hidden; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding:3px 6px; +} +ul.subNavList li{ + list-style:none; + float:left; + font-size:90%; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; +} +.navBarCell1Rev { + background-image:url(resources/tab.gif); + background-color:#a88834; + color:#FFFFFF; + margin: auto 5px; + border:1px solid #c9aa44; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader h1 { + font-size:1.3em; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 25px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:1.2em; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:1.0em; +} +.indexContainer h2 { + font-size:1.1em; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:1.1em; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:10px 0 10px 20px; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:25px; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #9eadc0; + background-color:#f9f9f9; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:1px solid #9eadc0; + border-top:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; + border-bottom:1px solid #9eadc0; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.contentContainer table, .classUseContainer table, .constantValuesContainer table { + border-bottom:1px solid #9eadc0; + width:100%; +} +.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table { + width:100%; +} +.contentContainer .description table, .contentContainer .details table { + border-bottom:none; +} +.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{ + vertical-align:top; + padding-right:20px; +} +.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast, +.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast, +.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne, +.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne { + padding-right:3px; +} +.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#FFFFFF; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + margin:0px; +} +caption a:link, caption a:hover, caption a:active, caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { + white-space:nowrap; + padding-top:8px; + padding-left:8px; + display:block; + float:left; + background-image:url(resources/titlebar.gif); + height:18px; +} +.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { + width:10px; + background-image:url(resources/titlebar_end.gif); + background-repeat:no-repeat; + background-position:top right; + position:relative; + float:left; +} +ul.blockList ul.blockList li.blockList table { + margin:0 0 12px 0px; + width:100%; +} +.tableSubHeadingColor { + background-color: #EEEEFF; +} +.altColor { + background-color:#eeeeef; +} +.rowColor { + background-color:#ffffff; +} +.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { + text-align:left; + padding:3px 3px 3px 7px; +} +th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { + background:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + text-align:left; + padding:3px 3px 3px 7px; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +td.colFirst, th.colFirst { + border-left:1px solid #9eadc0; + white-space:nowrap; +} +td.colLast, th.colLast { + border-right:1px solid #9eadc0; +} +td.colOne, th.colOne { + border-right:1px solid #9eadc0; + border-left:1px solid #9eadc0; +} +table.overviewSummary { + padding:0px; + margin-left:0px; +} +table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, +table.overviewSummary td.colOne, table.overviewSummary th.colOne { + width:25%; + vertical-align:middle; +} +table.packageSummary td.colFirst, table.overviewSummary th.colFirst { + width:25%; + vertical-align:middle; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:.9em; +} +.block { + display:block; + margin:3px 0 0 0; +} +.strong { + font-weight:bold; +} diff --git a/src/main/resources/examples/com/rallydev/rest/CollectionAddExample.java b/src/main/resources/examples/com/rallydev/rest/CollectionAddExample.java new file mode 100644 index 0000000..70617c4 --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/CollectionAddExample.java @@ -0,0 +1,63 @@ +package com.rallydev.rest; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.rallydev.rest.request.CollectionUpdateRequest; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.response.CollectionUpdateResponse; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; + +import java.io.IOException; +import java.net.URISyntaxException; + +public class CollectionAddExample { + + public static void main(String[] args) throws URISyntaxException, IOException { + + //Create and configure a new instance of RallyRestApi + //(Server, username, password and proxy settings configured in Factory) + RallyRestApi restApi = RestApiFactory.getRestApi(); + + try { + //Get a story without any tags + System.out.println("\nQuerying for stories without tags..."); + QueryRequest storyRequest = new QueryRequest("hierarchicalrequirement"); + storyRequest.setQueryFilter(new QueryFilter("Tags.ObjectID", "=", "null")); + storyRequest.setFetch(new Fetch("FormattedID", "Name", "Tags")); + + QueryResponse storyResponse = restApi.query(storyRequest); + JsonObject story = storyResponse.getResults().get(0).getAsJsonObject(); + System.out.println(String.format("Found: %s - %s", story.get("FormattedID").getAsString(), story.get("Name").getAsString())); + + //Get a tag + System.out.println("\nQuerying for tags..."); + QueryRequest tagsRequest = new QueryRequest("tag"); + tagsRequest.setFetch(new Fetch("Name")); + QueryResponse tagsResponse = restApi.query(tagsRequest); + JsonObject tag = tagsResponse.getResults().get(0).getAsJsonObject(); + System.out.println(String.format("Found: %s - %s", tag.get("Name").getAsString(), tag.get("_ref").getAsString())); + + //Add the tag to the collection + JsonArray tagRefs = new JsonArray(); + JsonObject tagRef = new JsonObject(); + tagRef.addProperty("_ref", tag.get("_ref").getAsString()); + tagRefs.add(tagRef); + + //Update the collection + CollectionUpdateRequest storyTagCollectionAddRequest = new CollectionUpdateRequest(story.getAsJsonObject("Tags"), tagRefs, true); + storyTagCollectionAddRequest.setFetch(new Fetch("Name")); + CollectionUpdateResponse storyTagCollectionAddResponse = restApi.updateCollection(storyTagCollectionAddRequest); + if(storyTagCollectionAddResponse.wasSuccessful()) { + for(JsonElement addedTag : storyTagCollectionAddResponse.getResults()) { + System.out.println(String.format("Added tag: %s - %s", tag.get("Name").getAsString(), addedTag.getAsJsonObject().get("_ref").getAsString())); + } + } + } finally { + //Release resources + restApi.close(); + } + } +} diff --git a/src/main/resources/examples/com/rallydev/rest/CollectionQueryExample.java b/src/main/resources/examples/com/rallydev/rest/CollectionQueryExample.java new file mode 100644 index 0000000..91c31df --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/CollectionQueryExample.java @@ -0,0 +1,56 @@ +package com.rallydev.rest; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; + +import java.io.IOException; +import java.net.URISyntaxException; + +public class CollectionQueryExample { + + public static void main(String[] args) throws URISyntaxException, IOException { + + //Create and configure a new instance of RallyRestApi + //(Server, username, password and proxy settings configured in Factory) + RallyRestApi restApi = RestApiFactory.getRestApi(); + + try { + //Get a story with defects + System.out.println("\nQuerying for stories with defects..."); + QueryRequest storiesWithDefects = new QueryRequest("hierarchicalrequirement"); + storiesWithDefects.setQueryFilter(new QueryFilter("Defects.ObjectID", "!=", null)); + storiesWithDefects.setFetch(new Fetch("FormattedID", "Name", "Defects")); + QueryResponse storiesWithDefectsResponse = restApi.query(storiesWithDefects); + JsonObject story = storiesWithDefectsResponse.getResults().get(0).getAsJsonObject(); + System.out.println(String.format("Found: %s - %s", story.get("FormattedID").getAsString(), story.get("Name").getAsString())); + + //Inspect the defects collection + JsonObject defectInfo = story.getAsJsonObject("Defects"); + int defectCount = defectInfo.get("Count").getAsInt(); + System.out.println(String.format("\nTotal defects: %d", defectCount)); + + //Query the defects collection + QueryRequest defectRequest = new QueryRequest(defectInfo); + defectRequest.setFetch(new Fetch("FormattedID", "Name", "State", "Priority")); + + QueryResponse queryResponse = restApi.query(defectRequest); + if (queryResponse.wasSuccessful()) { + for (JsonElement result : queryResponse.getResults()) { + JsonObject defect = result.getAsJsonObject(); + System.out.println(String.format("\t%s - %s: Priority=%s, State=%s", + defect.get("FormattedID").getAsString(), + defect.get("Name").getAsString(), + defect.get("Priority").getAsString(), + defect.get("State").getAsString())); + } + } + } finally { + //Release resources + restApi.close(); + } + } +} diff --git a/src/main/resources/examples/com/rallydev/rest/CollectionSummaryExample.java b/src/main/resources/examples/com/rallydev/rest/CollectionSummaryExample.java new file mode 100644 index 0000000..2601e5c --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/CollectionSummaryExample.java @@ -0,0 +1,54 @@ +package com.rallydev.rest; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.Map; + +public class CollectionSummaryExample { + + public static void main(String[] args) throws URISyntaxException, IOException { + + //Create and configure a new instance of RallyRestApi + //(Server, username, password and proxy settings configured in Factory) + RallyRestApi restApi = RestApiFactory.getRestApi(); + + try { + //Get a story with defects + System.out.println("\nQuerying for stories with defects..."); + QueryRequest storiesWithDefects = new QueryRequest("hierarchicalrequirement"); + storiesWithDefects.setQueryFilter(new QueryFilter("Defects.ObjectID", "!=", null)); + storiesWithDefects.setFetch(new Fetch("FormattedID", "Name", "Defects:summary[Priority;State]")); + QueryResponse storiesWithDefectsResponse = restApi.query(storiesWithDefects); + JsonObject story = storiesWithDefectsResponse.getResults().get(0).getAsJsonObject(); + System.out.println(String.format("Found: %s - %s", story.get("FormattedID").getAsString(), story.get("Name").getAsString())); + + System.out.println(String.format("\nSummarizing defects...")); + JsonObject defectSummary = story.getAsJsonObject("Summary").getAsJsonObject("Defects"); + + System.out.println(String.format("\nTotal defects: %d", defectSummary.get("Count").getAsInt())); + + System.out.println("\nBy Priority:"); + JsonObject prioritySummary = defectSummary.getAsJsonObject("Priority"); + for(Map.Entry summaryItem : prioritySummary.entrySet()) { + System.out.println(String.format("\t%s - %d", summaryItem.getKey(), summaryItem.getValue().getAsInt())); + } + + System.out.println("\nBy State:"); + JsonObject stateSummary = defectSummary.getAsJsonObject("State"); + for(Map.Entry summaryItem : stateSummary.entrySet()) { + System.out.println(String.format("\t%s - %d", summaryItem.getKey(), summaryItem.getValue().getAsInt())); + } + + } finally { + //Release resources + restApi.close(); + } + } +} diff --git a/src/main/resources/examples/com/rallydev/rest/CrudExample.java b/src/main/resources/examples/com/rallydev/rest/CrudExample.java new file mode 100644 index 0000000..58d168f --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/CrudExample.java @@ -0,0 +1,63 @@ +package com.rallydev.rest; + +import com.google.gson.JsonObject; +import com.rallydev.rest.request.*; +import com.rallydev.rest.response.CreateResponse; +import com.rallydev.rest.response.DeleteResponse; +import com.rallydev.rest.response.GetResponse; +import com.rallydev.rest.response.UpdateResponse; +import com.rallydev.rest.util.Ref; + +import java.io.IOException; +import java.net.URISyntaxException; + +public class CrudExample { + + public static void main(String[] args) throws URISyntaxException, IOException { + + //Create and configure a new instance of RallyRestApi + //(Server, username, password and proxy settings configured in Factory) + RallyRestApi restApi = RestApiFactory.getRestApi(); + + try { + + //Create a defect + System.out.println("Creating defect..."); + JsonObject newDefect = new JsonObject(); + newDefect.addProperty("Name", "Test Defect"); + CreateRequest createRequest = new CreateRequest("defect", newDefect); + CreateResponse createResponse = restApi.create(createRequest); + System.out.println(String.format("Created %s", createResponse.getObject().get("_ref").getAsString())); + + //Read defect + String ref = Ref.getRelativeRef(createResponse.getObject().get("_ref").getAsString()); + System.out.println(String.format("\nReading defect %s...", ref)); + GetRequest getRequest = new GetRequest(ref); + GetResponse getResponse = restApi.get(getRequest); + JsonObject obj = getResponse.getObject(); + System.out.println(String.format("Read defect. Name = %s, State = %s", + obj.get("Name").getAsString(), obj.get("State").getAsString())); + + //Update defect + System.out.println("\nUpdating defect state..."); + JsonObject updatedDefect = new JsonObject(); + updatedDefect.addProperty("State", "Fixed"); + UpdateRequest updateRequest = new UpdateRequest(ref, updatedDefect); + UpdateResponse updateResponse = restApi.update(updateRequest); + obj = updateResponse.getObject(); + System.out.println(String.format("Updated defect. State = %s", obj.get("State").getAsString())); + + //Delete defect + System.out.println("\nDeleting defect..."); + DeleteRequest deleteRequest = new DeleteRequest(ref); + DeleteResponse deleteResponse = restApi.delete(deleteRequest); + if (deleteResponse.wasSuccessful()) { + System.out.println("Deleted defect."); + } + + } finally { + //Release all resources + restApi.close(); + } + } +} diff --git a/src/main/resources/examples/com/rallydev/rest/QueryExample.java b/src/main/resources/examples/com/rallydev/rest/QueryExample.java new file mode 100644 index 0000000..d1eb302 --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/QueryExample.java @@ -0,0 +1,59 @@ +package com.rallydev.rest; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; + +import java.io.IOException; +import java.net.URISyntaxException; + +public class QueryExample { + + public static void main(String[] args) throws URISyntaxException, IOException { + + //Create and configure a new instance of RallyRestApi + //(Server, username, password and proxy settings configured in Factory) + RallyRestApi restApi = RestApiFactory.getRestApi(); + + try { + + System.out.println("Querying for top 5 highest priority unfixed defects..."); + + QueryRequest defects = new QueryRequest("defect"); + + defects.setFetch(new Fetch("FormattedID", "Name", "State", "Priority")); + defects.setQueryFilter(new QueryFilter("State", "<", "Fixed")); + defects.setOrder("Priority ASC,FormattedID ASC"); + + //Return up to 5, 1 per page + defects.setPageSize(1); + defects.setLimit(5); + + QueryResponse queryResponse = restApi.query(defects); + if (queryResponse.wasSuccessful()) { + System.out.println(String.format("\nTotal results: %d", queryResponse.getTotalResultCount())); + System.out.println("Top 5:"); + for (JsonElement result : queryResponse.getResults()) { + JsonObject defect = result.getAsJsonObject(); + System.out.println(String.format("\t%s - %s: Priority=%s, State=%s", + defect.get("FormattedID").getAsString(), + defect.get("Name").getAsString(), + defect.get("Priority").getAsString(), + defect.get("State").getAsString())); + } + } else { + System.err.println("The following errors occurred: "); + for (String err : queryResponse.getErrors()) { + System.err.println("\t" + err); + } + } + + } finally { + //Release resources + restApi.close(); + } + } +} diff --git a/src/main/resources/examples/com/rallydev/rest/RestApiFactory.java b/src/main/resources/examples/com/rallydev/rest/RestApiFactory.java new file mode 100644 index 0000000..35554ed --- /dev/null +++ b/src/main/resources/examples/com/rallydev/rest/RestApiFactory.java @@ -0,0 +1,50 @@ +package com.rallydev.rest; + +import java.net.URI; +import java.net.URISyntaxException; + +public class RestApiFactory { + + //Specify your Rally server + private static final String SERVER = "https://rally1.rallydev.com"; + + //Specify your WSAPI version + private static final String WSAPI_VERSION = "v2.0"; + + //Specify your Rally username + private static final String USERNAME = ""; + + //Specify your Rally password + private static final String PASSWORD = ""; + + //Specify your Rally api key + private static final String API_KEY = ""; + + //If using a proxy specify full url, like http://my.proxy.com:8000 + private static final String PROXY_SERVER = null; + + //If using an authenticated proxy server specify the username and password + private static final String PROXY_USERNAME = null; + private static final String PROXY_PASSWORD = null; + + public static RallyRestApi getRestApi() throws URISyntaxException { + RallyRestApi restApi; + if(API_KEY != null && !API_KEY.equals("")) { + restApi = new RallyRestApi(new URI(SERVER), API_KEY); + } else { + restApi = new RallyRestApi(new URI(SERVER), USERNAME, PASSWORD); + } + if (PROXY_SERVER != null) { + URI uri = new URI(PROXY_SERVER); + if (PROXY_USERNAME != null) { + restApi.setProxy(uri, PROXY_USERNAME, PROXY_PASSWORD); + } else { + restApi.setProxy(uri); + } + } + + restApi.setWsapiVersion(WSAPI_VERSION); + + return restApi; + } +} diff --git a/src/test/java/com/rallydev/rest/RallyRestApiTest.java b/src/test/java/com/rallydev/rest/RallyRestApiTest.java new file mode 100644 index 0000000..eba2d1c --- /dev/null +++ b/src/test/java/com/rallydev/rest/RallyRestApiTest.java @@ -0,0 +1,301 @@ +package com.rallydev.rest; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.rallydev.rest.client.ApiKeyClient; +import com.rallydev.rest.client.BasicAuthClient; +import com.rallydev.rest.request.*; +import com.rallydev.rest.response.*; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.net.URI; + +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.testng.Assert.assertEquals; + +@Test +public class RallyRestApiTest { + private RallyRestApi api; + private URI server; + + @BeforeMethod + protected void setUp() throws Exception { + server = new URI("https://someServer.rallydev.com"); + api = new RallyRestApi(server, "_1adfkj234fjlk"); + api.client = spy(api.client); + + } + + public void shouldInitializeBasicAuthClient() { + RallyRestApi basicAuthApi = new RallyRestApi(server, "username", "password"); + Assert.assertTrue(basicAuthApi.getClient() instanceof BasicAuthClient); + } + + public void shouldInitializeApiKeyClient() { + RallyRestApi apiKeyApi = new RallyRestApi(server, "apiKey"); + Assert.assertTrue(apiKeyApi.getClient() instanceof ApiKeyClient); + } + + public void shouldSetProxy() throws Exception { + URI proxy = new URI("http://my.proxy.com:8000"); + api.setProxy(proxy); + verify(api.client).setProxy(proxy); + } + + public void shouldSetProxyWithCredentials() throws Exception { + URI proxy = new URI("http://my.proxy.com:8000"); + api.setProxy(proxy, "username", "password"); + verify(api.client).setProxy(proxy, "username", "password"); + } + + public void shouldSetVendor() throws Exception { + api.setApplicationVendor("fooVendor"); + verify(api.client).setApplicationVendor("fooVendor"); + } + + public void shouldSetVersion() throws Exception { + api.setApplicationVersion("fooVersion"); + verify(api.client).setApplicationVersion("fooVersion"); + } + + public void shouldSetName() throws Exception { + api.setApplicationName("fooName"); + verify(api.client).setApplicationName("fooName"); + } + + public void shouldGetWsapiVersion() { + Assert.assertEquals(api.getWsapiVersion(), api.client.getWsapiVersion()); + } + + public void shouldSetWsapiVersion() { + api.setWsapiVersion("1.43"); + Assert.assertEquals(api.getWsapiVersion(), api.client.getWsapiVersion()); + Assert.assertEquals(api.getWsapiVersion(), "1.43"); + } + + public void shouldCreate() throws Exception { + JsonObject response = new JsonObject(); + JsonObject createResult = new JsonObject(); + response.add("CreateResult", createResult); + createResult.add("Errors", new JsonArray()); + createResult.add("Warnings", new JsonArray()); + JsonObject object = new JsonObject(); + object.addProperty("_ref", "/defect/1234"); + createResult.add("Object", object); + + JsonObject newDefect = new JsonObject(); + newDefect.addProperty("Name", "Foo"); + CreateRequest request = new CreateRequest("defect", newDefect); + + doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody()); + CreateResponse createResponse = api.create(request); + + verify(api.client).doPost(request.toUrl(), request.getBody()); + Assert.assertTrue(createResponse.wasSuccessful()); + JsonObject createdObj = createResponse.getObject(); + assertEquals(createdObj.get("_ref").getAsString(), "/defect/1234"); + } + + public void shouldUpdate() throws Exception { + JsonObject response = new JsonObject(); + JsonObject updateResult = new JsonObject(); + response.add("OperationResult", updateResult); + updateResult.add("Errors", new JsonArray()); + updateResult.add("Warnings", new JsonArray()); + JsonObject object = new JsonObject(); + object.addProperty("_ref", "/defect/1234"); + updateResult.add("Object", object); + + JsonObject updatedDefect = new JsonObject(); + updatedDefect.addProperty("Name", "Foo"); + UpdateRequest request = new UpdateRequest("/defect/1234", updatedDefect); + doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody()); + UpdateResponse updateResponse = api.update(request); + + verify(api.client).doPost(request.toUrl(), request.getBody()); + Assert.assertTrue(updateResponse.wasSuccessful()); + JsonObject obj = updateResponse.getObject(); + assertEquals(obj.get("_ref").getAsString(), "/defect/1234"); + } + + public void shouldUpdateCollection() throws Exception { + JsonObject response = new JsonObject(); + JsonObject result = new JsonObject(); + response.add("OperationResult", result); + result.add("Errors", new JsonArray()); + result.add("Warnings", new JsonArray()); + JsonArray results = new JsonArray(); + JsonObject tag = new JsonObject(); + tag.addProperty("_ref", "/tag/23456"); + results.add(tag); + result.add("Results", results); + + JsonArray updatedTags = new JsonArray(); + + updatedTags.add(tag); + CollectionUpdateRequest request = new CollectionUpdateRequest("/defect/1234/tags", updatedTags, true); + doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody()); + CollectionUpdateResponse updateResponse = api.updateCollection(request); + + verify(api.client).doPost(request.toUrl(), request.getBody()); + Assert.assertTrue(updateResponse.wasSuccessful()); + JsonArray updateResults = updateResponse.getResults(); + assertEquals(updateResults.get(0).getAsJsonObject().get("_ref").getAsString(), "/tag/23456"); + } + + public void shouldDelete() throws Exception { + JsonObject response = new JsonObject(); + JsonObject deleteResult = new JsonObject(); + response.add("OperationResult", deleteResult); + deleteResult.add("Errors", new JsonArray()); + deleteResult.add("Warnings", new JsonArray()); + + DeleteRequest request = new DeleteRequest("/defect/1234"); + doReturn(new Gson().toJson(response)).when(api.client).doDelete(request.toUrl()); + DeleteResponse deleteResponse = api.delete(request); + + verify(api.client).doDelete(request.toUrl()); + Assert.assertTrue(deleteResponse.wasSuccessful()); + } + + public void shouldGet() throws Exception { + JsonObject response = new JsonObject(); + JsonObject defect = new JsonObject(); + response.add("Defect", defect); + defect.add("Errors", new JsonArray()); + defect.add("Warnings", new JsonArray()); + defect.addProperty("_ref", "/defect/1234"); + + GetRequest request = new GetRequest("/defect/1234"); + doReturn(new Gson().toJson(response)).when(api.client).doGet(request.toUrl()); + GetResponse getResponse = api.get(request); + + verify(api.client).doGet(request.toUrl()); + Assert.assertTrue(getResponse.wasSuccessful()); + JsonObject obj = getResponse.getObject(); + assertEquals(obj.get("_ref").getAsString(), "/defect/1234"); + } + + public void shouldQueryOnePage() throws Exception { + JsonObject response = buildQueryResponse(5); + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(1); + doReturn(new Gson().toJson(response)).when(api.client).doGet(request.toUrl()); + QueryResponse queryResponse = api.query(request); + + verify(api.client, times(1)).doGet(anyString()); + verify(api.client).doGet(request.toUrl()); + Assert.assertTrue(queryResponse.wasSuccessful()); + assertEquals(queryResponse.getTotalResultCount(), 5); + } + + public void shouldQueryAllPages() throws Exception { + JsonObject response = buildQueryResponse(5); + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(1); + request.setLimit(Integer.MAX_VALUE); + doReturn(new Gson().toJson(response)).when(api.client).doGet(anyString()); + api.query(request); + + String requestUrl = request.toUrl(); + verify(api.client, times(5)).doGet(anyString()); //make sure 5 gets + verify(api.client).doGet(requestUrl); + verify(api.client).doGet(requestUrl.replace("start=1", "start=2")); + verify(api.client).doGet(requestUrl.replace("start=1", "start=3")); + verify(api.client).doGet(requestUrl.replace("start=1", "start=4")); + verify(api.client).doGet(requestUrl.replace("start=1", "start=5")); + } + + public void shouldQuerySomePages() throws Exception { + JsonObject response = buildQueryResponse(5); + + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(2); + request.setLimit(4); + doReturn(new Gson().toJson(response)).when(api.client).doGet(anyString()); + api.query(request); + + String requestUrl = request.toUrl(); + + verify(api.client, times(2)).doGet(anyString()); //make sure 2 gets + verify(api.client).doGet(requestUrl); + verify(api.client).doGet(requestUrl.replace("start=1", "start=3")); + } + + public void shouldQueryNoPages() throws Exception { + JsonObject response = buildQueryResponse(0); + + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(1); + request.setLimit(4); + doReturn(new Gson().toJson(response)).when(api.client).doGet(anyString()); + api.query(request); + + verify(api.client, times(1)).doGet(anyString()); //make sure 1 get + verify(api.client).doGet(request.toUrl()); + } + + public void shouldQuerySomePagesWithNonStandardStart() throws Exception { + JsonObject response = buildQueryResponse(10); + + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(1); + request.setStart(5); + request.setLimit(4); + doReturn(new Gson().toJson(response)).when(api.client).doGet(anyString()); + api.query(request); + + String requestUrl = request.toUrl(); + + verify(api.client, times(4)).doGet(anyString()); //make sure 4 gets + verify(api.client).doGet(requestUrl); + verify(api.client).doGet(requestUrl.replace("start=5", "start=6")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=7")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=8")); + } + + public void shouldQueryAllPagesWithNonStandardStart() throws Exception { + JsonObject response = buildQueryResponse(10); + + QueryRequest request = new QueryRequest("Defect"); + request.setPageSize(1); + request.setStart(5); + request.setLimit(Integer.MAX_VALUE); + doReturn(new Gson().toJson(response)).when(api.client).doGet(anyString()); + api.query(request); + + String requestUrl = request.toUrl(); + + verify(api.client, times(6)).doGet(anyString()); //make sure 6 gets + verify(api.client).doGet(requestUrl); + verify(api.client).doGet(requestUrl.replace("start=5", "start=6")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=7")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=8")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=9")); + verify(api.client).doGet(requestUrl.replace("start=5", "start=10")); + } + + public void shouldClose() throws Exception { + api.close(); + verify(api.client).close(); + } + + private JsonObject buildQueryResponse(int totalResultCount) { + JsonObject response = new JsonObject(); + JsonObject queryResult = new JsonObject(); + response.add("QueryResult", queryResult); + queryResult.add("Errors", new JsonArray()); + queryResult.add("Warnings", new JsonArray()); + queryResult.add("Results", new JsonArray()); + queryResult.addProperty("TotalResultCount", totalResultCount); + return response; + } + +} diff --git a/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java b/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java new file mode 100644 index 0000000..93ea0b7 --- /dev/null +++ b/src/test/java/com/rallydev/rest/client/ApiKeyClientTest.java @@ -0,0 +1,60 @@ +package com.rallydev.rest.client; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.impl.client.DefaultHttpClient; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; + +public class ApiKeyClientTest { + + private String server = "https://rally1.rallydev.com"; + private String apiKey = "foo"; + private ApiKeyClient client; + + @BeforeMethod + public void setUp() throws URISyntaxException { + ApiKeyClient client = new ApiKeyClient(new URI(server), apiKey); + this.client = spy(client); + } + + @Test + public void shouldIntialize() { + Assert.assertEquals(client.getServer(), server); + } + + @SuppressWarnings("resource") + @Test + public void shouldIntializePreConfiguredClient() throws URISyntaxException { + HttpClient mockClient = mock(HttpClient.class); + ApiKeyClient client = new ApiKeyClient(new URI(server), apiKey, mockClient); + Assert.assertEquals(client.getServer(), server); + } + + @Test + public void shouldIncludeApiKeyOnRequest() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.doRequest(new HttpGet()); + verify(client).doRequest(argThat(new HttpRequestHeaderMatcher("zsessionid", apiKey))); + } + + @Test + public void shouldReturnPreConfiguredClient() throws Exception { + DefaultHttpClient mockClient = mock(DefaultHttpClient.class); + ApiKeyClient spiedClient = spy(new ApiKeyClient(new URI(server), apiKey, mockClient)); + Assert.assertEquals(spiedClient.client, mockClient); + } +} diff --git a/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java b/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java new file mode 100644 index 0000000..51a7798 --- /dev/null +++ b/src/test/java/com/rallydev/rest/client/BasicAuthClientTest.java @@ -0,0 +1,122 @@ +package com.rallydev.rest.client; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.http.Header; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.impl.auth.BasicScheme; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; + +public class BasicAuthClientTest { + + private String server = "https://rally1.rallydev.com"; + private String userName = "foo"; + private String password = "bar"; + private BasicAuthClient client; + + private static String SECURITY_TOKEN_RESPONSE ="{\"OperationResult\":{\"SecurityToken\":\"foo\",\"Errors\":[]}}"; + + @BeforeMethod + public void setUp() throws URISyntaxException { + BasicAuthClient client = new BasicAuthClient(new URI(server), userName, password); + this.client = spy(client); + } + + @Test + public void shouldIntialize() { + Assert.assertEquals(client.getServer(), server); + Assert.assertEquals(client.credentials.getPassword(), password); + Assert.assertEquals(client.credentials.getUserPrincipal().getName(), userName); + } + + @SuppressWarnings("resource") + @Test + public void shouldIntializePreConfiguredClient() throws URISyntaxException { + HttpClient mockClient = mock(HttpClient.class); + BasicAuthClient client = new BasicAuthClient(new URI(server), userName, password, mockClient); + Assert.assertEquals(client.getServer(), server); + Assert.assertEquals(client.credentials.getPassword(), password); + Assert.assertEquals(client.credentials.getUserPrincipal().getName(), userName); + } + + @Test + public void shouldIncludeAuthHeaderOnGet() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.doRequest(new HttpGet()); + Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); + verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); + } + + @Test + public void shouldNotIncludeCSRFTokenOnGet() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.doRequest(new HttpGet()); + verify(client, times(0)).attachSecurityInfo(any(HttpRequestBase.class)); + Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); + verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); + } + + @Test + public void shouldNotIncludeCSRFTokenOnWsapiv1() throws Exception { + client.setWsapiVersion("1.43"); + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.doRequest(new HttpPost()); + verify(client, times(0)).attachSecurityInfo(any(HttpRequestBase.class)); + } + + @Test + public void shouldRequestCSRFToken() throws Exception { + doReturn("").when(client).executeRequest(any(HttpPost.class)); + doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class)); + client.doRequest(new HttpPost(server)); + Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false); + verify(client, times(2)).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue()))); + } + + @Test + public void shouldIncludeCSRFTokenOnPost() throws Exception { + doReturn("").when(client).executeRequest(any(HttpPost.class)); + doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class)); + HttpPost post = new HttpPost(server); + client.doRequest(post); + post.getURI().getQuery().contains(BasicAuthClient.SECURITY_TOKEN_KEY + "=foo"); + verify(client).executeRequest(post); + } + + @Test + public void shouldIncludeCSRFTokenOnPut() throws Exception { + doReturn("").when(client).executeRequest(any(HttpPut.class)); + doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class)); + HttpPut put = new HttpPut(server); + client.doRequest(put); + put.getURI().getQuery().contains(BasicAuthClient.SECURITY_TOKEN_KEY + "=foo"); + verify(client).executeRequest(put); + } + + @Test + public void shouldIncludeCSRFTokenOnDelete() throws Exception { + doReturn("").when(client).executeRequest(any(HttpDelete.class)); + doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class)); + HttpDelete delete = new HttpDelete(server); + client.doRequest(delete); + delete.getURI().getQuery().contains(BasicAuthClient.SECURITY_TOKEN_KEY + "=foo"); + verify(client).executeRequest(delete); + } +} \ No newline at end of file diff --git a/src/test/java/com/rallydev/rest/client/HttpClientTest.java b/src/test/java/com/rallydev/rest/client/HttpClientTest.java new file mode 100644 index 0000000..54d1e1c --- /dev/null +++ b/src/test/java/com/rallydev/rest/client/HttpClientTest.java @@ -0,0 +1,162 @@ +package com.rallydev.rest.client; + +import com.rallydev.rest.matchers.HttpRequestBodyMatcher; +import com.rallydev.rest.matchers.HttpRequestHeaderMatcher; +import com.rallydev.rest.matchers.HttpRequestUrlMatcher; +import org.apache.http.*; +import org.apache.http.client.methods.*; +import org.apache.http.conn.params.ConnRoutePNames; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DecompressingHttpClient; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.argThat; +import static org.mockito.Mockito.*; + +public class HttpClientTest { + + private String server = "https://rally1.rallydev.com"; + private HttpClient client; + + @BeforeMethod + public void setUp() throws URISyntaxException { + HttpClient client = new HttpClient(new URI(server)); + this.client = spy(client); + } + + @Test + public void shouldIntialize() { + Assert.assertEquals(client.getServer(), server); + } + + @Test + public void shouldSetProxy() throws Exception { + URI proxy = new URI("http://my.proxy.com:8000"); + client.setProxy(proxy); + Assert.assertEquals(client.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY), + new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme())); + } + + @Test + public void shouldSetProxyWithCredentials() throws Exception { + URI proxy = new URI("http://my.proxy.com:8000"); + client.setProxy(proxy, "username", "password"); + Assert.assertEquals(client.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY), + new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme())); + verify(client).setClientCredentials(proxy, "username", "password"); + } + + @Test + public void shouldSetApplicationVendor() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.setApplicationVendor("FooVendor"); + client.doRequest(new HttpGet()); + verify(client).doRequest(argThat(new HttpRequestHeaderMatcher("X-RallyIntegrationVendor", "FooVendor"))); + } + + @Test + public void shouldSetApplicationName() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.setApplicationName("FooName"); + client.doRequest(new HttpGet()); + verify(client).doRequest(argThat(new HttpRequestHeaderMatcher("X-RallyIntegrationName", "FooName"))); + } + + @Test + public void shouldSetApplicationVersion() throws Exception { + doReturn("").when(client).executeRequest(any(HttpRequestBase.class)); + client.setApplicationVersion("FooVersion"); + client.doRequest(new HttpGet()); + verify(client).doRequest(argThat(new HttpRequestHeaderMatcher("X-RallyIntegrationVersion", "FooVersion"))); + } + + @Test + public void shouldUseDefaultWsapiVersion() { + Assert.assertEquals(client.getWsapiVersion(), "v2.0"); + Assert.assertEquals(client.getWsapiUrl(), server + "/slm/webservice/v2.0"); + } + + @Test + public void shouldSetWsapiVersion() { + client.setWsapiVersion("v3.0"); + Assert.assertEquals(client.getWsapiVersion(), "v3.0"); + Assert.assertEquals(client.getWsapiUrl(), server + "/slm/webservice/v3.0"); + } + + @Test + public void shouldPost() throws Exception { + String url = "/defect/12345"; + String body = "{}"; + doReturn("").when(client).doRequest(any(HttpPost.class)); + client.doPost(url, body); + verify(client).doRequest(argThat(new HttpRequestBodyMatcher(client.getWsapiUrl() + url, body))); + } + + @Test + public void shouldPut() throws Exception { + String url = "/defect/12345"; + String body = "{}"; + doReturn("").when(client).doRequest(any(HttpPut.class)); + client.doPut(url, body); + verify(client).doRequest(argThat(new HttpRequestBodyMatcher(client.getWsapiUrl() + url, body))); + } + + @Test + public void shouldDelete() throws Exception { + String url = "/defect/12345"; + doReturn("").when(client).doRequest(any(HttpDelete.class)); + client.doDelete(url); + verify(client).doRequest(argThat(new HttpRequestUrlMatcher(client.getWsapiUrl() + url))); + } + + @Test + public void shouldGet() throws Exception { + String url = "/defect/12345"; + doReturn("").when(client).doRequest(any(HttpGet.class)); + client.doGet(url); + verify(client).doRequest(argThat(new HttpRequestUrlMatcher(client.getWsapiUrl() + url))); + } + + @Test + public void shouldGzip() throws Exception { + String url = "/defect/1234"; + client.client = spy(client.client); + doReturn(createMockResponse("{}")).when(client.client).execute(any(HttpGet.class)); + client.doGet(url); + Assert.assertTrue(client.client instanceof DecompressingHttpClient); + verify(client.client).execute(argThat(new HttpRequestUrlMatcher(client.getWsapiUrl() + url))); + } + + @Test + public void shouldReturnValidResponse() throws Exception { + client.client = spy(client.client); + doReturn(createMockResponse("{}")).when(client.client).execute(any(HttpGet.class)); + String response = client.doGet("/defect/1234"); + Assert.assertEquals("{}", response); + } + + @Test(expectedExceptions = IOException.class) + public void shouldExplodeWithInvalidResponse() throws Exception { + client.client = spy(client.client); + doReturn(createMockResponse("")).when(client.client).execute(any(HttpGet.class)); + client.doGet("/defect/1234"); + } + + private HttpResponse createMockResponse(String responseText) throws Exception { + HttpResponse response = mock(HttpResponse.class); + StatusLine status = mock(StatusLine.class); + when(response.getStatusLine()).thenReturn(status); + when(status.getStatusCode()).thenReturn(responseText.length() == 0 ? 500 : 200); + when(response.getEntity()).thenReturn(new StringEntity(responseText)); + return response; + } +} \ No newline at end of file diff --git a/src/test/java/com/rallydev/rest/matchers/HttpRequestBodyMatcher.java b/src/test/java/com/rallydev/rest/matchers/HttpRequestBodyMatcher.java new file mode 100644 index 0000000..9577bdb --- /dev/null +++ b/src/test/java/com/rallydev/rest/matchers/HttpRequestBodyMatcher.java @@ -0,0 +1,27 @@ +package com.rallydev.rest.matchers; + +import org.apache.http.Header; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpRequestBase; +import org.mockito.ArgumentMatcher; + +public class HttpRequestBodyMatcher extends ArgumentMatcher { + private String url; + private String body; + + public HttpRequestBodyMatcher(String url, String body) { + this.url = url; + this.body = body; + } + + public boolean matches(Object o) { + if (o instanceof HttpEntityEnclosingRequestBase) { + HttpEntityEnclosingRequestBase h = (HttpEntityEnclosingRequestBase) o; + Header contentType = h.getEntity().getContentType(); + return contentType.getValue().toLowerCase().contains("utf-8") && + h.getURI().toString().equals(url) && + h.getEntity().toString().equals(body); + } + return false; + } +} \ No newline at end of file diff --git a/src/test/java/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.java b/src/test/java/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.java new file mode 100644 index 0000000..a941d12 --- /dev/null +++ b/src/test/java/com/rallydev/rest/matchers/HttpRequestHeaderMatcher.java @@ -0,0 +1,24 @@ +package com.rallydev.rest.matchers; + +import org.apache.http.Header; +import org.apache.http.client.methods.HttpRequestBase; +import org.mockito.ArgumentMatcher; + +public class HttpRequestHeaderMatcher extends ArgumentMatcher { + private String name; + private String value; + + public HttpRequestHeaderMatcher(String name, String value) { + this.name = name; + this.value = value; + } + + public boolean matches(Object o) { + if (o instanceof HttpRequestBase) { + HttpRequestBase h = (HttpRequestBase) o; + Header header = h.getFirstHeader(name); + return header != null && header.getValue().equals(value); + } + return false; + } +} diff --git a/src/test/java/com/rallydev/rest/matchers/HttpRequestUrlMatcher.java b/src/test/java/com/rallydev/rest/matchers/HttpRequestUrlMatcher.java new file mode 100644 index 0000000..7be5fc1 --- /dev/null +++ b/src/test/java/com/rallydev/rest/matchers/HttpRequestUrlMatcher.java @@ -0,0 +1,22 @@ +package com.rallydev.rest.matchers; + +import org.apache.http.Header; +import org.apache.http.client.methods.HttpRequestBase; +import org.mockito.ArgumentMatcher; + +public class HttpRequestUrlMatcher extends ArgumentMatcher { + private String url; + private String value; + + public HttpRequestUrlMatcher(String url) { + this.url = url; + } + + public boolean matches(Object o) { + if (o instanceof HttpRequestBase) { + HttpRequestBase h = (HttpRequestBase) o; + return h.getURI().toString().equals(url); + } + return false; + } +} diff --git a/src/test/java/com/rallydev/rest/request/CollectionUpdateRequestTest.java b/src/test/java/com/rallydev/rest/request/CollectionUpdateRequestTest.java new file mode 100644 index 0000000..2fb7fc4 --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/CollectionUpdateRequestTest.java @@ -0,0 +1,45 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class CollectionUpdateRequestTest { + + @Test + public void shouldCreateACorrectBody() { + JsonArray items = new JsonArray(); + JsonObject tag = new JsonObject(); + tag.addProperty("_ref", "/tag/2345"); + items.add(tag); + CollectionUpdateRequest req = new CollectionUpdateRequest("/hierarchicalrequirement/1234/tags.js", items, true); + Assert.assertEquals(req.getBody(), "{\"CollectionItems\":[{\"_ref\":\"/tag/2345\"}]}"); + } + + @Test + public void shouldConstructTheCorrectUrlForAdds() { + JsonArray items = new JsonArray(); + CollectionUpdateRequest req = new CollectionUpdateRequest("/defect/1234/tags", items, true); + req.setFetch(new Fetch("Name", "Description")); + Assert.assertEquals(req.toUrl(), "/defect/1234/tags/add.js?fetch=Name%2CDescription"); + } + + @Test + public void shouldConstructTheCorrectUrlForRemoves() { + JsonObject tagsCollection = new JsonObject(); + tagsCollection.addProperty("_ref", "/defect/1234/tags"); + JsonArray items = new JsonArray(); + CollectionUpdateRequest req = new CollectionUpdateRequest(tagsCollection, items, false); + Assert.assertEquals(req.toUrl(), "/defect/1234/tags/remove.js?fetch=true"); + } + + @Test + public void shouldConstructTheCorrectUrlWithExtraParam() { + JsonArray items = new JsonArray(); + CollectionUpdateRequest req = new CollectionUpdateRequest("/defect/1234/tags", items, true); + req.addParam("foo", "Bar"); + Assert.assertEquals(req.toUrl(), "/defect/1234/tags/add.js?foo=Bar&fetch=true"); + } +} diff --git a/src/test/java/com/rallydev/rest/request/CreateRequestTest.java b/src/test/java/com/rallydev/rest/request/CreateRequestTest.java new file mode 100644 index 0000000..9fc8a6e --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/CreateRequestTest.java @@ -0,0 +1,61 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import org.apache.http.client.utils.URLEncodedUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class CreateRequestTest { + + @Test + public void shouldCreateACorrectBody() { + JsonObject body = new JsonObject(); + body.addProperty("Name", "My Story"); + CreateRequest req = new CreateRequest("HierarchicalRequirement", body); + Assert.assertEquals(req.getBody(), "{\"HierarchicalRequirement\":{\"Name\":\"My Story\"}}"); + } + + @Test + public void shouldCreateACorrectBodyWithNullFields() { + JsonObject body = new JsonObject(); + body.addProperty("Name", "My Story"); + body.add("Feature", JsonNull.INSTANCE); + CreateRequest req = new CreateRequest("HierarchicalRequirement", body); + req.getGsonBuilder().serializeNulls(); + Assert.assertEquals(req.getBody(), "{\"HierarchicalRequirement\":{\"Name\":\"My Story\",\"Feature\":null}}"); + } + + @Test + public void shouldConstructTheCorrectUrl() { + JsonObject body = new JsonObject(); + CreateRequest req = new CreateRequest("Defect", body); + req.setFetch(new Fetch("Name", "Description")); + Assert.assertEquals(req.toUrl(), "/defect/create.js?fetch=Name%2CDescription"); + } + + @Test + public void shouldConstructTheCorrectDefaultFetchUrl() { + JsonObject body = new JsonObject(); + CreateRequest req = new CreateRequest("Defect", body); + Assert.assertEquals(req.toUrl(), "/defect/create.js?fetch=true"); + } + + @Test + public void shouldConstructTheCorrectUrlWithExtraParam() { + JsonObject body = new JsonObject(); + CreateRequest req = new CreateRequest("Defect", body); + req.addParam("foo", "Bar"); + Assert.assertEquals(req.toUrl(), "/defect/create.js?foo=Bar&fetch=true"); + } + + @Test + public void shouldEncodeParamsUsingUtf8() { + JsonObject body = new JsonObject(); + CreateRequest req = new CreateRequest("Defect", body); + req.addParam("foo", "备"); + Assert.assertEquals(req.toUrl(), "/defect/create.js?" + + URLEncodedUtils.format(req.getParams(), "utf-8") + "&fetch=true"); + } +} diff --git a/src/test/java/com/rallydev/rest/request/DeleteRequestTest.java b/src/test/java/com/rallydev/rest/request/DeleteRequestTest.java new file mode 100644 index 0000000..10f7cd9 --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/DeleteRequestTest.java @@ -0,0 +1,26 @@ +package com.rallydev.rest.request; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class DeleteRequestTest { + + @Test + public void shouldConstructCorrectUrlWithAbsoluteRef() { + DeleteRequest req = new DeleteRequest("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js"); + } + + @Test + public void shouldConstructCorrectUrlWithRelativeRef() { + DeleteRequest req = new DeleteRequest("/defect/1234.js"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js"); + } + + @Test + public void shouldConstructCorrectUrlWithExtraParam() { + DeleteRequest req = new DeleteRequest("/defect/1234.js"); + req.addParam("foo", "Bar"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?foo=Bar"); + } +} diff --git a/src/test/java/com/rallydev/rest/request/GetRequestTest.java b/src/test/java/com/rallydev/rest/request/GetRequestTest.java new file mode 100644 index 0000000..05a7ec8 --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/GetRequestTest.java @@ -0,0 +1,45 @@ +package com.rallydev.rest.request; + +import com.rallydev.rest.util.Fetch; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class GetRequestTest { + + @Test + public void shouldReturnCorrectUrlWithAbsoluteRef() { + GetRequest req = new GetRequest("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=true"); + } + + @Test + public void shouldReturnCorrectUrlWithRelativeRef() { + GetRequest req = new GetRequest("/defect/1234.js"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=true"); + } + + @Test + public void shouldReturnCorrectUrlWithFetchParams() { + GetRequest req = new GetRequest("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js"); + req.setFetch(new Fetch("Name", "Description")); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=Name%2CDescription"); + } + + @Test + public void shouldReturnCorrectUrlForUser() { + Assert.assertEquals(new GetRequest("User").toUrl(), "/user.js?fetch=true"); + Assert.assertEquals(new GetRequest("user").toUrl(), "/user.js?fetch=true"); + Assert.assertEquals(new GetRequest("/user").toUrl(), "/user.js?fetch=true"); + Assert.assertEquals(new GetRequest("/user.js").toUrl(), "/user.js?fetch=true"); + Assert.assertEquals(new GetRequest("/user/12345.js").toUrl(), "/user/12345.js?fetch=true"); + } + + @Test + public void shouldReturnCorrectUrlForSubscription() { + Assert.assertEquals(new GetRequest("Subscription").toUrl(), "/subscription.js?fetch=true"); + Assert.assertEquals(new GetRequest("subscription").toUrl(), "/subscription.js?fetch=true"); + Assert.assertEquals(new GetRequest("/subscription").toUrl(), "/subscription.js?fetch=true"); + Assert.assertEquals(new GetRequest("/subscription.js").toUrl(), "/subscription.js?fetch=true"); + Assert.assertEquals(new GetRequest("/subscription/12345.js").toUrl(), "/subscription/12345.js?fetch=true"); + } +} diff --git a/src/test/java/com/rallydev/rest/request/QueryRequestTest.java b/src/test/java/com/rallydev/rest/request/QueryRequestTest.java new file mode 100644 index 0000000..ad61c4f --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/QueryRequestTest.java @@ -0,0 +1,165 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import com.rallydev.rest.util.QueryFilter; +import org.apache.http.client.utils.URLEncodedUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class QueryRequestTest { + + @Test + public void shouldCreateCorrectDefaultQuery() { + + QueryRequest q = new QueryRequest("Defect"); + + Assert.assertEquals(q.getPageSize(), 200); + Assert.assertEquals(q.getStart(), 1); + Assert.assertEquals(q.getOrder(), "ObjectID"); + Assert.assertEquals(q.toUrl(), "/defect.js?start=1&pagesize=200&fetch=true&order=ObjectID"); + } + + @Test + public void shouldCreateCorrectDefaultQueryWithExtraParam() { + + QueryRequest q = new QueryRequest("Defect"); + q.addParam("foo", "Bar"); + Assert.assertEquals(q.toUrl(), "/defect.js?foo=Bar&start=1&pagesize=200&fetch=true&order=ObjectID"); + } + + @Test + public void shouldEncodeParamsUsingUtf8() { + + QueryRequest q = new QueryRequest("Defect"); + q.addParam("foo", "备"); + Assert.assertTrue(q.toUrl().contains(URLEncodedUtils.format(q.getParams(), "utf-8"))); + } + + @Test + public void shouldCreateCorrectQueryWithFetch() { + + QueryRequest q = new QueryRequest("Defect"); + q.setFetch(new Fetch("Name", "Description")); + Assert.assertTrue(q.toUrl().contains("fetch=Name%2CDescription")); + } + + @Test + public void shouldCreateCorrectQueryWithDefaultOrder() { + + QueryRequest q = new QueryRequest("Defect"); + Assert.assertTrue(q.toUrl().contains("order=ObjectID")); + } + + @Test + public void shouldCreateCorrectQueryWithSpecifiedOrder() { + + QueryRequest q = new QueryRequest("Defect"); + q.setOrder("Name"); + Assert.assertTrue(q.toUrl().contains("order=Name%2CObjectID")); + } + + @Test + public void shouldCreateCorrectQueryWithPageSize() { + + QueryRequest q = new QueryRequest("Defect"); + q.setPageSize(1); + Assert.assertTrue(q.toUrl().contains("pagesize=1")); + } + + @Test + public void shouldCreateCorrectQueryWithStart() { + + QueryRequest q = new QueryRequest("Defect"); + q.setStart(50); + Assert.assertTrue(q.toUrl().contains("start=50")); + } + + @Test + public void shouldCreateCorrectQueryWithQuery() { + + QueryRequest q = new QueryRequest("Defect"); + q.setQueryFilter(new QueryFilter("State", "=", "Fixed")); + Assert.assertTrue(q.toUrl().contains("query=%28State+%3D+Fixed%29")); + } + + @Test + public void shouldCreateCorrectQueryWithWorkspace() { + + QueryRequest q = new QueryRequest("Defect"); + q.setWorkspace("/workspace/1234"); + Assert.assertTrue(q.toUrl().contains("workspace=%2Fworkspace%2F1234")); + } + + @Test + public void shouldCreateCorrectQueryWithProject() { + + QueryRequest q = new QueryRequest("Defect"); + q.setProject("/project/1234"); + Assert.assertTrue(q.toUrl().contains("project=%2Fproject%2F1234")); + Assert.assertTrue(q.toUrl().contains("projectScopeUp=false")); + Assert.assertTrue(q.toUrl().contains("projectScopeDown=true")); + + q.setScopedDown(false); + q.setScopedUp(true); + Assert.assertTrue(q.toUrl().contains("projectScopeUp=true")); + Assert.assertTrue(q.toUrl().contains("projectScopeDown=false")); + + } + + @Test + public void shouldCreateCorrectQueryWithNullProject() { + + QueryRequest q = new QueryRequest("Defect"); + q.setProject(null); + Assert.assertTrue(q.toUrl().contains("project=null")); + Assert.assertFalse(q.toUrl().contains("projectScopeUp")); + Assert.assertFalse(q.toUrl().contains("projectScopeDown")); + + } + + @Test + public void shouldCloneCorrectly() { + + QueryRequest q = new QueryRequest("Defect"); + q.setProject("/project/1234"); + q.setProject("/workspace/2345"); + q.setScopedDown(false); + q.setScopedUp(true); + q.setFetch(new Fetch("Name", "Description")); + q.setQueryFilter(new QueryFilter("State", "=", "Fixed")); + q.setPageSize(5); + q.setOrder("Name"); + q.setStart(10); + q.addParam("foo", "Bar"); + + QueryRequest q2 = q.clone(); + Assert.assertEquals(q.toUrl(), q2.toUrl()); + + } + + @Test + public void shouldCreateCorrectUrlForSubscription() { + + QueryRequest q = new QueryRequest("Subscription"); + + Assert.assertEquals(q.toUrl(), "/subscriptions.js?start=1&pagesize=200&fetch=true&order=ObjectID"); + } + + @Test + public void shouldCreateCorrectUrlForUser() { + + QueryRequest q = new QueryRequest("User"); + + Assert.assertEquals(q.toUrl(), "/users.js?start=1&pagesize=200&fetch=true&order=ObjectID"); + } + + @Test + public void shouldCreateCorrectUrlForCollection() { + JsonObject collection = new JsonObject(); + collection.addProperty("_ref", "/defect/1234/tasks"); + + QueryRequest q = new QueryRequest(collection); + Assert.assertEquals(q.toUrl(), "/defect/1234/tasks?start=1&pagesize=200&fetch=true&order=ObjectID"); + } +} diff --git a/src/test/java/com/rallydev/rest/request/RequestTest.java b/src/test/java/com/rallydev/rest/request/RequestTest.java new file mode 100644 index 0000000..68086b5 --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/RequestTest.java @@ -0,0 +1,64 @@ +package com.rallydev.rest.request; + +import com.google.gson.GsonBuilder; +import org.apache.http.NameValuePair; +import org.apache.http.message.BasicNameValuePair; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.List; + +public class RequestTest { + + private Request createRequest() { + return new Request() { + @Override + public String toUrl() { + return ""; + } + }; + } + + @Test + public void shouldBeAbleToAddParams() { + Request r = createRequest(); + Assert.assertEquals(r.getParams().size(), 0); + + r.addParam("Name", "Value"); + Assert.assertEquals(r.getParams().size(), 1); + + r.addParam("Name2", "Value2"); + Assert.assertEquals(r.getParams().size(), 2); + + r.getParams().clear(); + Assert.assertEquals(r.getParams().size(), 0); + } + + @Test + public void shouldBeAbleToSetParams() { + Request r = createRequest(); + Assert.assertEquals(r.getParams().size(), 0); + + List params = new ArrayList(); + params.add(new BasicNameValuePair("Name", "Value")); + r.setParams(params); + Assert.assertSame(params, r.getParams()); + Assert.assertEquals(r.getParams().size(), 1); + } + + @Test + public void shouldBeAbleToSetGsonBuilder() { + Request r = createRequest(); + Assert.assertEquals(r.getParams().size(), 0); + + GsonBuilder previous = r.getGsonBuilder(); + GsonBuilder brandNew = new GsonBuilder(); + + r.setGsonBuilder(brandNew); + + Assert.assertNotNull(r.getGsonBuilder()); + Assert.assertSame(r.getGsonBuilder(), brandNew); + Assert.assertNotSame(brandNew, previous); + } +} diff --git a/src/test/java/com/rallydev/rest/request/UpdateRequestTest.java b/src/test/java/com/rallydev/rest/request/UpdateRequestTest.java new file mode 100644 index 0000000..df8f72f --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/UpdateRequestTest.java @@ -0,0 +1,50 @@ +package com.rallydev.rest.request; + +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.rallydev.rest.util.Fetch; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class UpdateRequestTest { + + @Test + public void shouldCreateACorrectBody() { + JsonObject body = new JsonObject(); + body.addProperty("Name", "My Story"); + UpdateRequest req = new UpdateRequest("https://rally1.rallydev.com/slm/webservice/1.32/hierarchicalrequirement/1234.js", body); + Assert.assertEquals(req.getBody(), "{\"hierarchicalrequirement\":{\"Name\":\"My Story\"}}"); + } + + @Test + public void shouldCreateACorrectBodyWithNullFieldsByDefault() { + JsonObject body = new JsonObject(); + body.addProperty("Name", "My Story"); + body.add("Feature", JsonNull.INSTANCE); + UpdateRequest req = new UpdateRequest("https://rally1.rallydev.com/slm/webservice/1.32/hierarchicalrequirement/1234.js", body); + Assert.assertEquals(req.getBody(), "{\"hierarchicalrequirement\":{\"Name\":\"My Story\",\"Feature\":null}}"); + } + + @Test + public void shouldConstructTheCorrectUrl() { + JsonObject body = new JsonObject(); + UpdateRequest req= new UpdateRequest("/defect/1234.js", body); + req.setFetch(new Fetch("Name", "Description")); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=Name%2CDescription"); + } + + @Test + public void shouldConstructTheCorrectDefaultFetchUrl() { + JsonObject body = new JsonObject(); + UpdateRequest req= new UpdateRequest("/defect/1234.js", body); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=true"); + } + + @Test + public void shouldConstructTheCorrectUrlWithExtraParam() { + JsonObject body = new JsonObject(); + UpdateRequest req= new UpdateRequest("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js", body); + req.addParam("foo", "Bar"); + Assert.assertEquals(req.toUrl(), "/defect/1234.js?foo=Bar&fetch=true"); + } +} diff --git a/src/test/java/com/rallydev/rest/response/CollectionUpdateResponseTest.java b/src/test/java/com/rallydev/rest/response/CollectionUpdateResponseTest.java new file mode 100644 index 0000000..093e9ec --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/CollectionUpdateResponseTest.java @@ -0,0 +1,43 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class CollectionUpdateResponseTest { + private CollectionUpdateResponse createResponse(String[] errors, JsonArray results) { + return new CollectionUpdateResponse("{\"OperationResult\": { \"Errors\": " + new Gson().toJson(errors) + ", \"Warnings\": [], " + + "\"Results\": " + new Gson().toJson(results) + "}}"); + } + + @Test + public void shouldReturnResults() { + JsonArray results = new JsonArray(); + JsonObject r1 = new JsonObject(); + r1.addProperty("_ref", "/tag/12345"); + results.add(r1); + JsonObject r2 = new JsonObject(); + r2.addProperty("_ref", "/tag/23456"); + results.add(r2); + + CollectionUpdateResponse r = createResponse(new String[]{}, results); + + Assert.assertEquals(r.getErrors().length, 0, "Error length correct"); + Assert.assertEquals(r.getResults().size(), 2, "Result length correct"); + Assert.assertEquals(r.getResults().get(0).getAsJsonObject().get("_ref").getAsString(), "/tag/12345", "First result correct"); + Assert.assertEquals(r.getResults().get(1).getAsJsonObject().get("_ref").getAsString(), "/tag/23456", "Second result correct"); + Assert.assertTrue(r.wasSuccessful()); + } + + @Test + public void shouldReturnNoErrors() { + CollectionUpdateResponse r = createResponse(new String[]{"Foo"}, new JsonArray()); + + Assert.assertEquals(r.getErrors().length, 1, "Error length correct"); + Assert.assertEquals(r.getErrors()[0], "Foo"); + Assert.assertFalse(r.wasSuccessful()); + Assert.assertEquals(r.getResults().size(), 0); + } +} diff --git a/src/test/java/com/rallydev/rest/response/CreateResponseTest.java b/src/test/java/com/rallydev/rest/response/CreateResponseTest.java new file mode 100644 index 0000000..59ffd61 --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/CreateResponseTest.java @@ -0,0 +1,32 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class CreateResponseTest { + private CreateResponse createResponse(String[] errors, String result) { + return new CreateResponse("{\"CreateResult\": { \"Errors\": " + new Gson().toJson(errors) + ", \"Warnings\": [], \"Object\": " + + result + "}}"); + } + + @Test + public void shouldReturnCreatedObject() { + CreateResponse createResponse = createResponse(new String[]{}, "{\"Foo\": 7}"); + + Assert.assertEquals(createResponse.getErrors().length, 0, "Error length correct"); + Assert.assertEquals(createResponse.getWarnings().length, 0, "Warning length correct"); + Assert.assertNotNull(createResponse.getObject()); + Assert.assertEquals(createResponse.getObject().get("Foo").getAsInt(), 7); + Assert.assertTrue(createResponse.wasSuccessful()); + } + + @Test + public void shouldReturnErrors() { + CreateResponse createResponse = createResponse(new String[]{"Foo"}, "{}"); + String[] errors = createResponse.getErrors(); + Assert.assertEquals(errors.length, 1, "Error length correct"); + Assert.assertFalse(createResponse.wasSuccessful()); + Assert.assertNull(createResponse.getObject()); + } +} diff --git a/src/test/java/com/rallydev/rest/response/DeleteResponseTest.java b/src/test/java/com/rallydev/rest/response/DeleteResponseTest.java new file mode 100644 index 0000000..d8c736d --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/DeleteResponseTest.java @@ -0,0 +1,31 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class DeleteResponseTest { + + private DeleteResponse createResponse(String[] errors) { + return new DeleteResponse("{\"OperationResult\": { \"Errors\": " + new Gson().toJson(errors) + "}}"); + } + + @Test + public void shouldReturnErrors() { + DeleteResponse r = createResponse(new String[]{"Foo", "Bar"}); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 2, "Error length correct"); + Assert.assertFalse(r.wasSuccessful(), "Successful correct"); + Assert.assertEquals(errors[0], "Foo", "First error correct"); + Assert.assertEquals(errors[1], "Bar", "Second error correct"); + } + + @Test + public void shouldReturnNoErrors() { + DeleteResponse r = createResponse(new String[]{}); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 0, "Error length correct"); + Assert.assertTrue(r.wasSuccessful(), "Successful correct"); + } + +} diff --git a/src/test/java/com/rallydev/rest/response/GetResponseTest.java b/src/test/java/com/rallydev/rest/response/GetResponseTest.java new file mode 100644 index 0000000..9f70a0c --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/GetResponseTest.java @@ -0,0 +1,35 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class GetResponseTest { + + private GetResponse createResponse(String[] errors) { + return new GetResponse("{\"" + (errors.length > 0 ? "OperationResult" : "Defect") + + "\": { \"Errors\": " + new Gson().toJson(errors) + ", \"Foo\": \"Bar\"}}"); + } + + @Test + public void shouldReturnErrors() { + GetResponse r = createResponse(new String[]{"Foo", "Bar"}); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 2, "Error length correct"); + Assert.assertFalse(r.wasSuccessful(), "Successful correct"); + Assert.assertEquals(errors[0], "Foo", "First error correct"); + Assert.assertEquals(errors[1], "Bar", "Second error correct"); + Assert.assertNull(r.getObject()); + } + + @Test + public void shouldReturnNoErrors() { + GetResponse r = createResponse(new String[]{}); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 0, "Error length correct"); + Assert.assertTrue(r.wasSuccessful(), "Successful correct"); + Assert.assertNotNull(r.getObject()); + Assert.assertEquals(r.getObject().get("Foo").getAsString(), "Bar"); + } + +} diff --git a/src/test/java/com/rallydev/rest/response/QueryResponseTest.java b/src/test/java/com/rallydev/rest/response/QueryResponseTest.java new file mode 100644 index 0000000..c4b7c04 --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/QueryResponseTest.java @@ -0,0 +1,47 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class QueryResponseTest { + private QueryResponse createResponse(String[] errors, JsonArray results) { + return new QueryResponse("{\"QueryResult\": { \"Errors\": " + new Gson().toJson(errors) + ", \"Warnings\": [], \"TotalResultCount\": " + + results.size() + ", \"Results\": " + new Gson().toJson(results) + ", \"PageSize\": 20, \"StartIndex\": 1}}"); + } + + @Test + public void shouldReturnResults() { + JsonArray results = new JsonArray(); + JsonObject r1 = new JsonObject(); + r1.addProperty("Foo", 7); + results.add(r1); + JsonObject r2 = new JsonObject(); + r2.addProperty("Foo", 1); + results.add(r2); + + QueryResponse r = createResponse(new String[]{}, results); + + Assert.assertEquals(r.getErrors().length, 0, "Error length correct"); + Assert.assertEquals(r.getTotalResultCount(), 2, "Total result count correct"); + Assert.assertEquals(r.getResults().size(), 2, "Result length correct"); + Assert.assertEquals(r.getResults().get(0).getAsJsonObject().get("Foo").getAsInt(), 7, "First result correct"); + Assert.assertEquals(r.getResults().get(1).getAsJsonObject().get("Foo").getAsInt(), 1, "First result correct"); + Assert.assertTrue(r.wasSuccessful()); + Assert.assertEquals(r.getPageSize(), 20); + Assert.assertEquals(r.getStart(), 1); + } + + @Test + public void shouldReturnNoErrors() { + QueryResponse r = createResponse(new String[]{"Foo"}, new JsonArray()); + + Assert.assertEquals(r.getErrors().length, 1, "Error length correct"); + Assert.assertEquals(r.getErrors()[0], "Foo"); + Assert.assertFalse(r.wasSuccessful()); + Assert.assertEquals(r.getTotalResultCount(), 0); + Assert.assertEquals(r.getResults().size(), 0); + } +} diff --git a/src/test/java/com/rallydev/rest/response/ResponseTest.java b/src/test/java/com/rallydev/rest/response/ResponseTest.java new file mode 100644 index 0000000..180acfb --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/ResponseTest.java @@ -0,0 +1,50 @@ +package com.rallydev.rest.response; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class ResponseTest { + + private Response createResponse(String response) { + return new Response("{\"Root\": " + response + "}") { + @Override + public String getRoot() { + return "Root"; + } + }; + } + + @Test + public void shouldReturnErrors() { + Response r = createResponse("{\"Errors\": [\"Foo\", \"Bar\"]}"); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 2, "Error length correct"); + Assert.assertFalse(r.wasSuccessful(), "Successful correct"); + Assert.assertEquals(errors[0], "Foo", "First error correct"); + Assert.assertEquals(errors[1], "Bar", "Second error correct"); + } + + @Test + public void shouldReturnNoErrors() { + Response r = createResponse("{\"Errors\": []}"); + String[] errors = r.getErrors(); + Assert.assertEquals(errors.length, 0, "Error length correct"); + Assert.assertTrue(r.wasSuccessful(), "Successful correct"); + } + + @Test + public void shouldReturnWarnings() { + Response r = createResponse("{\"Warnings\": [\"Foo\", \"Bar\"]}"); + String[] warnings = r.getWarnings(); + Assert.assertEquals(warnings.length, 2, "Error length correct"); + Assert.assertEquals(warnings[0], "Foo", "First error correct"); + Assert.assertEquals(warnings[1], "Bar", "Second error correct"); + } + + @Test + public void shouldReturnNoWarnings() { + Response r = createResponse("{\"Warnings\": []}"); + String[] warnings = r.getWarnings(); + Assert.assertEquals(warnings.length, 0, "Warning length correct"); + } +} diff --git a/src/test/java/com/rallydev/rest/response/UpdateResponseTest.java b/src/test/java/com/rallydev/rest/response/UpdateResponseTest.java new file mode 100644 index 0000000..82c08eb --- /dev/null +++ b/src/test/java/com/rallydev/rest/response/UpdateResponseTest.java @@ -0,0 +1,32 @@ +package com.rallydev.rest.response; + +import com.google.gson.Gson; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class UpdateResponseTest { + private UpdateResponse UpdateResponse(String[] errors, String result) { + return new UpdateResponse("{\"OperationResult\": { \"Errors\": " + new Gson().toJson(errors) + ", \"Warnings\": [], \"Object\": " + + result + "}}"); + } + + @Test + public void shouldReturnUpdatedObject() { + UpdateResponse UpdateResponse = UpdateResponse(new String[]{}, "{\"Foo\": 7}"); + + Assert.assertEquals(UpdateResponse.getErrors().length, 0, "Error length correct"); + Assert.assertEquals(UpdateResponse.getWarnings().length, 0, "Warning length correct"); + Assert.assertNotNull(UpdateResponse.getObject()); + Assert.assertEquals(UpdateResponse.getObject().get("Foo").getAsInt(), 7); + Assert.assertTrue(UpdateResponse.wasSuccessful()); + } + + @Test + public void shouldReturnErrors() { + UpdateResponse UpdateResponse = UpdateResponse(new String[]{"Foo"}, "{}"); + String[] errors = UpdateResponse.getErrors(); + Assert.assertEquals(errors.length, 1, "Error length correct"); + Assert.assertFalse(UpdateResponse.wasSuccessful()); + Assert.assertNull(UpdateResponse.getObject()); + } +} diff --git a/src/test/java/com/rallydev/rest/util/FetchTest.java b/src/test/java/com/rallydev/rest/util/FetchTest.java new file mode 100644 index 0000000..d13e6d6 --- /dev/null +++ b/src/test/java/com/rallydev/rest/util/FetchTest.java @@ -0,0 +1,31 @@ +package com.rallydev.rest.util; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class FetchTest { + + @Test + public void shouldProvideCorrectDefaultFetch() { + Fetch f = new Fetch(); + Assert.assertEquals(f.toString(), "true"); + } + + @Test + public void shouldProvideCorrectFetch() { + Fetch f = new Fetch("Name", "Description", "ScheduleState"); + Assert.assertEquals(f.toString(), "Name,Description,ScheduleState"); + } + + @Test + public void shouldBeAbleToAddRemoveFetch() { + Fetch f = new Fetch("Name", "Description", "ScheduleState"); + String fetch = f.toString(); + f.add("Foo"); + Assert.assertEquals(f.toString(), fetch + ",Foo"); + f.remove("Foo"); + Assert.assertEquals(f.toString(), fetch); + f.clear(); + Assert.assertEquals(f.toString(), "true"); + } +} diff --git a/src/test/java/com/rallydev/rest/util/QueryFilterTest.java b/src/test/java/com/rallydev/rest/util/QueryFilterTest.java new file mode 100644 index 0000000..10cc106 --- /dev/null +++ b/src/test/java/com/rallydev/rest/util/QueryFilterTest.java @@ -0,0 +1,72 @@ +package com.rallydev.rest.util; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class QueryFilterTest { + + @Test + public void shouldCreateCorrectQueryForString() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar"); + Assert.assertEquals(q.toString(), "(Foo = Bar)", "String value query correct"); + } + + @Test + public void shouldCreateCorrectQueryForNull() { + QueryFilter q = new QueryFilter("Foo", "=", null); + Assert.assertEquals(q.toString(), "(Foo = null)", "Null value query correct"); + } + + @Test + public void shouldCreateQuotedQueryForStringWithSpaces() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar Baz"); + Assert.assertEquals(q.toString(), "(Foo = \"Bar Baz\")", "String value with spaces query correct"); + } + + @Test + public void shouldCreateCorrectQueryForRef() { + String relativeRef = "/hierarchicalrequirement/1234"; + QueryFilter q = new QueryFilter("Parent", "=", relativeRef); + QueryFilter q2 = new QueryFilter("Parent", "=", "https://rally1.rallydev.com/slm/webservice/1.32" + relativeRef); + Assert.assertEquals(q.toString(), "(Parent = " + relativeRef + ")", "Relative ref value correct"); + Assert.assertEquals(q2.toString(), "(Parent = " + relativeRef + ")", "Absolute ref value correct"); + } + + @Test + public void shouldCreateCorrectQueryForNumber() { + QueryFilter q = new QueryFilter("Foo", ">", "6"); + Assert.assertEquals(q.toString(), "(Foo > 6)", "Numeric value with spaces query correct"); + } + + @Test + public void shouldCreateCorrectAndedQuery() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar"); + QueryFilter q2 = q.and(new QueryFilter("Bar", "=", "Baz")); + Assert.assertEquals(q2.toString(), "((Foo = Bar) AND (Bar = Baz))"); + } + + @Test + public void shouldCreateCorrectStaticAndedQuery() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar"); + QueryFilter q2 = new QueryFilter("Bar", "=", "Baz"); + QueryFilter q3 = new QueryFilter("Baz", "=", "Foo"); + Assert.assertEquals(QueryFilter.and(q, q2, q3).toString(), "(((Foo = Bar) AND (Bar = Baz)) AND (Baz = Foo))"); + Assert.assertNull(QueryFilter.and()); + } + + @Test + public void shouldCreateCorrectOredQuery() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar"); + QueryFilter q2 = q.or(new QueryFilter("Bar", "=", "Baz")); + Assert.assertEquals(q2.toString(), "((Foo = Bar) OR (Bar = Baz))"); + } + + @Test + public void shouldCreateCorrectStaticOredQuery() { + QueryFilter q = new QueryFilter("Foo", "=", "Bar"); + QueryFilter q2 = new QueryFilter("Bar", "=", "Baz"); + QueryFilter q3 = new QueryFilter("Baz", "=", "Foo"); + Assert.assertEquals(QueryFilter.or(q, q2, q3).toString(), "(((Foo = Bar) OR (Bar = Baz)) OR (Baz = Foo))"); + Assert.assertNull(QueryFilter.or()); + } +} diff --git a/src/test/java/com/rallydev/rest/util/RefTest.java b/src/test/java/com/rallydev/rest/util/RefTest.java new file mode 100644 index 0000000..272a895 --- /dev/null +++ b/src/test/java/com/rallydev/rest/util/RefTest.java @@ -0,0 +1,125 @@ +package com.rallydev.rest.util; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class RefTest { + + @Test + public void shouldDetectValidRefs() { + Assert.assertTrue(Ref.isRef("/defect/1234"), "Valid relative ref"); + Assert.assertTrue(Ref.isRef("/defect/1234.js"), "Valid relative ref w/ extension"); + Assert.assertTrue(Ref.isRef("/typedefinition/-1234.js"), "Valid relative built-in typedef ref"); + Assert.assertTrue(Ref.isRef("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234"), "Valid absolute ref"); + Assert.assertTrue(Ref.isRef("http://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js"), "Valid absolute ref w/ extension"); + } + + @Test + public void shouldDetectValidDynatypeRefs() { + Assert.assertTrue(Ref.isRef("/portfolioitem/feature/1234"), "Valid relative ref"); + Assert.assertTrue(Ref.isRef("/portfolioitem/feature/1234.js"), "Valid relative ref w/ extension"); + Assert.assertTrue(Ref.isRef("https://rally1.rallydev.com/slm/webservice/1.32/portfolioitem/feature/1234"), "Valid absolute ref"); + Assert.assertTrue(Ref.isRef("http://rally1.rallydev.com/slm/webservice/1.32/portfolioitem/feature/1234.js"), "Valid absolute ref w/ extension"); + } + + @Test + public void shouldDetectInvalidRefs() { + Assert.assertFalse(Ref.isRef("/defect"), "Invalid ref"); + Assert.assertFalse(Ref.isRef("https://rally1.rallydev.com/slm/webservice/1.32/defect/abc.js"), "Invalid ref"); + Assert.assertFalse(Ref.isRef(null), "A null ref"); + Assert.assertFalse(Ref.isRef(""), "An empty string"); + } + + @Test + public void shouldReturnValidRelativeRefs() { + Assert.assertEquals(Ref.getRelativeRef("/defect/1234"), "/defect/1234", "Already relative ref"); + Assert.assertEquals(Ref.getRelativeRef("/defect/1234.js"), "/defect/1234", "Already relative ref"); + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234"), "/defect/1234", "Absolute ref"); + } + + @Test + public void shouldReturnValidDynatypeRelativeRefs() { + Assert.assertEquals(Ref.getRelativeRef("/portfolioitem/feature/1234"), "/portfolioitem/feature/1234", "Already relative ref"); + Assert.assertEquals(Ref.getRelativeRef("/portfolioitem/feature/1234.js"), "/portfolioitem/feature/1234", "Already relative ref"); + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.32/portfolioitem/feature/1234"), "/portfolioitem/feature/1234", "Absolute ref"); + } + + @Test + public void shouldReturnNullRelativeRefs() { + Assert.assertNull(Ref.getRelativeRef("blah"), "Not a ref"); + Assert.assertNull(Ref.getRelativeRef(""), "Empty ref"); + Assert.assertNull(Ref.getRelativeRef(null), "null ref"); + } + + @Test + public void shouldReturnTypesFromRefs() { + Assert.assertEquals(Ref.getTypeFromRef("/defect/1234"), "defect", "Relative ref"); + Assert.assertEquals(Ref.getTypeFromRef("/defect/1234.js"), "defect", "Relative ref with extension"); + Assert.assertEquals(Ref.getTypeFromRef("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234"), "defect", "Valid absolute ref"); + } + + @Test + public void shouldReturnTypesFromDynatypeRefs() { + Assert.assertEquals(Ref.getTypeFromRef("/portfolioitem/feature/1234"), "portfolioitem/feature", "Relative ref"); + Assert.assertEquals(Ref.getTypeFromRef("/portfolioitem/feature/1234.js"), "portfolioitem/feature", "Relative ref with extension"); + Assert.assertEquals(Ref.getTypeFromRef("https://rally1.rallydev.com/slm/webservice/1.32/portfolioitem/feature/1234"), "portfolioitem/feature", "Valid absolute ref"); + } + + @Test + public void shouldReturnNullTypesFromRefs() { + Assert.assertNull(Ref.getTypeFromRef("blah"), "Not a ref"); + Assert.assertNull(Ref.getTypeFromRef(""), "Empty ref"); + Assert.assertNull(Ref.getTypeFromRef(null), "null ref"); + } + + @Test + public void shouldReturnOidsFromRefs() { + Assert.assertEquals(Ref.getOidFromRef("/defect/1234"), "1234", "Relative ref"); + Assert.assertEquals(Ref.getOidFromRef("/defect/1234.js"), "1234", "Relative ref with extension"); + Assert.assertEquals(Ref.getOidFromRef("/typedefinition/-1234.js"), "-1234", "Relative built-in typedef ref"); + Assert.assertEquals(Ref.getOidFromRef("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234"), "1234", "Valid absolute ref"); + } + + @Test + public void shouldReturnOidsFromDynatypeRefs() { + Assert.assertEquals(Ref.getOidFromRef("/portfolioitem/feature/1234"), "1234", "Relative ref"); + Assert.assertEquals(Ref.getOidFromRef("/portfolioitem/feature/1234.js"), "1234", "Relative ref with extension"); + Assert.assertEquals(Ref.getOidFromRef("https://rally1.rallydev.com/slm/webservice/1.32/portfolioitem/feature/1234"), "1234", "Valid absolute ref"); + } + + @Test + public void shouldReturnNullOidsFromRefs() { + Assert.assertNull(Ref.getOidFromRef("blah"), "Not a ref"); + Assert.assertNull(Ref.getOidFromRef(""), "Empty ref"); + Assert.assertNull(Ref.getOidFromRef(null), "null ref"); + } + + @Test + public void shouldSupportWsapiVersionXinRefs() { + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/x/portfolioitem/feature/1234"), "/portfolioitem/feature/1234", "Valid absolute version x dynatype ref"); + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/x/defect/1234"), "/defect/1234", "Valid absolute version x ref"); + } + + @Test + public void shouldSupportWorkspacePermissionRefs() { + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.38/workspacepermission/123u456w1"), "/workspacepermission/123u456w1", "Valid workspace permission ref"); + Assert.assertEquals(Ref.getOidFromRef("/workspacepermission/123u456w1.js"), "123u456w1", "Get oid from workspace permission ref"); + Assert.assertEquals(Ref.getTypeFromRef("/workspacepermission/123u456w1.js"), "workspacepermission", "Get type from workspace permission ref"); + } + + @Test + public void shouldSupportProjectPermissionRefs() { + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.38/projectpermission/123u456p1"), "/projectpermission/123u456p1", "Valid project permission ref"); + Assert.assertEquals(Ref.getOidFromRef("/projectpermission/123u456p1.js"), "123u456p1", "Get oid from project permission ref"); + Assert.assertEquals(Ref.getTypeFromRef("/projectpermission/123u456p1.js"), "projectpermission", "Get type from project permission ref"); + } + + @Test + public void shouldSupportCollectionRefs() { + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.38/defect/1234/tasks"), "/defect/1234/tasks", "Valid collection ref"); + Assert.assertEquals(Ref.getRelativeRef("/defect/1234/tasks"), "/defect/1234/tasks", "Valid relative collection ref"); + Assert.assertEquals(Ref.getRelativeRef("https://rally1.rallydev.com/slm/webservice/1.38/portfolioitem/feature/1234/children"), "/portfolioitem/feature/1234/children", "Valid dynatype collection ref"); + Assert.assertEquals(Ref.getRelativeRef("/portfolioitem/feature/1234/children"), "/portfolioitem/feature/1234/children", "Valid dynatype relative collection ref"); + Assert.assertEquals(Ref.getRelativeRef("/typedefinition/-12345/attributes"), "/typedefinition/-12345/attributes", "Valid built-in type def attributes relative collection ref"); + } +} From 3cb8b4f12f6b7c1d07fef663d980447b6e0f5c13 Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Feb 2017 14:29:08 -0600 Subject: [PATCH 3/9] Removing unneeded plugins --- pom.xml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/pom.xml b/pom.xml index 4c8291a..f27b220 100644 --- a/pom.xml +++ b/pom.xml @@ -62,30 +62,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.2 - true - - sonatype-nexus-staging - - https://oss.sonatype.org/ - - From 21ce00ea83bb624ba07f4bfd94db8e36dffab16b Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Mar 2017 14:10:40 -0500 Subject: [PATCH 4/9] S104525 - Rally Task Migration Added bulk update to rally jar. --- .../java/com/rallydev/rest/RallyRestApi.java | 12 ++++ .../request/BulkUserPermissionRequest.java | 66 +++++++++++++++++++ .../com/rallydev/rest/response/Response.java | 13 ++-- 3 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java diff --git a/src/main/java/com/rallydev/rest/RallyRestApi.java b/src/main/java/com/rallydev/rest/RallyRestApi.java index c3fa7ab..160240e 100644 --- a/src/main/java/com/rallydev/rest/RallyRestApi.java +++ b/src/main/java/com/rallydev/rest/RallyRestApi.java @@ -8,6 +8,7 @@ import com.rallydev.rest.client.ApiKeyClient; import com.rallydev.rest.client.BasicAuthClient; import com.rallydev.rest.client.HttpClient; +import com.rallydev.rest.request.BulkUserPermissionRequest; import com.rallydev.rest.request.CollectionUpdateRequest; import com.rallydev.rest.request.CreateRequest; import com.rallydev.rest.request.DeleteRequest; @@ -233,6 +234,17 @@ public GetResponse get(GetRequest request) throws IOException { return new GetResponse(client.doGet(request.toUrl())); } + /** + * Bulk update a given user's project permissions. + * + * @param request + * @return + * @throws IOException + */ + public CollectionUpdateResponse bulkUpdate(BulkUserPermissionRequest request) throws IOException { + return new CollectionUpdateResponse(client.doPost(request.toUrl(), "")); + } + /** * Release all resources associated with this instance. * diff --git a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java new file mode 100644 index 0000000..7ceda16 --- /dev/null +++ b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java @@ -0,0 +1,66 @@ +package com.rallydev.rest.request; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; + +/** + * Represents a WSAPI request to bulk provision a user. + */ +public class BulkUserPermissionRequest extends Request { + + private static final String PROJECTPERMISSION_BULKUPDATE = "/projectpermission/bulkupdate"; + + private String userOID; + private Collection excludedProjectOIDs; + private String rootProjectOID; + private String permission; + private boolean forceDowngradePermissions; + + /** + * + * @param userOID + * The OID (ObjectID) of the User who will be granted new project permissions + * @param excludedRootProjectOIDs + * The OIDs of any child Project (or a child of a child, or any ancestor to any level) under the root project which are to be excluded from the + * permission change operation. + * @param rootProjectOID + * The OID of the root of the Project tree of which to change the permissions for the given user.  The user's Project permission for all Projects + * rooted at this one will be changed, unless (see below for further explanation) + * the Project is on the exclusions list, or + * the operation would result in a downgrade but the force downgrade parameters was not set to tree. + * @param permission + * The permission to grant.  Must be one of No Access, Viewer, Editor, or Project Admin. + * @param forceDowngradePermissions + * If you intend to downgrade any existing project permissions, set this to true. + */ + public BulkUserPermissionRequest(String userOID, Collection excludedProjectOIDs, String rootProjectOID, String permission, + boolean forceDowngradePermissions) { + super(); + this.userOID = userOID; + this.excludedProjectOIDs = excludedProjectOIDs; + this.rootProjectOID = rootProjectOID; + this.permission = permission; + this.forceDowngradePermissions = forceDowngradePermissions; + } + + @Override + public String toUrl() { + List params = new ArrayList(getParams()); + params.add(new BasicNameValuePair("userOID", userOID)); + params.add(new BasicNameValuePair("rootProjectOID", rootProjectOID)); + params.add(new BasicNameValuePair("permission", permission)); + params.add(new BasicNameValuePair("forceDowngradePermissions", Boolean.toString(forceDowngradePermissions))); + + if (excludedProjectOIDs != null && !excludedProjectOIDs.isEmpty()) { + params.add(new BasicNameValuePair("excludedRootProjectOIDs", String.join(",", excludedProjectOIDs))); + } + + return String.format("%s?%s", PROJECTPERMISSION_BULKUPDATE, URLEncodedUtils.format(params, "utf-8")); + } + +} diff --git a/src/main/java/com/rallydev/rest/response/Response.java b/src/main/java/com/rallydev/rest/response/Response.java index de1123a..30190d0 100644 --- a/src/main/java/com/rallydev/rest/response/Response.java +++ b/src/main/java/com/rallydev/rest/response/Response.java @@ -1,17 +1,20 @@ package com.rallydev.rest.response; +import java.util.ArrayList; +import java.util.List; + import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import java.util.ArrayList; -import java.util.List; - /** * Represents a WSAPI response. */ public abstract class Response { + private static final String ERRORS = "Errors"; + private static final String WARNINGS = "Warnings"; + protected JsonObject result; protected String raw; @@ -40,7 +43,7 @@ public boolean wasSuccessful() { * @return the response errors */ public String[] getErrors() { - return parseArray("Errors"); + return result.has(ERRORS) ? parseArray(ERRORS) : new String[0]; } /** @@ -49,7 +52,7 @@ public String[] getErrors() { * @return the response warnings */ public String[] getWarnings() { - return parseArray("Warnings"); + return result.has(WARNINGS) ? parseArray(WARNINGS) : new String[0]; } /** From 5323158fca3baf7db8917723b2bb6e62ea0a1fc6 Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Mar 2017 14:16:35 -0500 Subject: [PATCH 5/9] S104525 - Rally Task Migration Added bulk update to rally jar. --- .../com/rallydev/rest/request/BulkUserPermissionRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java index 7ceda16..c7ccd9f 100644 --- a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java +++ b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java @@ -34,7 +34,7 @@ public class BulkUserPermissionRequest extends Request { * the Project is on the exclusions list, or * the operation would result in a downgrade but the force downgrade parameters was not set to tree. * @param permission - * The permission to grant.  Must be one of No Access, Viewer, Editor, or Project Admin. + * The permission to grant.  Must be one of No Access, Viewer, Editor, or Project Admin. * @param forceDowngradePermissions * If you intend to downgrade any existing project permissions, set this to true. */ From 26ab1b7697093d193b604fd0d2a5439e49a3e16e Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Mar 2017 14:20:15 -0500 Subject: [PATCH 6/9] S104525 - Rally Task Migration UTF8 encoding issues. --- .../rallydev/rest/request/BulkUserPermissionRequest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java index c7ccd9f..b4b135b 100644 --- a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java +++ b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java @@ -29,14 +29,14 @@ public class BulkUserPermissionRequest extends Request { * The OIDs of any child Project (or a child of a child, or any ancestor to any level) under the root project which are to be excluded from the * permission change operation. * @param rootProjectOID - * The OID of the root of the Project tree of which to change the permissions for the given user.  The user's Project permission for all Projects - * rooted at this one will be changed, unless (see below for further explanation) + * The OID of the root of the Project tree of which to change the permissions for the given user. The user's Project permission for all Projects + * rooted at this one will be changed, unless (see below for further explanation) * the Project is on the exclusions list, or * the operation would result in a downgrade but the force downgrade parameters was not set to tree. * @param permission - * The permission to grant.  Must be one of No Access, Viewer, Editor, or Project Admin. + * The permission to grant. Must be one of No Access, Viewer, Editor, or Project Admin. * @param forceDowngradePermissions - * If you intend to downgrade any existing project permissions, set this to true. + * If you intend to downgrade any existing project permissions, set this to true. */ public BulkUserPermissionRequest(String userOID, Collection excludedProjectOIDs, String rootProjectOID, String permission, boolean forceDowngradePermissions) { From a6d508df3d0b2992f0651648d57a06cad6e5e5c7 Mon Sep 17 00:00:00 2001 From: e035214 Date: Fri, 24 Mar 2017 14:24:09 -0500 Subject: [PATCH 7/9] S104525 - Rally Task Migration JavaDoc issues. --- src/main/java/com/rallydev/rest/RallyRestApi.java | 6 +++--- .../rest/request/BulkUserPermissionRequest.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/rallydev/rest/RallyRestApi.java b/src/main/java/com/rallydev/rest/RallyRestApi.java index 160240e..253adbd 100644 --- a/src/main/java/com/rallydev/rest/RallyRestApi.java +++ b/src/main/java/com/rallydev/rest/RallyRestApi.java @@ -237,9 +237,9 @@ public GetResponse get(GetRequest request) throws IOException { /** * Bulk update a given user's project permissions. * - * @param request - * @return - * @throws IOException + * @param request request the {@link BulkUserPermissionRequest} specifying the object to be retrieved. + * @return the resulting {@link CollectionUpdateResponse} + * @throws IOException if an error occurs during the retrieval. */ public CollectionUpdateResponse bulkUpdate(BulkUserPermissionRequest request) throws IOException { return new CollectionUpdateResponse(client.doPost(request.toUrl(), "")); diff --git a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java index b4b135b..ffe2753 100644 --- a/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java +++ b/src/main/java/com/rallydev/rest/request/BulkUserPermissionRequest.java @@ -16,7 +16,7 @@ public class BulkUserPermissionRequest extends Request { private static final String PROJECTPERMISSION_BULKUPDATE = "/projectpermission/bulkupdate"; private String userOID; - private Collection excludedProjectOIDs; + private Collection excludedRootProjectOIDs; private String rootProjectOID; private String permission; private boolean forceDowngradePermissions; @@ -38,11 +38,11 @@ public class BulkUserPermissionRequest extends Request { * @param forceDowngradePermissions * If you intend to downgrade any existing project permissions, set this to true. */ - public BulkUserPermissionRequest(String userOID, Collection excludedProjectOIDs, String rootProjectOID, String permission, + public BulkUserPermissionRequest(String userOID, Collection excludedRootProjectOIDs, String rootProjectOID, String permission, boolean forceDowngradePermissions) { super(); this.userOID = userOID; - this.excludedProjectOIDs = excludedProjectOIDs; + this.excludedRootProjectOIDs = excludedRootProjectOIDs; this.rootProjectOID = rootProjectOID; this.permission = permission; this.forceDowngradePermissions = forceDowngradePermissions; @@ -56,8 +56,8 @@ public String toUrl() { params.add(new BasicNameValuePair("permission", permission)); params.add(new BasicNameValuePair("forceDowngradePermissions", Boolean.toString(forceDowngradePermissions))); - if (excludedProjectOIDs != null && !excludedProjectOIDs.isEmpty()) { - params.add(new BasicNameValuePair("excludedRootProjectOIDs", String.join(",", excludedProjectOIDs))); + if (excludedRootProjectOIDs != null && !excludedRootProjectOIDs.isEmpty()) { + params.add(new BasicNameValuePair("excludedRootProjectOIDs", String.join(",", excludedRootProjectOIDs))); } return String.format("%s?%s", PROJECTPERMISSION_BULKUPDATE, URLEncodedUtils.format(params, "utf-8")); From 2db70945609bd71b373f4db37942ef8de9b4910c Mon Sep 17 00:00:00 2001 From: e035214 Date: Tue, 28 Mar 2017 18:34:16 -0500 Subject: [PATCH 8/9] Added BulkPermissionTests and Synchronization around security token retrieval --- .../rallydev/rest/client/BasicAuthClient.java | 16 +++-- .../com/rallydev/rest/RallyRestApiTest.java | 58 ++++++++++++++----- .../BulkUserPermissionRequestTest.java | 28 +++++++++ 3 files changed, 82 insertions(+), 20 deletions(-) create mode 100644 src/test/java/com/rallydev/rest/request/BulkUserPermissionRequestTest.java diff --git a/src/main/java/com/rallydev/rest/client/BasicAuthClient.java b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java index 215e506..36d0430 100644 --- a/src/main/java/com/rallydev/rest/client/BasicAuthClient.java +++ b/src/main/java/com/rallydev/rest/client/BasicAuthClient.java @@ -26,6 +26,8 @@ public class BasicAuthClient extends HttpClient { protected String securityToken; protected Credentials credentials; + private Object privateLock = new Object(); + /** * Construct a new client. * @param server the server to connect to @@ -91,12 +93,14 @@ protected String doRequest(HttpRequestBase request) throws IOException { protected void attachSecurityInfo(HttpRequestBase request) throws IOException, URISyntaxException { if (!SECURITY_ENDPOINT_DOES_NOT_EXIST.equals(securityToken)) { try { - if (securityToken == null) { - HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL); - GetResponse getResponse = new GetResponse(doRequest(httpGet)); - JsonObject operationResult = getResponse.getObject(); - JsonPrimitive securityTokenPrimitive = operationResult.getAsJsonPrimitive(SECURITY_TOKEN_KEY); - securityToken = securityTokenPrimitive.getAsString(); + synchronized (privateLock) { + if (securityToken == null) { + HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL); + GetResponse getResponse = new GetResponse(doRequest(httpGet)); + JsonObject operationResult = getResponse.getObject(); + JsonPrimitive securityTokenPrimitive = operationResult.getAsJsonPrimitive(SECURITY_TOKEN_KEY); + securityToken = securityTokenPrimitive.getAsString(); + } } request.setURI(new URIBuilder(request.getURI()).addParameter(SECURITY_TOKEN_PARAM_KEY, securityToken).build()); } catch (IOException e) { diff --git a/src/test/java/com/rallydev/rest/RallyRestApiTest.java b/src/test/java/com/rallydev/rest/RallyRestApiTest.java index eba2d1c..b5ccda1 100644 --- a/src/test/java/com/rallydev/rest/RallyRestApiTest.java +++ b/src/test/java/com/rallydev/rest/RallyRestApiTest.java @@ -1,25 +1,37 @@ package com.rallydev.rest; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.rallydev.rest.client.ApiKeyClient; -import com.rallydev.rest.client.BasicAuthClient; -import com.rallydev.rest.request.*; -import com.rallydev.rest.response.*; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.mockito.Mockito.anyString; +import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.testng.Assert.assertEquals; +import java.net.URI; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.rallydev.rest.client.ApiKeyClient; +import com.rallydev.rest.client.BasicAuthClient; +import com.rallydev.rest.request.BulkUserPermissionRequest; +import com.rallydev.rest.request.CollectionUpdateRequest; +import com.rallydev.rest.request.CreateRequest; +import com.rallydev.rest.request.DeleteRequest; +import com.rallydev.rest.request.GetRequest; +import com.rallydev.rest.request.QueryRequest; +import com.rallydev.rest.request.UpdateRequest; +import com.rallydev.rest.response.CollectionUpdateResponse; +import com.rallydev.rest.response.CreateResponse; +import com.rallydev.rest.response.DeleteResponse; +import com.rallydev.rest.response.GetResponse; +import com.rallydev.rest.response.QueryResponse; +import com.rallydev.rest.response.UpdateResponse; + @Test public class RallyRestApiTest { private RallyRestApi api; @@ -125,6 +137,24 @@ public void shouldUpdate() throws Exception { assertEquals(obj.get("_ref").getAsString(), "/defect/1234"); } + public void shouldBulkUserPermissionUpdate() throws Exception { + JsonObject response = new JsonObject(); + JsonObject updateResult = new JsonObject(); + response.add("OperationResult", updateResult); + JsonArray results = new JsonArray(); + JsonObject tag = new JsonObject(); + tag.addProperty("_ref", "/tag/23456"); + results.add(tag); + response.add("Results", results); + + BulkUserPermissionRequest request = new BulkUserPermissionRequest("1234,", null, "111", "Viewer", false); + doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), ""); + CollectionUpdateResponse collectionUpdateResponse = api.bulkUpdate(request); + + verify(api.client).doPost(request.toUrl(), ""); + Assert.assertTrue(collectionUpdateResponse.wasSuccessful()); + } + public void shouldUpdateCollection() throws Exception { JsonObject response = new JsonObject(); JsonObject result = new JsonObject(); diff --git a/src/test/java/com/rallydev/rest/request/BulkUserPermissionRequestTest.java b/src/test/java/com/rallydev/rest/request/BulkUserPermissionRequestTest.java new file mode 100644 index 0000000..084f2fc --- /dev/null +++ b/src/test/java/com/rallydev/rest/request/BulkUserPermissionRequestTest.java @@ -0,0 +1,28 @@ +package com.rallydev.rest.request; + +import java.util.Arrays; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class BulkUserPermissionRequestTest { + + @Test + public void shouldConstructCorrectURL_NoExcludes_Viewer() { + BulkUserPermissionRequest req = new BulkUserPermissionRequest("1234", null, "12345", "Viewer", false); + Assert.assertEquals(req.toUrl(), "/projectpermission/bulkupdate?userOID=1234&rootProjectOID=12345&permission=Viewer&forceDowngradePermissions=false"); + } + + @Test + public void shouldConstructCorrectURL_NoExcludes_Editor() { + BulkUserPermissionRequest req = new BulkUserPermissionRequest("1234", null, "12345", "Editor", false); + Assert.assertEquals(req.toUrl(), "/projectpermission/bulkupdate?userOID=1234&rootProjectOID=12345&permission=Editor&forceDowngradePermissions=false"); + } + + @Test + public void shouldConstructCorrectURL_Editor() { + BulkUserPermissionRequest req = new BulkUserPermissionRequest("1234", Arrays.asList("1122", "1133"), "12345", "Editor", false); + Assert.assertEquals(req.toUrl(), + "/projectpermission/bulkupdate?userOID=1234&rootProjectOID=12345&permission=Editor&forceDowngradePermissions=false&excludedRootProjectOIDs=1122%2C1133"); + } +} From 3880af23480320ca2391c261bb40afa23d2fef92 Mon Sep 17 00:00:00 2001 From: e035214 Date: Tue, 28 Mar 2017 19:00:25 -0500 Subject: [PATCH 9/9] Removing unneeded files --- .classpath | 32 -------------------------------- .gitignore | 6 ------ .project | 36 ------------------------------------ 3 files changed, 74 deletions(-) delete mode 100644 .classpath delete mode 100644 .gitignore delete mode 100644 .project diff --git a/.classpath b/.classpath deleted file mode 100644 index 8b5a9fa..0000000 --- a/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e0213e1..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -out/ -.DS_Store -/target -.idea -*.iws -/test-output/ diff --git a/.project b/.project deleted file mode 100644 index 00e227e..0000000 --- a/.project +++ /dev/null @@ -1,36 +0,0 @@ - - - RallyRestToolkitForJava - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - -