org.atmosphere.client
Class TrackMessageSizeInterceptor

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereInterceptorAdapter
      extended by org.atmosphere.client.TrackMessageSizeInterceptor
All Implemented Interfaces:
AtmosphereInterceptor, InvokationOrder

public class TrackMessageSizeInterceptor
extends AtmosphereInterceptorAdapter

An AtmosphereInterceptor that add a message size and delimiter.

The special String is configurable using ApplicationConfig.MESSAGE_DELIMITER and you can configure this class to exclude some response's content-type by using the ApplicationConfig.EXCLUDED_CONTENT_TYPES

Author:
Jeanfrancois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.atmosphere.interceptor.InvokationOrder
InvokationOrder.PRIORITY
 
Field Summary
static String SKIP_INTERCEPTOR
           
 
Fields inherited from interface org.atmosphere.interceptor.InvokationOrder
AFTER_DEFAULT, BEFORE_DEFAULT, FIRST_BEFORE_DEFAULT
 
Constructor Summary
TrackMessageSizeInterceptor()
           
 
Method Summary
 void configure(AtmosphereConfig config)
          Allow this object to configure its state when initialized.
 TrackMessageSizeInterceptor excludedContentType(String excludedContentType)
          Exclude response's content-type from being processed by this class.
 Action inspect(AtmosphereResource r)
          Invoked before an AtmosphereResource gets dispatched to AtmosphereHandler.
 TrackMessageSizeInterceptor messageDelimiter(String endString)
          Set the character delimiter used by this class to separate message.
 String toString()
           
 
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorAdapter
postInspect, priority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SKIP_INTERCEPTOR

public static final String SKIP_INTERCEPTOR
Constructor Detail

TrackMessageSizeInterceptor

public TrackMessageSizeInterceptor()
Method Detail

configure

public void configure(AtmosphereConfig config)
Description copied from interface: AtmosphereInterceptor
Allow this object to configure its state when initialized.

Specified by:
configure in interface AtmosphereInterceptor
Overrides:
configure in class AtmosphereInterceptorAdapter
Parameters:
config - an AtmosphereConfig

messageDelimiter

public TrackMessageSizeInterceptor messageDelimiter(String endString)
Set the character delimiter used by this class to separate message.

Parameters:
endString -
Returns:
this

excludedContentType

public TrackMessageSizeInterceptor excludedContentType(String excludedContentType)
Exclude response's content-type from being processed by this class.

Parameters:
excludedContentType - the value of AtmosphereResponse.getContentType()
Returns:
this

inspect

public Action inspect(AtmosphereResource r)
Description copied from interface: AtmosphereInterceptor
Invoked before an AtmosphereResource gets dispatched to AtmosphereHandler.

Specified by:
inspect in interface AtmosphereInterceptor
Overrides:
inspect in class AtmosphereInterceptorAdapter
Parameters:
r - a AtmosphereResource
Returns:
Action.CONTINUE or Action.SUSPEND to dispatch the AtmosphereResource to other AtmosphereInterceptor or AtmosphereHandler. Return Action.TYPE.CANCELLED to stop the processing.

toString

public String toString()
Overrides:
toString in class AtmosphereInterceptorAdapter


Copyright © 2014. All Rights Reserved.