org.atmosphere.cache
Class SessionBroadcasterCache

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

public class SessionBroadcasterCache
extends AbstractBroadcasterCache

Simple BroadcasterCache that use an HttpSession to cache messages.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class org.atmosphere.cache.AbstractBroadcasterCache
emptyList, inspectors, invalidateCacheInterval, isShared, listeners, maxCacheTime, messages, messagesIds, readWriteLock, reaper, scheduledFuture
 
Fields inherited from interface org.atmosphere.cpr.BroadcasterCache
DEFAULT, NULL
 
Constructor Summary
SessionBroadcasterCache()
           
 
Method Summary
 CacheMessage addToCache(String broadcasterId, String uuid, BroadcastMessage message)
          Start tracking messages associated with AtmosphereResource from the cache.
 List<Object> retrieveFromCache(String broadcasterId, String uuid)
          Retrieve messages associated with AtmosphereResource.
 
Methods inherited from class org.atmosphere.cache.AbstractBroadcasterCache
addBroadcasterCacheListener, cacheCandidate, cleanup, clearCache, configure, excludeFromCache, get, inspect, inspector, put, removeBroadcasterCacheListener, setInvalidateCacheInterval, setMaxCacheTime, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionBroadcasterCache

public SessionBroadcasterCache()
Method Detail

addToCache

public CacheMessage addToCache(String broadcasterId,
                               String uuid,
                               BroadcastMessage message)
Description copied from interface: BroadcasterCache
Start tracking messages associated with AtmosphereResource from the cache.

Parameters:
broadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getID
uuid - AtmosphereResource.uuid()
message - BroadcastMessage.
Returns:
The CacheMessage

retrieveFromCache

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

Parameters:
broadcasterId - The associated org.atmosphere.cpr.Broadcaster#addAtmosphereResource(org.atmosphere.cpr.AtmosphereResource).getID
uuid - AtmosphereResource
Returns:
a List of messages (String).


Copyright © 2014. All rights reserved.