Package com.google.wave.extensions.tweety.util

Examples of com.google.wave.extensions.tweety.util.WaveSubmittedTweetsCache.purge()


      // Update the latest tweet id, and purge the cache.
      WaveSubmittedTweetsCache cache = new WaveSubmittedTweetsCache();
      if (!newTweets.isEmpty()) {
        twitterWave.setLatestTweetId(newTweets.get(0).getId());
        cache.purge(twitterWave.getWaveId(), twitterWave.getLatestTweetId());
      } else {
        String lastTweetSubmitted = cache.last(twitterWave.getWaveId());
        if (!Util.isEmpty(lastTweetSubmitted) &&
            lastTweetSubmitted.compareTo(twitterWave.getLatestTweetId()) > 0) {
          twitterWave.setLatestTweetId(lastTweetSubmitted);
View Full Code Here


      } else {
        String lastTweetSubmitted = cache.last(twitterWave.getWaveId());
        if (!Util.isEmpty(lastTweetSubmitted) &&
            lastTweetSubmitted.compareTo(twitterWave.getLatestTweetId()) > 0) {
          twitterWave.setLatestTweetId(lastTweetSubmitted);
          cache.purge(twitterWave.getWaveId(), lastTweetSubmitted);
        }
      }
    } catch (IOException e) {
      LOG.warning("There is a problem connecting to Twitter. Cause:" + e.getMessage());
    } catch (JSONException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.