com.atlassian.theplugin.commons.crucible
Class CrucibleServerFacadeImpl

java.lang.Object
  extended by com.atlassian.theplugin.commons.crucible.CrucibleServerFacadeImpl
All Implemented Interfaces:
CrucibleServerFacade, ProductServerFacade

public final class CrucibleServerFacadeImpl
extends java.lang.Object
implements CrucibleServerFacade


Method Summary
 Review abandonReview(CrucibleServerCfg server, PermId permId)
           
 GeneralComment addGeneralComment(CrucibleServerCfg server, PermId permId, GeneralComment comment)
           
 GeneralComment addGeneralCommentReply(CrucibleServerCfg server, PermId id, PermId cId, GeneralComment comment)
           
 Review addPatchToReview(CrucibleServerCfg server, PermId permId, java.lang.String repository, java.lang.String patch)
           
 void addReviewers(CrucibleServerCfg server, PermId permId, java.util.Set<java.lang.String> userNames)
           
 Review addRevisionsToReview(CrucibleServerCfg server, PermId permId, java.lang.String repository, java.util.List<java.lang.String> revisions)
           
 VersionedComment addVersionedComment(CrucibleServerCfg server, PermId permId, PermId riId, VersionedComment comment)
           
 VersionedComment addVersionedCommentReply(CrucibleServerCfg server, PermId id, PermId cId, VersionedComment comment)
           
 Review approveReview(CrucibleServerCfg server, PermId permId)
           
 Review closeReview(CrucibleServerCfg server, PermId permId, java.lang.String summary)
           
 void completeReview(CrucibleServerCfg server, PermId permId, boolean complete)
           
 Review createReview(CrucibleServerCfg server, Review review)
          Creates new review in Crucible
 Review createReviewFromPatch(CrucibleServerCfg server, Review review, java.lang.String patch)
          Creates new review in Crucible
 Review createReviewFromRevision(CrucibleServerCfg server, Review review, java.util.List<java.lang.String> revisions)
           
 java.util.List<Review> getAllReviews(CrucibleServerCfg server)
           
 java.lang.String getDisplayName(CrucibleServerCfg server, java.lang.String username)
           
 java.util.Set<CrucibleFileInfo> getFiles(CrucibleServerCfg server, PermId permId)
           
 java.util.List<GeneralComment> getGeneralComments(CrucibleServerCfg server, PermId permId)
           
