org.atmosphere.cpr
Interface BroadcastFilter

All Known Subinterfaces:
BroadcastFilterLifecycle, ClusterBroadcastFilter, PerRequestBroadcastFilter
All Known Implementing Classes:
BroadcastFilterAdapter, StringFilterAggregator, TrackMessageSizeFilter, XSSHtmlFilter

public interface BroadcastFilter

Transform a message before it get broadcasted to AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent).

See XSSHtmlFilter for an example.

Author:
Jeanfrancois Arcand

Nested Class Summary
static class BroadcastFilter.BroadcastAction
          Simple class that tells the Broadcaster to broadcast or not the transformed value.
 
Field Summary
static String VOID_ATMOSPHERE_RESOURCE_UUID
          When a message is about to get cached and some BroadcastFilter are defined, and when no AtmosphereResource is available, a no-op AtmosphereResource with uuid == -1 will be used to invoke BroadcastFilter.
 
Method Summary
 BroadcastFilter.BroadcastAction filter(Object originalMessage, Object message)
          Transform or filter a message.
 

Field Detail

VOID_ATMOSPHERE_RESOURCE_UUID

static final String VOID_ATMOSPHERE_RESOURCE_UUID
When a message is about to get cached and some BroadcastFilter are defined, and when no AtmosphereResource is available, a no-op AtmosphereResource with uuid == -1 will be used to invoke BroadcastFilter.

See Also:
Constant Field Values
Method Detail

filter

BroadcastFilter.BroadcastAction filter(Object originalMessage,
                                       Object message)
Transform or filter a message. Return BroadcastAction(ACTION.ABORT, message) Broadcaster to discard the message, eg. to not broadcast it.

Parameters:
originalMessage - The original message which was Broadcaster.broadcast(Object);
message - The transformed or not message.
Returns:
a transformed message.


Copyright © 2014. All Rights Reserved.