/** * Constructor that extracts {@code waveId}, {@code waveletId}, and * {@code blipId} from the given {@code BlipData}. * * @param method the method or operation to be executed. * See {@link OperationType}. * @param id the id of the request. * @param blipData the {@code BlipData} to extract {@code waveId}, * {@code waveletId}, and {@code blipId} from. * @param parameters additional parameters for this operation. See * {@link ParamsProperty}. */ public OperationRequest(String method, String id, BlipData blipData, Parameter...parameters) { this(method, id, blipData.getWaveId(), blipData.getWaveletId(), blipData.getBlipId(), parameters); }
/** * Implementation for the {@link OperationType#WAVELET_APPEND_BLIP} method. It * appends a blip at the end of the root thread. * * @param operation the operation to execute. * @param context the context of the operation. * @param participant the participant performing this operation. * @param conversation the conversation to operate on. * @throws InvalidRequestException if the operation fails to perform */ private void appendBlip(OperationRequest operation, OperationContext context, ParticipantId participant, ObservableConversation conversation) throws InvalidRequestException { Preconditions.checkArgument( OperationUtil.getOperationType(operation) == OperationType.WAVELET_APPEND_BLIP, "Unsupported operation " + operation); BlipData blipData = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_DATA); ObservableConversationBlip newBlip = conversation.getRootThread().appendBlip(); context.putBlip(blipData.getBlipId(), newBlip); putContentForNewBlip(newBlip, blipData.getContent()); processBlipCreatedEvent(operation, context, participant, conversation, newBlip); }
content = blip.getContent(); contributors = blip.getContributors(); blipId = blip.getBlipId(); lastModifiedTime = blip.getLastModifiedTime(); version = blip.getVersion();
/** * Implementation of the {@link OperationType#BLIP_CONTINUE_THREAD} method. It * appends a new blip to the end of the thread of the blip specified in the * operation. * * @param operation the operation to execute. * @param context the context of the operation. * @param participant the participant performing this operation. * @param conversation the conversation to operate on. * @throws InvalidRequestException if the operation fails to perform */ private void continueThread(OperationRequest operation, OperationContext context, ParticipantId participant, ObservableConversation conversation) throws InvalidRequestException { Preconditions.checkArgument( OperationUtil.getOperationType(operation) == OperationType.BLIP_CONTINUE_THREAD, "Unsupported operation " + operation); BlipData blipData = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_DATA); String parentBlipId = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_ID); ConversationBlip parentBlip = context.getBlip(conversation, parentBlipId); ConversationBlip newBlip = parentBlip.getThread().appendBlip(); context.putBlip(blipData.getBlipId(), newBlip); putContentForNewBlip(newBlip, blipData.getContent()); processBlipCreatedEvent(operation, context, participant, conversation, newBlip); }
/** * Implementation of the {@link OperationType#BLIP_CREATE_CHILD} method. It * appends a new reply thread to the blip specified in the operation. * * @param operation the operation to execute. * @param context the context of the operation. * @param participant the participant performing this operation. * @param conversation the conversation to operate on. * @throws InvalidRequestException if the operation fails to perform */ private void createChild(OperationRequest operation, OperationContext context, ParticipantId participant, ObservableConversation conversation) throws InvalidRequestException { Preconditions.checkArgument( OperationUtil.getOperationType(operation) == OperationType.BLIP_CREATE_CHILD, "Unsupported operation " + operation); BlipData blipData = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_DATA); String parentBlipId = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_ID); ConversationBlip parentBlip = context.getBlip(conversation, parentBlipId); ConversationBlip newBlip = parentBlip.addReplyThread().appendBlip(); context.putBlip(blipData.getBlipId(), newBlip); putContentForNewBlip(newBlip, blipData.getContent()); processBlipCreatedEvent(operation, context, participant, conversation, newBlip); }
BlipData blipData) { String blipId = blipData.getBlipId(); String parentBlipId = blipData.getParentBlipId(); String threadId = blipData.getThreadId();
context.putBlip(blipData.getBlipId(), newBlip);
context.putBlip(blipData.getBlipId(), newBlip);
context.putBlip(blipData.getBlipId(), newBlip);