static CrucibleServerFacade getInstance()
           
 java.util.List<CustomFieldDef> getMetrics(CrucibleServerCfg server, int version)
           
 CrucibleProject getProject(CrucibleServerCfg server, java.lang.String projectKey)
           
 java.util.List<CrucibleProject> getProjects(CrucibleServerCfg server)
          Retrieves list of projects defined on Crucible server
 java.util.List<GeneralComment> getReplies(CrucibleServerCfg server, PermId permId, PermId commentId)
           
 java.util.List<Repository> getRepositories(CrucibleServerCfg server)
          Retrieves list of repositories defined on Crucible server
 SvnRepository getRepository(CrucibleServerCfg server, java.lang.String repoName)
           
 Review getReview(CrucibleServerCfg server, PermId permId)
           
 java.util.List<Reviewer> getReviewers(CrucibleServerCfg server, PermId permId)
           
 java.util.List<Review> getReviewsForCustomFilter(CrucibleServerCfg server, CustomFilter filter)
           
 java.util.List<Review> getReviewsForFilter(CrucibleServerCfg server, PredefinedFilter filter)
           
 ServerType getServerType()
           
 java.util.List<User> getUsers(CrucibleServerCfg server)
           
 java.util.List<VersionedComment> getVersionedComments(CrucibleServerCfg server, PermId permId)
           
 java.util.List<VersionedComment> getVersionedComments(CrucibleServerCfg server, PermId permId, PermId reviewItemId)
           
 void publishAllCommentsForReview(CrucibleServerCfg server, PermId reviewId)
           
 void publishComment(CrucibleServerCfg server, PermId reviewId, PermId commentId)
           
 Review recoverReview(CrucibleServerCfg server, PermId permId)
           
 void removeComment(CrucibleServerCfg server, PermId id, Comment comment)
           
 void removeReviewer(CrucibleServerCfg server, PermId permId, java.lang.String userName)
           
 Review reopenReview(CrucibleServerCfg server, PermId permId)
           
 void setCallback(HttpSessionCallback callback)
           
 void setUserCache(CrucibleUserCache newCache)
           
 Review submitReview(CrucibleServerCfg server, PermId permId)
           
 Review summarizeReview(CrucibleServerCfg server, PermId permId)
           
 void testServerConnection(ServerCfg serverCfg)
           
 void testServerConnection(java.lang.String url, java.lang.String userName, java.lang.String password)
          For testing Only
 void updateComment(CrucibleServerCfg server, PermId id, Comment comment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CrucibleServerFacade getInstance()

setUserCache

public void setUserCache(CrucibleUserCache newCache)

getServerType

public ServerType getServerType()
Specified by:
getServerType in interface ProductServerFacade

getDisplayName

@Nullable
public java.lang.String getDisplayName(@NotNull
                                                CrucibleServerCfg server,
                                                @NotNull
                                                java.lang.String username)
Specified by:
getDisplayName in interface CrucibleServerFacade

getProject

public CrucibleProject getProject(@NotNull
                                  CrucibleServerCfg server,
                                  @NotNull
                                  java.lang.String projectKey)
                           throws RemoteApiException,
                                  ServerPasswordNotProvidedException
Specified by:
getProject in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

testServerConnection

public void testServerConnection(java.lang.String url,
                                 java.lang.String userName,
                                 java.lang.String password)
                          throws RemoteApiException
For testing Only

Specified by:
testServerConnection in interface ProductServerFacade
Throws:
RemoteApiException
See Also:
ProductServerFacade.testServerConnection(java.lang.String, java.lang.String, java.lang.String)

testServerConnection

public void testServerConnection(ServerCfg serverCfg)
                          throws RemoteApiException
Specified by:
testServerConnection in interface ProductServerFacade
Parameters:
serverCfg - The configuration for the server that we want to test the connectio for
Throws:
CrucibleException
RemoteApiException

createReview

public Review createReview(CrucibleServerCfg server,
                           Review review)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Creates new review in Crucible

Specified by:
createReview in interface CrucibleServerFacade
Parameters:
server -
review - data for new review to create (some fields have to be set e.g. projectKey)
Returns:
created revew date
Throws:
CrucibleException - in case of createReview error or CrucibleLoginException in case of login error
RemoteApiException
ServerPasswordNotProvidedException

createReviewFromRevision

public Review createReviewFromRevision(CrucibleServerCfg server,
                                       Review review,
                                       java.util.List<java.lang.String> revisions)
                                throws RemoteApiException,
                                       ServerPasswordNotProvidedException
Specified by:
createReviewFromRevision in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addRevisionsToReview

public Review addRevisionsToReview(CrucibleServerCfg server,
                                   PermId permId,
                                   java.lang.String repository,
                                   java.util.List<java.lang.String> revisions)
                            throws RemoteApiException,
                                   ServerPasswordNotProvidedException
Specified by:
addRevisionsToReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addPatchToReview

public Review addPatchToReview(CrucibleServerCfg server,
                               PermId permId,
                               java.lang.String repository,
                               java.lang.String patch)
                        throws RemoteApiException,
                               ServerPasswordNotProvidedException
Specified by:
addPatchToReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addReviewers

public void addReviewers(CrucibleServerCfg server,
                         PermId permId,
                         java.util.Set<java.lang.String> userNames)
                  throws RemoteApiException,
                         ServerPasswordNotProvidedException
Specified by:
addReviewers in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

removeReviewer

public void removeReviewer(CrucibleServerCfg server,
                           PermId permId,
                           java.lang.String userName)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Specified by:
removeReviewer in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

approveReview

public Review approveReview(CrucibleServerCfg server,
                            PermId permId)
                     throws RemoteApiException,
                            ServerPasswordNotProvidedException
Specified by:
approveReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

submitReview

public Review submitReview(CrucibleServerCfg server,
                           PermId permId)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Specified by:
submitReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

summarizeReview

public Review summarizeReview(CrucibleServerCfg server,
                              PermId permId)
                       throws RemoteApiException,
                              ServerPasswordNotProvidedException
Specified by:
summarizeReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

abandonReview

public Review abandonReview(CrucibleServerCfg server,
                            PermId permId)
                     throws RemoteApiException,
                            ServerPasswordNotProvidedException
Specified by:
abandonReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

closeReview

public Review closeReview(CrucibleServerCfg server,
                          PermId permId,
                          java.lang.String summary)
                   throws RemoteApiException,
                          ServerPasswordNotProvidedException
Specified by:
closeReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

recoverReview

public Review recoverReview(CrucibleServerCfg server,
                            PermId permId)
                     throws RemoteApiException,
                            ServerPasswordNotProvidedException
Specified by:
recoverReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

reopenReview

public Review reopenReview(CrucibleServerCfg server,
                           PermId permId)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Specified by:
reopenReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

completeReview

public void completeReview(CrucibleServerCfg server,
                           PermId permId,
                           boolean complete)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Specified by:
completeReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

createReviewFromPatch

public Review createReviewFromPatch(CrucibleServerCfg server,
                                    Review review,
                                    java.lang.String patch)
                             throws RemoteApiException,
                                    ServerPasswordNotProvidedException
Creates new review in Crucible

Specified by:
createReviewFromPatch in interface CrucibleServerFacade
Parameters:
server -
review - data for new review to create (some fields have to be set e.g. projectKey)
patch - patch to assign with the review
Returns:
created revew date
Throws:
CrucibleException - in case of createReview error or CrucibleLoginException in case of login error
RemoteApiException
ServerPasswordNotProvidedException

getFiles

public java.util.Set<CrucibleFileInfo> getFiles(CrucibleServerCfg server,
                                                PermId permId)
                                         throws RemoteApiException,
                                                ServerPasswordNotProvidedException
Specified by:
getFiles in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getGeneralComments

public java.util.List<GeneralComment> getGeneralComments(CrucibleServerCfg server,
                                                         PermId permId)
                                                  throws RemoteApiException,
                                                         ServerPasswordNotProvidedException
Specified by:
getGeneralComments in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getVersionedComments

public java.util.List<VersionedComment> getVersionedComments(CrucibleServerCfg server,
                                                             PermId permId)
                                                      throws RemoteApiException,
                                                             ServerPasswordNotProvidedException
Specified by:
getVersionedComments in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getVersionedComments

public java.util.List<VersionedComment> getVersionedComments(CrucibleServerCfg server,
                                                             PermId permId,
                                                             PermId reviewItemId)
                                                      throws RemoteApiException,
                                                             ServerPasswordNotProvidedException
Specified by:
getVersionedComments in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getReplies

public java.util.List<GeneralComment> getReplies(CrucibleServerCfg server,
                                                 PermId permId,
                                                 PermId commentId)
                                          throws RemoteApiException,
                                                 ServerPasswordNotProvidedException
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addGeneralComment

public GeneralComment addGeneralComment(CrucibleServerCfg server,
                                        PermId permId,
                                        GeneralComment comment)
                                 throws RemoteApiException,
                                        ServerPasswordNotProvidedException
Specified by:
addGeneralComment in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addVersionedComment

public VersionedComment addVersionedComment(CrucibleServerCfg server,
                                            PermId permId,
                                            PermId riId,
                                            VersionedComment comment)
                                     throws RemoteApiException,
                                            ServerPasswordNotProvidedException
Specified by:
addVersionedComment in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

updateComment

public void updateComment(CrucibleServerCfg server,
                          PermId id,
                          Comment comment)
                   throws RemoteApiException,
                          ServerPasswordNotProvidedException
Specified by:
updateComment in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

publishComment

public void publishComment(CrucibleServerCfg server,
                           PermId reviewId,
                           PermId commentId)
                    throws RemoteApiException,
                           ServerPasswordNotProvidedException
Specified by:
publishComment in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

publishAllCommentsForReview

public void publishAllCommentsForReview(CrucibleServerCfg server,
                                        PermId reviewId)
                                 throws RemoteApiException,
                                        ServerPasswordNotProvidedException
Specified by:
publishAllCommentsForReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addGeneralCommentReply

public GeneralComment addGeneralCommentReply(CrucibleServerCfg server,
                                             PermId id,
                                             PermId cId,
                                             GeneralComment comment)
                                      throws RemoteApiException,
                                             ServerPasswordNotProvidedException
Specified by:
addGeneralCommentReply in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

addVersionedCommentReply

public VersionedComment addVersionedCommentReply(CrucibleServerCfg server,
                                                 PermId id,
                                                 PermId cId,
                                                 VersionedComment comment)
                                          throws RemoteApiException,
                                                 ServerPasswordNotProvidedException
Specified by:
addVersionedCommentReply in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

removeComment

public void removeComment(CrucibleServerCfg server,
                          PermId id,
                          Comment comment)
                   throws RemoteApiException,
                          ServerPasswordNotProvidedException
Specified by:
removeComment in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getUsers

public java.util.List<User> getUsers(CrucibleServerCfg server)
                              throws RemoteApiException,
                                     ServerPasswordNotProvidedException
Specified by:
getUsers in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getProjects

public java.util.List<CrucibleProject> getProjects(CrucibleServerCfg server)
                                            throws RemoteApiException,
                                                   ServerPasswordNotProvidedException
Retrieves list of projects defined on Crucible server

Specified by:
getProjects in interface CrucibleServerFacade
Parameters:
server -
Returns:
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getRepositories

public java.util.List<Repository> getRepositories(CrucibleServerCfg server)
                                           throws RemoteApiException,
                                                  ServerPasswordNotProvidedException
Retrieves list of repositories defined on Crucible server

Specified by:
getRepositories in interface CrucibleServerFacade
Parameters:
server -
Returns:
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getRepository

public SvnRepository getRepository(CrucibleServerCfg server,
                                   java.lang.String repoName)
                            throws RemoteApiException,
                                   ServerPasswordNotProvidedException
Specified by:
getRepository in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getMetrics

public java.util.List<CustomFieldDef> getMetrics(CrucibleServerCfg server,
                                                 int version)
                                          throws RemoteApiException,
                                                 ServerPasswordNotProvidedException
Specified by:
getMetrics in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getAllReviews

public java.util.List<Review> getAllReviews(CrucibleServerCfg server)
                                     throws RemoteApiException,
                                            ServerPasswordNotProvidedException
Specified by:
getAllReviews in interface CrucibleServerFacade
Parameters:
server - server object with Url, Login and Password to connect to
Returns:
List of reviews (empty list in case there is no review)
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getReviewsForFilter

public java.util.List<Review> getReviewsForFilter(CrucibleServerCfg server,
                                                  PredefinedFilter filter)
                                           throws RemoteApiException,
                                                  ServerPasswordNotProvidedException
Specified by:
getReviewsForFilter in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getReviewsForCustomFilter

public java.util.List<Review> getReviewsForCustomFilter(CrucibleServerCfg server,
                                                        CustomFilter filter)
                                                 throws RemoteApiException,
                                                        ServerPasswordNotProvidedException
Specified by:
getReviewsForCustomFilter in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getReview

public Review getReview(CrucibleServerCfg server,
                        PermId permId)
                 throws RemoteApiException,
                        ServerPasswordNotProvidedException
Specified by:
getReview in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

getReviewers

public java.util.List<Reviewer> getReviewers(CrucibleServerCfg server,
                                             PermId permId)
                                      throws RemoteApiException,
                                             ServerPasswordNotProvidedException
Specified by:
getReviewers in interface CrucibleServerFacade
Throws:
RemoteApiException
ServerPasswordNotProvidedException

setCallback

public void setCallback(HttpSessionCallback callback)
Specified by:
setCallback in interface CrucibleServerFacade


Copyright © 2008-2009 Atlassian Pty Ltd. All Rights Reserved.