org.atmosphere.wasync.impl
Class AtmosphereRequest.AtmosphereRequestBuilder

java.lang.Object
  extended by org.atmosphere.wasync.RequestBuilder<AtmosphereRequest.AtmosphereRequestBuilder>
      extended by org.atmosphere.wasync.impl.AtmosphereRequest.AtmosphereRequestBuilder
Direct Known Subclasses:
SerializedClient.SerializedRequestBuilder
Enclosing class:
AtmosphereRequest

public static class AtmosphereRequest.AtmosphereRequestBuilder
extends RequestBuilder<AtmosphereRequest.AtmosphereRequestBuilder>

A builder for AtmosphereRequest. This builder configure the Atmosphere Protocol on the request object.


Field Summary
 
Fields inherited from class org.atmosphere.wasync.RequestBuilder
decoders, derived, encoders, headers, method, queryString, resolver, transports, uri
 
Constructor Summary
AtmosphereRequest.AtmosphereRequestBuilder()
           
 
Method Summary
 AtmosphereRequest build()
          Build a Request.
 AtmosphereRequest.AtmosphereRequestBuilder cache(AtmosphereRequest.CACHE c)
          Set the AtmosphereRequest.CACHE used by the server side implementation of Atmosphere.
 AtmosphereRequest.AtmosphereRequestBuilder enableProtocol(boolean enableProtocol)
          Set to true to enable the Atmosphere Protocol.
 AtmosphereRequest.AtmosphereRequestBuilder trackMessageLength(boolean trackMessageLength)
          Turn on/off tracking message.
 AtmosphereRequest.AtmosphereRequestBuilder trackMessageLengthDelimiter(String trackMessageLengthDelimiter)
          Set the tracking delimiter.
 AtmosphereRequest.AtmosphereRequestBuilder transport(Request.TRANSPORT t)
          The Request.TRANSPORT to use.
 
Methods inherited from class org.atmosphere.wasync.RequestBuilder
decoder, decoders, encoder, encoders, header, headers, method, method, queryString, queryString, resolver, resolver, transports, uri, uri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosphereRequest.AtmosphereRequestBuilder

public AtmosphereRequest.AtmosphereRequestBuilder()
Method Detail

transport

public AtmosphereRequest.AtmosphereRequestBuilder transport(Request.TRANSPORT t)
The Request.TRANSPORT to use. This method can be invoked several time and the library will loop over the list until one Request.TRANSPORT succeed. The first added is always the first used.

Overrides:
transport in class RequestBuilder<AtmosphereRequest.AtmosphereRequestBuilder>
Returns:
this

cache

public AtmosphereRequest.AtmosphereRequestBuilder cache(AtmosphereRequest.CACHE c)
Set the AtmosphereRequest.CACHE used by the server side implementation of Atmosphere.

Parameters:
c - the cache type.
Returns:
this;

trackMessageLength

public AtmosphereRequest.AtmosphereRequestBuilder trackMessageLength(boolean trackMessageLength)
Turn on/off tracking message.

Parameters:
trackMessageLength - true to enable.
Returns:
this

trackMessageLengthDelimiter

public AtmosphereRequest.AtmosphereRequestBuilder trackMessageLengthDelimiter(String trackMessageLengthDelimiter)
Set the tracking delimiter.

Parameters:
trackMessageLengthDelimiter - true to enable.
Returns:
this

enableProtocol

public AtmosphereRequest.AtmosphereRequestBuilder enableProtocol(boolean enableProtocol)
Set to true to enable the Atmosphere Protocol. Default is true.

Parameters:
enableProtocol - false to disable.
Returns:
this

build

public AtmosphereRequest build()
Build a Request. IMPORTANT: if you are using stateful Decoder, you must NOT call this method more than once to prevent response corruption. Important: You cannot call the build() method more than once if enableProtocol or trackMessageLength are set to true.

Specified by:
build in class RequestBuilder<AtmosphereRequest.AtmosphereRequestBuilder>
Returns:
a Request


Copyright © 2013. All Rights Reserved.