org.atmosphere.cache
Class HeaderBroadcasterCache

java.lang.Object
  extended by org.atmosphere.cache.AbstractBroadcasterCache
      extended by org.atmosphere.cache.HeaderBroadcasterCache
All Implemented Interfaces:
BroadcasterCache

public class HeaderBroadcasterCache
extends AbstractBroadcasterCache

BroadcasterCache implementation based on the X-Cache-Date headers sent by the client.

Author:
Jeanfrancois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.atmosphere.cpr.BroadcasterCache
BroadcasterCache.Message, BroadcasterCache.STRATEGY
 
Field Summary
 
Fields inherited from class org.atmosphere.cache.AbstractBroadcasterCache
inspectors, invalidateCacheInterval, isShared, maxCacheTime, messages, messagesIds, readWriteLock, reaper, scheduledFuture
 
Constructor Summary
HeaderBroadcasterCache()
           
 
Method Summary
 void addToCache(String broadcasterId, AtmosphereResource r, BroadcasterCache.Message e)
          Start tracking messages associated with AtmosphereResource from the cache
 List<Object> retrieveFromCache(String id, AtmosphereResource r)
          Retrieve messages associated with AtmosphereResource
 
Methods inherited from class org.atmosphere.cache.AbstractBroadcasterCache
get, getReaper, inspect, inspector, put, setInvalidateCacheInterval, setMaxCacheTime, setReaper, setShared, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderBroadcasterCache

public HeaderBroadcasterCache()
Method Detail

addToCache

public void addToCache(String broadcasterId,
                       AtmosphereResource r,
                       BroadcasterCache.Message e)
Description copied from interface: BroadcasterCache
Start tracking messages associated with AtmosphereResource from the cache

Parameters:
broadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getID
r - AtmosphereResource
e - a broadcasted message.

retrieveFromCache

public List<Object> retrieveFromCache(String id,
                                      AtmosphereResource r)
Description copied from interface: BroadcasterCache
Retrieve messages associated with AtmosphereResource

Parameters:
id - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getID
r - AtmosphereResource
Returns:
a List of messages (String).


Copyright © 2012. All Rights Reserved.