Class LongPollingCacheFilter

  • All Implemented Interfaces:
    java.io.Serializable, org.atmosphere.cpr.BroadcastFilter, org.atmosphere.cpr.PerRequestBroadcastFilter

    public class LongPollingCacheFilter
    extends java.lang.Object
    implements org.atmosphere.cpr.PerRequestBroadcastFilter, java.io.Serializable
    A PerRequestBroadcastFilter implementation that handles AtmospherePushConnection.PushMessages to ensure that a message is preserved in the BroadcasterCache until the client has received it. The filter acts only on LONG POLLING transport and expects that the client sends the X-Vaadin-LastSeenServerSyncId header with the identifier of the last message seen, every time the connection is established. Messages already seen are discarded, whereas messages not yet sent to the client are added again to the cache to preserve them until client confirms reception by sending the last seen message identifier.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.atmosphere.cpr.BroadcastFilter

        org.atmosphere.cpr.BroadcastFilter.BroadcastAction
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SEEN_SERVER_SYNC_ID  
      • Fields inherited from interface org.atmosphere.cpr.BroadcastFilter

        VOID_ATMOSPHERE_RESOURCE_UUID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId, java.lang.Object originalMessage, java.lang.Object message)  
      org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId, org.atmosphere.cpr.AtmosphereResource r, java.lang.Object originalMessage, java.lang.Object message)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SEEN_SERVER_SYNC_ID

        public static final java.lang.String SEEN_SERVER_SYNC_ID
        See Also:
        Constant Field Values
    • Constructor Detail

      • LongPollingCacheFilter

        public LongPollingCacheFilter()
    • Method Detail

      • filter

        public org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId,
                                                                         org.atmosphere.cpr.AtmosphereResource r,
                                                                         java.lang.Object originalMessage,
                                                                         java.lang.Object message)
        Specified by:
        filter in interface org.atmosphere.cpr.PerRequestBroadcastFilter
      • filter

        public org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId,
                                                                         java.lang.Object originalMessage,
                                                                         java.lang.Object message)
        Specified by:
        filter in interface org.atmosphere.cpr.BroadcastFilter