Package 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classSimple class that tells theBroadcasterto broadcast or not the transformed value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhen a message is about to get cached and someBroadcastFilterare defined, and when noAtmosphereResourceis available, a no-opAtmosphereResourcewith uuid == -1 will be used to invoke BroadcastFilter. -
Method Summary
Modifier and TypeMethodDescriptionTransform or filter a message.
-
Field Details
-
VOID_ATMOSPHERE_RESOURCE_UUID
When a message is about to get cached and someBroadcastFilterare defined, and when noAtmosphereResourceis available, a no-opAtmosphereResourcewith uuid == -1 will be used to invoke BroadcastFilter.- See Also:
-
-
Method Details
-
filter
BroadcastFilter.BroadcastAction filter(String broadcasterId, Object originalMessage, Object message) Transform or filter a message. Return BroadcastAction(ACTION.ABORT, message)Broadcasterto discard the message, eg. to not broadcast it.- Parameters:
broadcasterId- theBroadcaster.getID()calling this objectoriginalMessage- The original message which wasBroadcaster.broadcast(Object);message- The transformed or not message.- Returns:
- a transformed message.
-