@@ -373,10 +373,10 @@ public ProjectAccount assignAccountToProject(Project project, long accountId, Pr
373373
374374 @ Override
375375 @ DB
376- public Project deleteAccountFromProject (final long projectId , final long accountId ) {
377- return Transaction .execute (new TransactionCallback <Project >() {
376+ public boolean deleteAccountFromProject (final long projectId , final long accountId ) {
377+ return Transaction .execute (new TransactionCallback <Boolean >() {
378378 @ Override
379- public Project doInTransaction (TransactionStatus status ) {
379+ public Boolean doInTransaction (TransactionStatus status ) {
380380 boolean success = true ;
381381
382382 //remove account
@@ -392,7 +392,7 @@ public Project doInTransaction(TransactionStatus status) {
392392 }
393393 }
394394
395- return success ? getProject ( projectAccount . getProjectId ()) : null ;
395+ return success ;
396396 }
397397 });
398398 }
@@ -514,7 +514,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Resour
514514
515515 @ Override
516516 @ ActionEvent (eventType = EventTypes .EVENT_PROJECT_ACCOUNT_ADD , eventDescription = "adding account to project" , async = true )
517- public Project addAccountToProject (long projectId , String accountName , String email ) {
517+ public boolean addAccountToProject (long projectId , String accountName , String email ) {
518518 Account caller = CallContext .current ().getCallingAccount ();
519519
520520 //check that the project exists
@@ -556,7 +556,7 @@ public Project addAccountToProject(long projectId, String accountName, String em
556556 ProjectAccount projectAccount = _projectAccountDao .findByProjectIdAccountId (projectId , account .getId ());
557557 if (projectAccount != null ) {
558558 s_logger .debug ("Account " + accountName + " already added to the project id=" + projectId );
559- return project ;
559+ return true ;
560560 }
561561 }
562562
@@ -567,41 +567,41 @@ public Project addAccountToProject(long projectId, String accountName, String em
567567 throw new InvalidParameterValueException ("Account information is required for assigning account to the project" );
568568 }
569569 if (assignAccountToProject (project , account .getId (), ProjectAccount .Role .Regular ) != null ) {
570- return project ;
570+ return true ;
571571 } else {
572572 s_logger .warn ("Failed to add account " + accountName + " to project id=" + projectId );
573- return null ;
573+ return false ;
574574 }
575575 }
576576 }
577577
578- private Project inviteAccountToProject (Project project , Account account , String email ) {
578+ private boolean inviteAccountToProject (Project project , Account account , String email ) {
579579 if (account != null ) {
580580 if (createAccountInvitation (project , account .getId ()) != null ) {
581- return project ;
581+ return true ;
582582 } else {
583583 s_logger .warn ("Failed to generate invitation for account " + account .getAccountName () + " to project id=" + project );
584- return null ;
584+ return false ;
585585 }
586586 }
587587
588588 if (email != null ) {
589589 //generate the token
590590 String token = generateToken (10 );
591591 if (generateTokenBasedInvitation (project , email , token ) != null ) {
592- return project ;
592+ return true ;
593593 } else {
594594 s_logger .warn ("Failed to generate invitation for email " + email + " to project id=" + project );
595- return null ;
595+ return false ;
596596 }
597597 }
598598
599- return null ;
599+ return false ;
600600 }
601601
602602 @ Override
603603 @ ActionEvent (eventType = EventTypes .EVENT_PROJECT_ACCOUNT_REMOVE , eventDescription = "removing account from project" , async = true )
604- public Project deleteAccountFromProject (long projectId , String accountName ) {
604+ public boolean deleteAccountFromProject (long projectId , String accountName ) {
605605 Account caller = CallContext .current ().getCallingAccount ();
606606
607607 //check that the project exists
@@ -725,7 +725,7 @@ private boolean expireInvitation(ProjectInvitationVO invite) {
725725 @ Override
726726 @ DB
727727 @ ActionEvent (eventType = EventTypes .EVENT_PROJECT_INVITATION_UPDATE , eventDescription = "updating project invitation" , async = true )
728- public Project updateInvitation (final long projectId , String accountName , String token , final boolean accept ) {
728+ public boolean updateInvitation (final long projectId , String accountName , String token , final boolean accept ) {
729729 Account caller = CallContext .current ().getCallingAccount ();
730730 Long accountId = null ;
731731 boolean result = true ;
@@ -806,7 +806,7 @@ public Boolean doInTransaction(TransactionStatus status) {
806806 throw new InvalidParameterValueException ("Unable to find invitation for account name=" + accountName + " to the project id=" + projectId );
807807 }
808808
809- return result ? project : null ;
809+ return result ;
810810 }
811811
812812 @ Override
0 commit comments