Package org.waveprotocol.wave.model.waveref

Examples of org.waveprotocol.wave.model.waveref.WaveRef$Provider


                else if (listener instanceof JmsListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof JmsBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if (provider instanceof JmsJcaProvider) {
                        // Jms JCA provider defaults to true
                        final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
                        if (!jmsJcaProvider.isSetTransacted() || jmsJcaProvider.getTransacted())
                            return true ;
                    } else if (provider instanceof JmsProviderType) {
                        JmsMessageFilter filter = ((JmsListener)listener).getJmsMessageFilter() ;
                        if (filter == null)
                            filter = ((JmsBus)bus).getJmsMessageFilter() ;
                        if ((filter != null) && filter.getTransacted())
                            return true ;
                    }
                } else if (listener instanceof SqlListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof SqlBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if ((provider instanceof SqlProvider) && ((SqlProvider)provider).getTransacted())
                        return true ;
                }
            }
        }
View Full Code Here


    JmsListenerDocument.JmsListener jmsListener = (JmsListener) listeners.get(0);
    assertEquals ( false, jmsListener.getIsGateway() );
   
    JmsBusDocument.JmsBus jmsBus = (JmsBusDocument.JmsBus) model.getBus( jmsListener.getBusidref() );
    assertNotNull( "JmsBus element should exist", jmsBus );
    Provider provider = model.getProvider( jmsBus );
    assertTrue( provider instanceof JmsJcaProvider );
    return (JmsJcaProvider) provider;
  }
View Full Code Here

    }

    // If it's a wave link, use # for local navigation
    if (uri.startsWith(WaveRefConstants.WAVE_URI_PREFIX)) {
      try {
        WaveRef ref = GwtWaverefEncoder.decodeWaveRefFromPath(
            uri.substring(WaveRefConstants.WAVE_URI_PREFIX.length()));

        return "#" + GwtWaverefEncoder.encodeToUriPathSegment(ref);

      } catch (InvalidWaveRefException e) {
View Full Code Here

    // Try to interpret a wave URI or naked waveid/waveref
    try {
      // NOTE(danilatos): Pasting in the raw serialized form of a wave ref is
      // not supported here. In practice this doesn't really matter.
      WaveRef ref;
      if (WaveRefConstants.WAVE_SCHEME.equals(scheme)) {
        ref = GwtWaverefEncoder.decodeWaveRefFromPath(parts[1]);
      } else if (scheme == null) {
        ref = inferWaveRef(rawLinkValue);
      } else if (WaveRefConstants.WAVE_SCHEME_OLD.equals(scheme)) {
View Full Code Here

  public void testDisallowedUserReturnsForbidden() throws Exception {
    waveletProvider.setAllowsAccess(false);

    WaveletData wavelet = waveletProvider.getHostedWavelet();
    WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId());
    verifyServletReturnsForbiddenForWaveref(waveref);
  }
View Full Code Here

  public void testGetMissingDataReturnsForbidden() throws Exception {
    WaveletData wavelet = waveletProvider.getHostedWavelet();
    WaveId waveId = wavelet.getWaveId();
    WaveletId waveletId = wavelet.getWaveletId();

    WaveRef unknownWave = WaveRef.of(WaveId.of(waveId.getDomain(), waveId.getId() + "junk"));
    verifyServletReturnsForbiddenForWaveref(unknownWave);
    WaveRef unknownWavelet = WaveRef.of(waveId, WaveletId.of(waveletId.getDomain(), waveletId.getId() + "junk"));
    verifyServletReturnsForbiddenForWaveref(unknownWavelet);
    WaveRef unknownDocument = WaveRef.of(waveId, waveletId, "madeupdocid");
    verifyServletReturnsForbiddenForWaveref(unknownDocument);
  }
View Full Code Here

   * @throws Exception
   */
  public void testGetWavelet() throws Exception {
    WaveletData wavelet = waveletProvider.getHostedWavelet();

    WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId());
    WaveletSnapshot snapshot = fetchWaverRefAndParse(waveref, WaveletSnapshot.class);
    WaveletData roundtripped = SnapshotSerializer.deserializeWavelet(snapshot, waveref.getWaveId());

    // We have just round-tripped wavelet through the servlet. wavelet and
    // roundtripped should be identical in all the fields that get serialized.
    TestDataUtil.checkSerializedWavelet(wavelet, roundtripped);

View Full Code Here

      StringWriter writer = new StringWriter();
      BlipData expectedDoc = wavelet.getDocument(docId);
      writer.append("" + protoSerializer.toJson(SnapshotSerializer.serializeDocument(expectedDoc)));
      String expectedResult = writer.toString();

      WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId(), docId);
      String actualResult = fetchWaveRef(waveref);

      assertEquals(expectedResult, actualResult);
    }
  }
View Full Code Here

      public void onValueChange(ValueChangeEvent<String> event) {
        String encodedToken = event.getValue();
        if (encodedToken == null || encodedToken.length() == 0) {
          return;
        }
        WaveRef waveRef;
        try {
          waveRef = GwtWaverefEncoder.decodeWaveRefFromPath(encodedToken);
        } catch (InvalidWaveRefException e) {
          LOG.info("History token contains invalid path: " + encodedToken);
          return;
        }
        LOG.info("Changing selected wave based on history event to " + waveRef.toString());
        ClientEvents.get().fireEvent(new WaveSelectionEvent(waveRef));
      }
    });
  }
View Full Code Here

        Timing.stop(timer);
      }
    });
    String encodedToken = History.getToken();
    if (encodedToken != null && !encodedToken.isEmpty()) {
      WaveRef fromWaveRef;
      try {
        fromWaveRef = GwtWaverefEncoder.decodeWaveRefFromPath(encodedToken);
      } catch (InvalidWaveRefException e) {
        LOG.info("History token contains invalid path: " + encodedToken);
        return;
      }
      if (fromWaveRef.getWaveId().equals(waveRef.getWaveId())) {
        // History change was caused by clicking on a link, it's already
        // updated by browser.
        return;
      }
    }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.waveref.WaveRef$Provider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.