org.nuiton.jredmine
Class DefaultRedmineService

java.lang.Object
  extended by org.nuiton.jredmine.DefaultRedmineAnonymousService
      extended by org.nuiton.jredmine.DefaultRedmineService
All Implemented Interfaces:
RedmineAnonymousService, RedmineLogguedService, RedmineService, RedmineServiceImplementor

public class DefaultRedmineService
extends DefaultRedmineAnonymousService
implements RedmineService

Default RedmineService implementation based on a RestClient

Since:
1.0.0
Author:
tchemit
Plexus component:
role:
"org.nuiton.jredmine.RedmineService"
role-hint:
"default"

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.nuiton.jredmine.DefaultRedmineAnonymousService
delegateImplementor
 
Fields inherited from interface org.nuiton.jredmine.RedmineService
ROLE
 
Constructor Summary
DefaultRedmineService()
           
 
Method Summary
 Attachment addAttachment(String projectName, String versionName, Attachment attachement)
          Add a attachment for a given version of a given project.
 TimeEntry addIssueTimeEntry(String projectName, String issueId, TimeEntry entry)
          Add a new time entry to the given issue for the given project and return the updated time entry.
 News addNews(String projectName, News news)
          Add a news for a given project.
 Version addVersion(String projectName, Version version)
          Add a version for a given project.
 Project[] getUserProjects()
          Obtain for the loggued user, all projets where he belongs.
 RedmineServiceImplementor init(org.nuiton.io.rest.RestClient session)
          Initialize the service given a redmine client already initialized.
 RedmineServiceImplementor init(org.nuiton.io.rest.RestClientConfiguration configuration)
          Initialize the service given a client configuration.
 Version nextVersion(String projectName, String oldVersionName, Version newVersion)
          Prepare a new version (create it or update it).
 Version updateVersion(String projectName, Version version)
          Update a version for a given project.
 
Methods inherited from class org.nuiton.jredmine.DefaultRedmineAnonymousService
checkLoggued, checkNotLoggued, destroy, getAttachments, getClosedIssues, getData, getDatas, getIssueCategories, getIssuePriorities, getIssues, getIssues, getIssueStatuses, getIssueTimeEntries, getNews, getOpenedIssues, getProject, getProjectMembers, getProjects, getTrackers, getVersion, getVersions, isInit, sendData, sendDatas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuiton.jredmine.RedmineAnonymousService
getAttachments, getClosedIssues, getIssueCategories, getIssuePriorities, getIssues, getIssues, getIssueStatuses, getIssueTimeEntries, getNews, getOpenedIssues, getProject, getProjectMembers, getProjects, getTrackers, getVersion, getVersions
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

DefaultRedmineService

public DefaultRedmineService()
Method Detail

init

public RedmineServiceImplementor init(org.nuiton.io.rest.RestClientConfiguration configuration)
                               throws RedmineServiceException
Description copied from interface: RedmineServiceImplementor
Initialize the service given a client configuration.

Specified by:
init in interface RedmineServiceImplementor
Overrides:
init in class DefaultRedmineAnonymousService
Parameters:
configuration - the configuration to be used to init the internal redmine client
Returns:
the initialized service
Throws:
RedmineServiceException - if any pb

init

public RedmineServiceImplementor init(org.nuiton.io.rest.RestClient session)
                               throws RedmineServiceException
Description copied from interface: RedmineServiceImplementor
Initialize the service given a redmine client already initialized.

Specified by:
init in interface RedmineServiceImplementor
Overrides:
init in class DefaultRedmineAnonymousService
Parameters:
session - the redmine client to be used by the service
Returns:
the initialized service
Throws:
RedmineServiceException - if any pb
See Also:
RedmineRestClient

getUserProjects

public Project[] getUserProjects()
                          throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Obtain for the loggued user, all projets where he belongs.

Note: This method requires to be loggued on redmine server.

Specified by:
getUserProjects in interface RedmineLogguedService
Returns:
all the projects belonged by the loggued user
Throws:
RedmineServiceException - if any pb while retriving datas
See Also:
Project

addVersion

public Version addVersion(String projectName,
                          Version version)
                   throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Add a version for a given project.

b>Note: This method requires to be loggued on redmine server.

Specified by:
addVersion in interface RedmineLogguedService
Parameters:
projectName - the name of the project
version - the version to add
Returns:
the added version
Throws:
RedmineServiceException - if any pb while sending and retriving datas to redmine server
See Also:
Version

updateVersion

public Version updateVersion(String projectName,
                             Version version)
                      throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Update a version for a given project.

b>Note: This method requires to be loggued on redmine server.

Specified by:
updateVersion in interface RedmineLogguedService
Parameters:
projectName - the name of the project
version - the version to update
Returns:
the updated version
Throws:
RedmineServiceException - if any pb while sending and retriving datas to redmine server
See Also:
Version

nextVersion

public Version nextVersion(String projectName,
                           String oldVersionName,
                           Version newVersion)
                    throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Prepare a new version (create it or update it).

If the oldVersionName is given, then all issues unclosed from this old version will be move to the new version.

b>Note: This method requires to be loggued on redmine server.

Specified by:
nextVersion in interface RedmineLogguedService
Parameters:
projectName - the name of the project
oldVersionName - the name of the old version (optional)
newVersion - the newVersion to create or update
Returns:
the created version
Throws:
RedmineServiceException - if any pb while sending and retriving datas to redmine server
See Also:
Version

addAttachment

public Attachment addAttachment(String projectName,
                                String versionName,
                                Attachment attachement)
                         throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Add a attachment for a given version of a given project.

b>Note: This method requires to be loggued on redmine server.

Specified by:
addAttachment in interface RedmineLogguedService
Parameters:
projectName - the name of the project
versionName - the name of the version
attachement - the attachment to add
Returns:
the added attachment
Throws:
RedmineServiceException - if any pb while sending and retriving datas to redmine server
See Also:
Attachment

addNews

public News addNews(String projectName,
                    News news)
             throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Add a news for a given project.

b>Note: This method requires to be loggued on redmine server.

Specified by:
addNews in interface RedmineLogguedService
Parameters:
projectName - the name of the project
news - the news to add
Returns:
the added news.
Throws:
RedmineServiceException - if any pb while sending and retriving datas to redmine server
See Also:
News

addIssueTimeEntry

public TimeEntry addIssueTimeEntry(String projectName,
                                   String issueId,
                                   TimeEntry entry)
                            throws RedmineServiceException
Description copied from interface: RedmineLogguedService
Add a new time entry to the given issue for the given project and return the updated time entry.

b>Note: This method requires to be loggued on redmine server.

Specified by:
addIssueTimeEntry in interface RedmineLogguedService
Parameters:
projectName - the name of the project
issueId - the id of the issue to update
entry - time entry to add
Returns:
the created time entry
Throws:
RedmineServiceException - if any pb while sending or retrieving datas to redmine server
See Also:
Issue, TimeEntry


Copyright © 2009-2012 CodeLutin. All Rights Reserved.