/** * Constructs a bound operation context. The bound wavelet is added to the * list of open wavelets. * * @param waveletProvider the waveletprovider to use for querying wavelet. * @param converter {@link EventDataConverter} for converting from server side * objects. * @param boundWavelet the wavelet to bind this context to, null for an * unbound context. * @param conversationUtil used to create conversations. */ public OperationContextImpl(WaveletProvider waveletProvider, EventDataConverter converter, ConversationUtil conversationUtil, RobotWaveletData boundWavelet) { this.waveletProvider = waveletProvider; this.converter = converter; this.conversationUtil = conversationUtil; this.boundWavelet = boundWavelet; this.openedConversations = Maps.newHashMap(); if (boundWavelet != null) { openedWavelets.put(boundWavelet.getWaveletName(), boundWavelet); } }
@Override public void putWavelet(WaveId waveId, WaveletId waveletId, RobotWaveletData newWavelet) { WaveletName waveletName = newWavelet.getWaveletName(); Preconditions.checkArgument(!openedWavelets.containsKey(waveletName), "Not allowed to put an already open wavelet in as a new wavelet"); // New wavelets are indicated by the temporary marker in their waveId. if (waveId.getId().startsWith(TEMP_ID_MARKER)) { tempWaveletNameMap.put(WaveletName.of(waveId, waveletId), waveletName); } openedWavelets.put(waveletName, newWavelet); }
public void testGetWaveletName() { assertEquals(wavelet.getWaveletName(), WAVELET_NAME); }
public void testGetWaveletName() { assertEquals(wavelet.getWaveletName(), WAVELET_NAME); }