org.mantis.ta
Class MantisManager

java.lang.Object
  extended by org.mantis.ta.MantisManager

public class MantisManager
extends Object

Entry point for the API: use this class to communicate with Mantis SOAP services.

Author:
Maxim Zyukin

Constructor Summary
MantisManager(String uri)
          Creates an instance of MantisManager.
MantisManager(String uri, String login, String password)
           
 
Method Summary
 BigInteger createIssue(IssueData issue)
          Creates a new issue.
 BigInteger createProject(ProjectData project)
          Creates a new project.
 BigInteger createRelationship(BigInteger issueId, RelationshipData relation)
          Add the specified issue's relationship.
 boolean deleteIssue(BigInteger issueId)
          Deletes the specified issue.
 boolean deleteProject(BigInteger projectId)
          Deletes the project.
 boolean deleteRelationship(BigInteger issueId, BigInteger relationshipId)
          Deletes the specified issue's relationship.
 AccountData getCurrentUser()
          Tries to get user info based on login information in MantisManage class.
 IssueData getIssueById(BigInteger issueId)
          Retrieves the issue by identified.
 IssueData getIssueBySummary(String summary)
          Tries to find an issue by summary.
 List<IssueData> getIssuesByProject(BigInteger projectId)
          Retrieves issues for the specified project.
 List<IssueHeaderData> getIssuesHeadersByProject(BigInteger projectId)
          Retrieves issues headers for the specified project.
 int getItemsPerPage()
           
 ProjectData getProjectById(BigInteger projectId)
          Returns the project by identifier.
 List<ProjectData> getProjects()
          Returns list of projects which are accessible for the current user.
 AccountData getUserById(BigInteger userId)
          Retrieves the selected user.
 List<AccountData> getUsers()
          Retrieves the user list.
 String getVersion()
          Returns version of Mantis server.
 void setItemsPerPage(int itemsPerPage)
           
 boolean updateIssue(BigInteger issueId, IssueData issue)
          Updates the specified issue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MantisManager

public MantisManager(String uri)
Creates an instance of MantisManager.

Parameters:
uri - complete Mantis server web URI including protocol and port number. Example: http://localhost:8008/

MantisManager

public MantisManager(String uri,
                     String login,
                     String password)
Method Detail

getVersion

public String getVersion()
                  throws RemoteException,
                         javax.xml.rpc.ServiceException
Returns version of Mantis server.

Returns:
Mantis server version
Throws:
RemoteException
javax.xml.rpc.ServiceException

getItemsPerPage

public int getItemsPerPage()

setItemsPerPage

public void setItemsPerPage(int itemsPerPage)

getProjects

public List<ProjectData> getProjects()
                              throws RemoteException,
                                     javax.xml.rpc.ServiceException
Returns list of projects which are accessible for the current user.

Returns:
List of projects.
Throws:
RemoteException
javax.xml.rpc.ServiceException

getProjectById

public ProjectData getProjectById(BigInteger projectId)
                           throws RemoteException,
                                  javax.xml.rpc.ServiceException
Returns the project by identifier.

Parameters:
projectId - The project identifier.
Returns:
Project instance.
Throws:
RemoteException
javax.xml.rpc.ServiceException

createProject

public BigInteger createProject(ProjectData project)
                         throws RemoteException,
                                javax.xml.rpc.ServiceException,
                                RequiredItemException
Creates a new project.

Parameters:
project - The project to create.
Returns:
Project with projectId property.
Throws:
RemoteException
javax.xml.rpc.ServiceException
RequiredItemException

deleteProject

public boolean deleteProject(BigInteger projectId)
                      throws RemoteException,
                             javax.xml.rpc.ServiceException
Deletes the project.

Parameters:
projectId - The project to delete.
Returns:
True if the project deleted successfully.
Throws:
RemoteException
javax.xml.rpc.ServiceException

getIssuesHeadersByProject

public List<IssueHeaderData> getIssuesHeadersByProject(BigInteger projectId)
                                                throws RemoteException,
                                                       javax.xml.rpc.ServiceException
Retrieves issues headers for the specified project.

Parameters:
projectId -
Returns:
Issues headers list.
Throws:
RemoteException
javax.xml.rpc.ServiceException

getIssuesByProject

public List<IssueData> getIssuesByProject(BigInteger projectId)
                                   throws RemoteException,
                                          javax.xml.rpc.ServiceException
Retrieves issues for the specified project.

Parameters:
projectId -
Returns:
Issues list.
Throws:
RemoteException
javax.xml.rpc.ServiceException

getIssueById

public IssueData getIssueById(BigInteger issueId)
                       throws RemoteException,
                              javax.xml.rpc.ServiceException
Retrieves the issue by identified.

Parameters:
issueId -
Returns:
Throws:
RemoteException
javax.xml.rpc.ServiceException

getIssueBySummary

public IssueData getIssueBySummary(String summary)
                            throws RemoteException,
                                   javax.xml.rpc.ServiceException
Tries to find an issue by summary.

Parameters:
summary -
Returns:
Throws:
RemoteException
javax.xml.rpc.ServiceException

createIssue

public BigInteger createIssue(IssueData issue)
                       throws RemoteException,
                              javax.xml.rpc.ServiceException,
                              RequiredItemException
Creates a new issue.

Parameters:
issue -
Returns:
The issue with specified issueId.
Throws:
RemoteException
javax.xml.rpc.ServiceException
RequiredItemException

updateIssue

public boolean updateIssue(BigInteger issueId,
                           IssueData issue)
                    throws RemoteException,
                           javax.xml.rpc.ServiceException
Updates the specified issue.

Parameters:
issueId -
issue -
Returns:
True if the issue updated successfully.
Throws:
RemoteException
javax.xml.rpc.ServiceException

deleteIssue

public boolean deleteIssue(BigInteger issueId)
                    throws RemoteException,
                           javax.xml.rpc.ServiceException
Deletes the specified issue.

Parameters:
issueId -
Returns:
True if the issue deleted successfully.
Throws:
RemoteException
javax.xml.rpc.ServiceException

createRelationship

public BigInteger createRelationship(BigInteger issueId,
                                     RelationshipData relation)
                              throws RemoteException,
                                     javax.xml.rpc.ServiceException
Add the specified issue's relationship.

Parameters:
issueId -
relation -
Returns:
True if the relationship created successfully.
Throws:
RemoteException
javax.xml.rpc.ServiceException

deleteRelationship

public boolean deleteRelationship(BigInteger issueId,
                                  BigInteger relationshipId)
                           throws RemoteException,
                                  javax.xml.rpc.ServiceException
Deletes the specified issue's relationship.

Parameters:
issueId -
Returns:
True if the relationship deleted successfully.
Throws:
RemoteException
javax.xml.rpc.ServiceException

getUsers

public List<AccountData> getUsers()
                           throws RemoteException,
                                  javax.xml.rpc.ServiceException
Retrieves the user list. This operation requires "Mantis Administrator" permission.

Returns:
Throws:
RemoteException
javax.xml.rpc.ServiceException

getUserById

public AccountData getUserById(BigInteger userId)
                        throws RemoteException,
                               javax.xml.rpc.ServiceException
Retrieves the selected user.

Parameters:
userId -
Returns:
Throws:
RemoteException
javax.xml.rpc.ServiceException

getCurrentUser

public AccountData getCurrentUser()
                           throws RemoteException,
                                  javax.xml.rpc.ServiceException
Tries to get user info based on login information in MantisManage class.

Returns:
Throws:
RemoteException
javax.xml.rpc.ServiceException


Copyright © 2011. All Rights Reserved.