Class InvitationService
- java.lang.Object
-
- org.silverpeas.core.socialnetwork.invitation.InvitationService
-
-
Field Summary
Fields Modifier and Type Field Description static int
INVITATION_ALREADY_EXISTING
Predefined status code for an invitation already existing at relationship invitation.static int
INVITATION_NOT_EXISTING
Predefined status code for a non existing invitation at invitation acceptance.static int
RELATIONSHIP_ALREADY_EXISTING
Predefined status code for a relationship already existing between two users at invitation acceptance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
acceptInvitation(int idInvitation)
accept invitation between sender and receiver and create the relationshipvoid
deleteAllMyInvitations(String userId)
Deletes all the invitations both sent and received of the specified user.static InvitationService
get()
List<Invitation>
getAllMyInvitationsReceive(int myId)
List<Invitation>
getAllMyInvitationsSent(int userId)
return all my invitations sentInvitation
getInvitation(int id)
Invitation
getInvitation(int senderId, int receiverId)
void
ignoreInvitation(int id)
ignore this invitationint
invite(Invitation invitation)
send invitation
-
-
-
Field Detail
-
INVITATION_ALREADY_EXISTING
public static final int INVITATION_ALREADY_EXISTING
Predefined status code for an invitation already existing at relationship invitation.- See Also:
- Constant Field Values
-
RELATIONSHIP_ALREADY_EXISTING
public static final int RELATIONSHIP_ALREADY_EXISTING
Predefined status code for a relationship already existing between two users at invitation acceptance.- See Also:
- Constant Field Values
-
INVITATION_NOT_EXISTING
public static final int INVITATION_NOT_EXISTING
Predefined status code for a non existing invitation at invitation acceptance.- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static InvitationService get()
-
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)
-
acceptInvitation
public int acceptInvitation(int idInvitation)
accept invitation between sender and receiver and create the relationship- Parameters:
idInvitation
- invitation identifier- 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:
- a list of invitations
-
getAllMyInvitationsReceive
public List<Invitation> getAllMyInvitationsReceive(int myId)
-
getInvitation
public Invitation getInvitation(int id)
-
getInvitation
public Invitation getInvitation(int senderId, int receiverId)
-
deleteAllMyInvitations
public void deleteAllMyInvitations(String userId)
Deletes all the invitations both sent and received of the specified user.- Parameters:
userId
- the unique identifier of the user.
-
-