|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.redmine.ta.RedmineManager
public class RedmineManager
Entry point for the API: use this class to communicate with Redmine servers.
| Nested Class Summary | |
|---|---|
static class |
RedmineManager.INCLUDE
|
| Constructor Summary | |
|---|---|
RedmineManager(String uri)
|
|
RedmineManager(String host,
String apiAccessKey)
Creates an instance of RedmineManager class. |
|
RedmineManager(String uri,
String login,
String password)
|
|
| Method Summary | |
|---|---|
Issue |
createIssue(String projectKey,
Issue issue)
Sample usage: |
Project |
createProject(Project project)
Sample usage: |
IssueRelation |
createRelation(String projectKey,
Integer issueId,
Integer issueToId,
String type)
|
TimeEntry |
createTimeEntry(TimeEntry obj)
|
User |
createUser(User user)
|
void |
deleteIssue(Integer id)
|
void |
deleteProject(String projectKey)
|
void |
deleteTimeEntry(Integer id)
|
User |
getCurrentUser()
|
Issue |
getIssueById(Integer id,
RedmineManager.INCLUDE... include)
|
List<Issue> |
getIssues(Map<String,String> pParameters)
Generic method to search for issues. |
List<Issue> |
getIssues(String projectKey,
Integer queryId,
RedmineManager.INCLUDE... include)
|
List<Issue> |
getIssuesBySummary(String projectKey,
String summaryField)
There could be several issues with the same summary, so the method returns List. |
int |
getObjectsPerPage()
This number of objects (tasks, projects, users) will be requested from Redmine server in 1 request. |
Project |
getProjectByKey(String projectKey)
|
List<Project> |
getProjects()
Load the list of projects available to the user, which is represented by the API access key. |
List<SavedQuery> |
getSavedQueries()
Get all "saved queries" available to the current user. |
List<SavedQuery> |
getSavedQueries(String projectKey)
Get "saved queries" for the given project available to the current user. |
List<TimeEntry> |
getTimeEntries()
|
List<TimeEntry> |
getTimeEntriesForIssue(Integer issueId)
|
TimeEntry |
getTimeEntry(Integer id)
|
User |
getUserById(Integer userId)
|
List<User> |
getUsers()
Load the list of users on the server. |
void |
setObjectsPerPage(int pageSize)
This number of objects (tasks, projects, users) will be requested from Redmine server in 1 request. |
void |
updateIssue(Issue issue)
Note: This method cannot return the updated Issue from Redmine because the server does not provide any XML in response. |
void |
updateProject(Project project)
|
void |
updateTimeEntry(TimeEntry obj)
|
void |
updateUser(User user)
This method cannot return the updated object from Redmine because the server does not provide any XML in response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RedmineManager(String uri)
public RedmineManager(String host,
String apiAccessKey)
host - complete Redmine server web URI, including protocol and port number. Example: http://demo.redmine.org:8080apiAccessKey - Redmine API access key. It is shown on "My Account" / "API access key" webpage
(check http://redmine_server_url/my/account URL).
This parameter is optional (can be set to NULL) for Redmine projects, which are "public".
public RedmineManager(String uri,
String login,
String password)
| Method Detail |
|---|
public Issue createIssue(String projectKey,
Issue issue)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);
projectKey - The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.issue - the Issue object to create on the server.
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException - the project with the given projectKey is not found
RedmineException
public void updateIssue(Issue issue)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
issue - the Issue to update on the server. issue.getId() is used for identification.
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException - the issue with the required ID is not found
RedmineException
public List<Project> getProjects()
throws IOException,
AuthenticationException,
RedmineException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
RedmineException
NotFoundException
IOException
public List<Issue> getIssuesBySummary(String projectKey,
String summaryField)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
summaryField -
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException
RedmineException
IOException
public List<Issue> getIssues(Map<String,String> pParameters)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
pParameters - the http parameters key/value pairs to append to the rest api request
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException
RedmineException
IOException
public Issue getIssueById(Integer id,
RedmineManager.INCLUDE... include)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
id - the Redmine issue IDinclude - list of "includes". e.g. "relations", "journals", ...
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException - the issue with the given id is not found on the server
RedmineException
public Project getProjectByKey(String projectKey)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
projectKey - string key like "project-ABC", NOT a database numeric ID
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException - the project with the given key is not found
RedmineException
IOException
public void deleteProject(String projectKey)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
projectKey - string key like "project-ABC", NOT a database numeric ID
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException - if the project with the given key is not found
RedmineException
IOException
public void deleteIssue(Integer id)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public List<Issue> getIssues(String projectKey,
Integer queryId,
RedmineManager.INCLUDE... include)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
projectKey - queryId - id of the saved query in Redmine. the query must be accessible to the user
represented by the API access key (if the Redmine project requires authorization).
This parameter is optional, NULL can be provided to get all available issues.
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
RedmineException
NotFoundExceptionIssue
public Project createProject(Project project)
throws IOException,
AuthenticationException,
RedmineException
Project project = new Project();
Long timeStamp = Calendar.getInstance().getTimeInMillis();
String key = "projkey" + timeStamp;
String name = "project number " + timeStamp;
String description = "some description for the project";
project.setIdentifier(key);
project.setName(name);
project.setDescription(description);
Project createdProject = mgr.createProject(project);
project - project to create on the server
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
RedmineException
public void updateProject(Project project)
throws IOException,
AuthenticationException,
RedmineException,
NotFoundException
project -
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
RedmineException
NotFoundExceptionpublic int getObjectsPerPage()
public void setObjectsPerPage(int pageSize)
public List<User> getUsers()
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
This operation requires "Redmine Administrator" permission.
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
NotFoundException
RedmineException
IOException
public User getUserById(Integer userId)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public User getCurrentUser()
throws IOException,
AuthenticationException,
RedmineException
IOException
AuthenticationException
RedmineException
public User createUser(User user)
throws IOException,
AuthenticationException,
RedmineException,
NotFoundException
IOException
AuthenticationException
RedmineException
NotFoundException
public void updateUser(User user)
throws IOException,
AuthenticationException,
RedmineException,
NotFoundException
user -
IOException
AuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.
RedmineException
NotFoundException - some object is not found. e.g. the user with the given id
public List<TimeEntry> getTimeEntries()
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public TimeEntry getTimeEntry(Integer id)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
id - the database Id of the TimeEntry record
IOException
AuthenticationException
NotFoundException
RedmineException
public List<TimeEntry> getTimeEntriesForIssue(Integer issueId)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public TimeEntry createTimeEntry(TimeEntry obj)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public void updateTimeEntry(TimeEntry obj)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public void deleteTimeEntry(Integer id)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
public List<SavedQuery> getSavedQueries(String projectKey)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737
IOException
AuthenticationException
NotFoundException
RedmineException
public List<SavedQuery> getSavedQueries()
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737
IOException
AuthenticationException
NotFoundException
RedmineException
public IssueRelation createRelation(String projectKey,
Integer issueId,
Integer issueToId,
String type)
throws IOException,
AuthenticationException,
NotFoundException,
RedmineException
IOException
AuthenticationException
NotFoundException
RedmineException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||