public class RallyRestApi extends Object implements Closeable
The main interface to the Rest API.
Provides CRUD and query operations.
Constructor and Description |
---|
RallyRestApi(URI server,
String apiKey)
Creates a new instance for the specified server using the specified API Key.
|
RallyRestApi(URI server,
String userName,
String password)
Deprecated.
Use the api key constructor instead.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Release all resources associated with this instance.
|
CreateResponse |
create(CreateRequest request)
Create the specified object.
|
DeleteResponse |
delete(DeleteRequest request)
Delete the specified object.
|
GetResponse |
get(GetRequest request)
Get the specified object.
|
HttpClient |
getClient()
Get the underlying http client implementation.
|
String |
getWsapiVersion()
Get the current version of the WSAPI being targeted.
|
QueryResponse |
query(QueryRequest request)
Query for objects matching the specified request.
|
void |
setApplicationName(String value)
Set the value of the X-RallyIntegrationName header included on all requests.
|
void |
setApplicationVendor(String value)
Set the value of the X-RallyIntegrationVendor header included on all requests.
|
void |
setApplicationVersion(String value)
Set the value of the X-RallyIntegrationVersion header included on all requests.
|
void |
setProxy(URI proxy)
Set the unauthenticated proxy server to use.
|
void |
setProxy(URI proxy,
String userName,
String password)
Set the authenticated proxy server to use.
|
void |
setWsapiVersion(String wsapiVersion)
Set the current version of the WSAPI being targeted.
|
UpdateResponse |
update(UpdateRequest request)
Update the specified object.
|
public RallyRestApi(URI server, String userName, String password)
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.public void setProxy(URI proxy)
proxy
- The proxy server, e.g. new URI("http://my.proxy.com:8000")
public void setProxy(URI proxy, String userName, String password)
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.public void setApplicationVendor(String value)
value
- The vendor header to be included on all requests.public void setApplicationVersion(String value)
value
- The vendor header to be included on all requests.public void setApplicationName(String value)
value
- The vendor header to be included on all requests.public String getWsapiVersion()
public void setWsapiVersion(String wsapiVersion)
wsapiVersion
- the new version, e.g. "1.30"
public CreateResponse create(CreateRequest request) throws IOException
request
- the CreateRequest
specifying the object to be created.CreateResponse
IOException
- if an error occurs during the creation.public UpdateResponse update(UpdateRequest request) throws IOException
request
- the UpdateRequest
specifying the object to be updated.UpdateResponse
IOException
- if an error occurs during the update.public DeleteResponse delete(DeleteRequest request) throws IOException
request
- the DeleteRequest
specifying the object to be deleted.DeleteResponse
IOException
- if an error occurs during the deletion.public QueryResponse query(QueryRequest request) throws IOException
request
- the QueryRequest
specifying the object to be created.QueryResponse
IOException
- if an error occurs during the query.public GetResponse get(GetRequest request) throws IOException
request
- the GetRequest
specifying the object to be retrieved.GetResponse
IOException
- if an error occurs during the retrieval.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an error occurs releasing resourcespublic HttpClient getClient()