org.atmosphere.cache
Class HeaderBroadcasterCache
java.lang.Object
org.atmosphere.cache.AbstractBroadcasterCache
org.atmosphere.cache.HeaderBroadcasterCache
- All Implemented Interfaces:
- BroadcasterCache
public class HeaderBroadcasterCache
- extends AbstractBroadcasterCache
Simple header based BroadcasterCache. The returned header is "X-Cache-Date" and
containg the time, in milliseconds, of the last broadcasted message.
By default, message will be cached for 5 minutes. You can change the value by calling AbstractBroadcasterCache.setMaxCachedinMs(int)
- Author:
- Jeanfrancois Arcand
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeaderBroadcasterCache
public HeaderBroadcasterCache()
cache
public void cache(String id,
AtmosphereResource ar,
AbstractBroadcasterCache.CachedMessage cm)
- Cache the last message broadcasted.
- Specified by:
cache in class AbstractBroadcasterCache
ar - AtmosphereResource.cm - AbstractBroadcasterCache.CachedMessage
retrieveLastMessage
public AbstractBroadcasterCache.CachedMessage retrieveLastMessage(String id,
AtmosphereResource ar)
- Return the last message broadcasted to the
AtmosphereResource.
- Specified by:
retrieveLastMessage in class AbstractBroadcasterCache
ar - AtmosphereResource.
- Returns:
- a
AbstractBroadcasterCache.CachedMessage, or null if not matched.
retrieveUsingHeader
public AbstractBroadcasterCache.CachedMessage retrieveUsingHeader(String dateString)
Copyright © 2013. All Rights Reserved.