// Add participant to conversation and send event.
conversation.addParticipant(targetParticipant);
participantsAdded.add(targetParticipant.getAddress());
event =
new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
break;
case WAVELET_REMOVE_PARTICIPANT_NEWSYNTAX:
// Make sure targetParticipant is already member.
if (!conversation.getParticipantIds().contains(targetParticipant)) {
// Not a member, throw invalid request.
String message = targetParticipant.getAddress() + " is not a " + "member of wavelet";
LOG.info(message);
throw new InvalidRequestException(message, operation);
}
// Remove participant and send event.
conversation.removeParticipant(targetParticipant);
participantsRemoved.add(targetParticipant.getAddress());
event =
new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
break;
default:
throw new UnsupportedOperationException(
"This OperationService does not implement operation of type " + type.method());