/** * Requests a snapshot of the specified wave. * * @param waveId the id of the wave that should be fetched. * @param waveletId the wavelet id that should be fetched. */ public void fetchWavelet(WaveId waveId, WaveletId waveletId) { appendOperation(OperationType.ROBOT_FETCH_WAVE, waveId, waveletId, null); }
/** * Exports snapshot of wavelet. * * @param waveId the id of the wave that should be exported. * @param waveletId the id of the wavelet that should be exported. */ public void exportSnapshot(WaveId waveId, WaveletId waveletId) { appendOperation(OperationType.ROBOT_EXPORT_SNAPSHOT, waveId, waveletId, null); }
/** * Creates and appends a new operation to the operation queue. * * @param opType the type of the operation. * @param parameters the parameters that should be added as a property of * the operation. * @return an instance of {@link OperationRequest} that represents the queued * operation. */ OperationRequest appendOperation(OperationType opType, Parameter... parameters) { return appendOperation(opType, null, null, null, parameters); }
/** * Removes a participant from a wavelet. * * @param wavelet the wavelet that the participant should be removed from. * @param participantId the id of the participant to be removed. */ public void removeParticipantFromWavelet(Wavelet wavelet, String participantId) { appendOperation(OperationType.WAVELET_REMOVE_PARTICIPANT_NEWSYNTAX, wavelet, Parameter.of(ParamsProperty.PARTICIPANT_ID, participantId)); }
/** * Imports deltas of wavelet. * * @param waveId the id of the wave that should be imported. * @param waveletId the id of the wavelet that should be imported. * @param history the history in deltas. */ public void importRawDeltas(WaveId waveId, WaveletId waveletId, List<byte[]> history) { appendOperation(OperationType.ROBOT_IMPORT_DELTAS, waveId, waveletId, null, Parameter.of(ParamsProperty.RAW_DELTAS, history)); }
/** * Adds a participant to a wavelet. * * @param wavelet the wavelet that the new participant should be added to. * @param participantId the id of the new participant. */ public void addParticipantToWavelet(Wavelet wavelet, String participantId) { appendOperation(OperationType.WAVELET_ADD_PARTICIPANT_NEWSYNTAX, wavelet, Parameter.of(ParamsProperty.PARTICIPANT_ID, participantId)); }
/** * Retrieves list of wave wavelets ids. * * @param waveId the id of the wave. */ public void retrieveWaveletIds(WaveId waveId) { appendOperation(OperationType.ROBOT_FETCH_WAVE, waveId, null, null, Parameter.of(ParamsProperty.RETURN_WAVELET_IDS, true)); }
public void fetchProfiles(FetchProfilesRequest request) { appendOperation(OperationType.ROBOT_FETCH_PROFILES, Parameter.of(ParamsProperty.FETCH_PROFILES_REQUEST, request)); } }
/** * Sets the title of a wavelet. * * @param wavelet the wavelet whose title will be changed. * @param title the new title to be set. */ public void setTitleOfWavelet(Wavelet wavelet, String title) { appendOperation(OperationType.WAVELET_SET_TITLE, wavelet, Parameter.of(ParamsProperty.WAVELET_TITLE, title)); }
/** * Appends content with markup to a blip. * * @param blip the blip where this markup content should be added to. * @param content the markup content that should be added to the blip. */ public void appendMarkupToDocument(Blip blip, String content) { appendOperation(OperationType.DOCUMENT_APPEND_MARKUP, blip, Parameter.of(ParamsProperty.CONTENT, content)); }
/** * Export attachment. * * @param attachmentId the id of attachment. */ public void exportAttachment(AttachmentId attachmentId) { appendOperation(OperationType.ROBOT_EXPORT_ATTACHMENT, Parameter.of(ParamsProperty.ATTACHMENT_ID, attachmentId.serialise())); }
/** * Deletes the specified blip. * * @param wavelet the wavelet that owns the blip. * @param blipId the id of the blip that will be deleted. */ public void deleteBlip(Wavelet wavelet, String blipId) { appendOperation(OperationType.BLIP_DELETE, wavelet.getWaveId(), wavelet.getWaveletId(), blipId); }
/** * Sets a key-value pair on the data document of a wavelet. * * @param wavelet to set the data document on. * @param name the name of this data. * @param value the value of this data. */ public void setDatadocOfWavelet(Wavelet wavelet, String name, String value) { appendOperation(OperationType.WAVELET_SET_DATADOC, wavelet, Parameter.of(ParamsProperty.DATADOC_NAME, name), Parameter.of(ParamsProperty.DATADOC_VALUE, value)); }
/** * Modifies the role of a participant in a wavelet. * * @param wavelet the wavelet that the participant is on * @param participant whose role to modify * @param role to set for the participant */ public void modifyParticipantRoleOfWavelet(Wavelet wavelet, String participant, String role) { appendOperation(OperationType.WAVELET_MODIFY_PARTICIPANT_ROLE, wavelet, Parameter.of(ParamsProperty.PARTICIPANT_ID, participant), Parameter.of(ParamsProperty.PARTICIPANT_ROLE, role)); }
/** * Exports deltas of wavelet. * * @param waveId the id of the wave that should be exported. * @param waveletId the id of the wavelet that should be exported. * @param fromVersion start version. * @param toVersion to version. */ public void exportRawDeltas(WaveId waveId, WaveletId waveletId, byte[] fromVersion, byte[] toVersion) { appendOperation(OperationType.ROBOT_EXPORT_DELTAS, waveId, waveletId, null, Parameter.of(ParamsProperty.FROM_VERSION, fromVersion), Parameter.of(ParamsProperty.TO_VERSION, toVersion)); }
/** * Modifies a tag in a wavelet. * * @param wavelet the wavelet to modify the tag from. * @param tag the name of the tag to be modified * @param modifyHow how to modify the tag. The default behavior is to add the * tag. Specify {@code remove} to remove, or specify {@code null} or * {@code add} to add. */ public void modifyTagOfWavelet(Wavelet wavelet, String tag, String modifyHow) { appendOperation(OperationType.WAVELET_MODIFY_TAG, wavelet, Parameter.of(ParamsProperty.NAME, tag), Parameter.of(ParamsProperty.MODIFY_HOW, modifyHow)); }
/** * Appends search operation for specified query. * * @param query the query to execute. * @param index the index from which to return results. * @param numresults the number of results to return. */ public void search(String query, Integer index, Integer numresults) { Parameter queryParam = Parameter.of(ParamsProperty.QUERY, query); Parameter indexParam = Parameter.of(ParamsProperty.INDEX, index); Parameter numresultsParam = Parameter.of(ParamsProperty.NUM_RESULTS, numresults); appendOperation(OperationType.ROBOT_SEARCH, queryParam, indexParam, numresultsParam); }
/** * Creates and appends a new operation to the operation queue. * * @param opType the type of the operation. * @param blip the blip to apply this operation to. * @param parameters the parameters that should be added as a property of * the operation. * @return an instance of {@link OperationRequest} that represents the queued * operation. */ OperationRequest appendOperation(OperationType opType, Blip blip, Parameter... parameters) { return appendOperation(opType, blip.getWaveId(), blip.getWaveletId(), blip.getBlipId(), parameters); }
/** * Appends a blip to a wavelet. * * @param wavelet the wavelet to append the new blip to. * @param initialContent the initial content of the new blip. * @return an instance of {@link Blip} that represents the new blip. */ public Blip appendBlipToWavelet(Wavelet wavelet, String initialContent) { Blip newBlip = newBlip(wavelet, initialContent, null, generateTempBlipId(wavelet), wavelet.getRootThread().getId()); appendOperation(OperationType.WAVELET_APPEND_BLIP, wavelet, Parameter.of(ParamsProperty.BLIP_DATA, newBlip.serialize())); return newBlip; }
/** * Appends a new blip to the end of the thread of the given blip. * * @param blip the blip whose thread will be appended. * @return an instance of {@link Blip} that represents the new blip. */ public Blip continueThreadOfBlip(Blip blip) { Blip newBlip = newBlip(blip.getWavelet(), "", blip.getParentBlipId(), generateTempBlipId(blip.getWavelet()), blip.getThread().getId()); appendOperation(OperationType.BLIP_CONTINUE_THREAD, blip, Parameter.of(ParamsProperty.BLIP_DATA, newBlip.serialize())); return newBlip; }