com.silverpeas.socialnetwork.invitation
Class InvitationService

java.lang.Object
  extended by com.silverpeas.socialnetwork.invitation.InvitationService

@Named
public class InvitationService
extends Object

Author:
Bensalem Nabil

Constructor Summary
InvitationService()
          Default Constructor
 
Method Summary
 int accepteInvitation(int idInvitation)
          accept invitation between sender and receiver and create the relationship
 List<Invitation> getAllMyInvitationsReceive(int myId)
          return All my invitations received
 List<Invitation> getAllMyInvitationsSent(int userId)
          return all my invitations sent
 Invitation getInvitation(int id)
          rturn invitation by her id
 Invitation getInvitation(int senderId, int receiverId)
          rturn invitation between 2 users
 RelationShip getRelationShip(int relationShipId)
           
 void ignoreInvitation(int id)
          ignore this invitation
 int invite(Invitation invitation)
          send invitation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvitationService

public InvitationService()
Default Constructor

Method Detail

invite

public int invite(Invitation invitation)
send invitation

Parameters:
invitation - an Invitation object
Returns:
the following integer value
  • -1 if the invitation already exists
  • -2 if the relationShip already exists
  • the id of invitation if the adding has been done successfully

ignoreInvitation

public void ignoreInvitation(int id)
ignore this invitation

Parameters:
id - : the invitation identifier to ignore (delete)

accepteInvitation

public int accepteInvitation(int idInvitation)
accept invitation between sender and receiver and create the relationship

Parameters:
idInvitation -
Returns:
-1 if this Invitation not exists, -2 if the RelationShip already exists, else the id of RelationShip if the action has been done successfully

getAllMyInvitationsSent

public List<Invitation> getAllMyInvitationsSent(int userId)
return all my invitations sent

Parameters:
userId - the user identifier
Returns:
List

getAllMyInvitationsReceive

public List<Invitation> getAllMyInvitationsReceive(int myId)
return All my invitations received

Parameters:
myId -
Returns:

getInvitation

public Invitation getInvitation(int id)
rturn invitation by her id

Parameters:
senderId -
receiverId -
Returns:
Invitation

getInvitation

public Invitation getInvitation(int senderId,
                                int receiverId)
rturn invitation between 2 users

Parameters:
senderId -
receiverId -
Returns:
Invitation

getRelationShip

public RelationShip getRelationShip(int relationShipId)
Parameters:
relationShipId - the relationship identifier
Returns:
a RelationShip


Copyright © 2016 Silverpeas. All Rights Reserved.